Skip to content

Commit

Permalink
vmlinux.lds: move __attribute__((__cold__)) functions back into final…
Browse files Browse the repository at this point in the history
… .text section

Due to the addition of __attribute__((__cold__)) to a few symbols
without adjusting the linker scripts, those symbols currently may end
up outside the [_stext,_etext) range, as they get placed in
.text.unlikely by (at least) gcc 4.3.0. This may confuse code not only
outside of the kernel, symbol_put_addr()'s BUG() could also trigger.
Hence we need to add .text.unlikely (and for future uses of
__attribute__((__hot__)) also .text.hot) to the TEXT_TEXT() macro.

Issue observed by Lukas Lipavsky.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Tested-by: Lukas Lipavsky <llipavsky@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Jan Beulich authored and Sam Ravnborg committed Jul 25, 2008
1 parent 37a4c94 commit fb5e2b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
* during second ld run in second ld pass when generating System.map */
#define TEXT_TEXT \
ALIGN_FUNCTION(); \
*(.text.hot) \
*(.text) \
*(.ref.text) \
*(.text.init.refok) \
Expand All @@ -230,7 +231,8 @@
CPU_KEEP(init.text) \
CPU_KEEP(exit.text) \
MEM_KEEP(init.text) \
MEM_KEEP(exit.text)
MEM_KEEP(exit.text) \
*(.text.unlikely)


/* sched.text is aling to function alignment to secure we have same
Expand Down

0 comments on commit fb5e2b3

Please sign in to comment.