move __attribute__((__cold__)) functions back into final .text section
PATCH 1/1 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.
--- include/asm-generic/vmlinux.lds.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/asm-generic/vmlinux.lds.h +3 -1
@@ -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
Jan Beulich píše v St 18. 06. 2008 v 12:36 +0100:
Quoted 9 lines
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 theTEXT_TEXT()macro.Cc Lukas Lipavsky <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Sam Ravnborg
AppliedQuoted 8 lines · Jan Beulich
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 theTEXT_TEXT()macro.
Quoted 4 lines
Issue observed by Lukas Lipavsky.
Cc Lukas Lipavsky <[email protected]>Signed-off-by Jan Beulich <[email protected]>
Applied.
Sam
Quoted 29 lines · On Wed, 18 Jun 2008 12:36:01 +0100 "Jan Beulich" <[email protected]> wrote:
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 theTEXT_TEXT()macro.Issue observed by Lukas Lipavsky.
Cc Lukas Lipavsky <[email protected]>Signed-off-by Jan Beulich <[email protected]>--- include/asm-generic/vmlinux.lds.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/asm-generic/vmlinux.lds.h +1
-0@@ -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) \
include/asm-generic/vmlinux.lds.h line 221
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +2
-1@@ -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
So this is now in Sam's git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git. But it is not in the present linux-next. Either because Sam added it after Stephen pulled Sam's tree, or because something screwed up.
So I'll now be dropping it. Sam, please ensure that it gets into 2.6.26 and 2.6.25.x (IMO).
Thanks.
Hi Andrew,
Quoted 5 lines · On Tue, 1 Jul 2008 23:17:17 -0700 Andrew Morton <[email protected]>…
So this is now in Sam's git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git. But it is not in the present linux-next. Either because Sam added it after Stephen pulled Sam's tree, or because something screwed up.
Its in the linux-next tree I have just (in the last 30 minutes) published (but not yet announced) (tag next-20080702).
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 46 lines · Andrew Morton
Quoted 29 lines · On Wed, 18 Jun 2008 12:36:01 +0100 "Jan Beulich" <[email protected]> wrote:
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 theTEXT_TEXT()macro.Issue observed by Lukas Lipavsky.
Cc Lukas Lipavsky <[email protected]>Signed-off-by Jan Beulich <[email protected]>--- include/asm-generic/vmlinux.lds.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/asm-generic/vmlinux.lds.h +1
-0@@ -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) \include/asm-generic/vmlinux.lds.h line 221
Quoted 9 lines
include/asm-generic/vmlinux.lds.h +2
-1@@ -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 So this is now in Sam's git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git. But it is not in the present linux-next. Either because Sam added it after Stephen pulled Sam's tree, or because something screwed up.
Quoted 2 lines
So I'll now be dropping it. Sam, please ensure that it gets into 2.6.26 and 2.6.25.x (IMO).
I have added a Cc: <[email protected]> so the stable team should pick it when applied to -linus.
Sam