Commit e79ef852 authored by Jan Beulich's avatar Jan Beulich Committed by Greg Kroah-Hartman

vmlinux.lds: move __attribute__((__cold__)) functions back into final .text section

commit fb5e2b37 upstream

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: default avatarJan Beulich <jbeulich@novell.com>
Tested-by: default avatarLukas Lipavsky <llipavsky@suse.cz>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4e0567d4
...@@ -204,6 +204,7 @@ ...@@ -204,6 +204,7 @@
* during second ld run in second ld pass when generating System.map */ * during second ld run in second ld pass when generating System.map */
#define TEXT_TEXT \ #define TEXT_TEXT \
ALIGN_FUNCTION(); \ ALIGN_FUNCTION(); \
*(.text.hot) \
*(.text) \ *(.text) \
*(.ref.text) \ *(.ref.text) \
*(.text.init.refok) \ *(.text.init.refok) \
...@@ -213,7 +214,8 @@ ...@@ -213,7 +214,8 @@
CPU_KEEP(init.text) \ CPU_KEEP(init.text) \
CPU_KEEP(exit.text) \ CPU_KEEP(exit.text) \
MEM_KEEP(init.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 /* sched.text is aling to function alignment to secure we have same
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment