All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] move __attribute__((__cold__)) functions back into final .text section
@ 2008-06-18 11:36 Jan Beulich
  2008-06-20  9:06 ` Lukas Lipavsky
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jan Beulich @ 2008-06-18 11:36 UTC (permalink / raw)
  To: sam; +Cc: stable, llipavsky, linux-kernel

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.

Cc: Lukas Lipavsky <llipavsky@suse.cz>
Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 include/asm-generic/vmlinux.lds.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.26-rc6/include/asm-generic/vmlinux.lds.h	2008-04-17 04:49:44.000000000 +0200
+++ 2.6.26-rc6-hot-cold-text/include/asm-generic/vmlinux.lds.h	2008-06-18 12:19:22.000000000 +0200
@@ -204,6 +204,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)					\
@@ -213,7 +214,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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-06 21:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-18 11:36 [PATCH] move __attribute__((__cold__)) functions back into final .text section Jan Beulich
2008-06-20  9:06 ` Lukas Lipavsky
2008-06-27 21:03 ` Sam Ravnborg
2008-07-02  6:17 ` Andrew Morton
2008-07-02  6:29   ` Stephen Rothwell
2008-07-06 21:12   ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.