diff options
| author | Jan Beulich <jbeulich@novell.com> | 2008-06-18 07:36:01 -0400 |
|---|---|---|
| committer | Sam Ravnborg <sam@ravnborg.org> | 2008-07-25 16:12:37 -0400 |
| commit | fb5e2b379732e1a6ea32392980bb42e0212db842 (patch) | |
| tree | ce9506474dcd426ea0102836e9b719d7cb73a844 | |
| parent | 37a4c940749670671adab211a2d9c9fed9f3f757 (diff) | |
vmlinux.lds: move __attribute__((__cold__)) functions back into final .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>
| -rw-r--r-- | include/asm-generic/vmlinux.lds.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 729f6b0a60e9..bd2be5fd1276 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -221,6 +221,7 @@ | |||
| 221 | * during second ld run in second ld pass when generating System.map */ | 221 | * during second ld run in second ld pass when generating System.map */ |
| 222 | #define TEXT_TEXT \ | 222 | #define TEXT_TEXT \ |
| 223 | ALIGN_FUNCTION(); \ | 223 | ALIGN_FUNCTION(); \ |
| 224 | *(.text.hot) \ | ||
| 224 | *(.text) \ | 225 | *(.text) \ |
| 225 | *(.ref.text) \ | 226 | *(.ref.text) \ |
| 226 | *(.text.init.refok) \ | 227 | *(.text.init.refok) \ |
| @@ -230,7 +231,8 @@ | |||
| 230 | CPU_KEEP(init.text) \ | 231 | CPU_KEEP(init.text) \ |
| 231 | CPU_KEEP(exit.text) \ | 232 | CPU_KEEP(exit.text) \ |
| 232 | MEM_KEEP(init.text) \ | 233 | MEM_KEEP(init.text) \ |
| 233 | MEM_KEEP(exit.text) | 234 | MEM_KEEP(exit.text) \ |
| 235 | *(.text.unlikely) | ||
| 234 | 236 | ||
| 235 | 237 | ||
| 236 | /* sched.text is aling to function alignment to secure we have same | 238 | /* sched.text is aling to function alignment to secure we have same |
