]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
vmlinux.lds: move __attribute__((__cold__)) functions back into final .text section
authorJan Beulich <jbeulich@novell.com>
Sun, 27 Jul 2008 17:30:04 +0000 (17:30 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Aug 2008 19:43:05 +0000 (12:43 -0700)
commit fb5e2b379732e1a6ea32392980bb42e0212db842 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: Jan Beulich <jbeulich@novell.com>
Tested-by: Lukas Lipavsky <llipavsky@suse.cz>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/asm-generic/vmlinux.lds.h

index f054778e916c08e0b1e7cc85dd028de15b21edb2..5a544bf1edb5ff08dd8716c006415bd188c5c3b7 100644 (file)
  * 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)                                     \
        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