Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ppc32: discard *.exit.text and *.exit.data sections

Discard *.exit.text sections on runtime. We cannot do this on link time
because of the way BUG macros are implemented. If "__exit function" calls
one of those macros, __bug_table section will reference this function.
This is similar to ".altinstructions" situation on i386.

*.exit.data seems to be OK in this respect and is discarded on link
time.

Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Acked-by: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Tom Rini and committed by
Linus Torvalds
6a00cbfc 5b952b3c

+4
+4
arch/ppc/kernel/vmlinux.lds.S
··· 96 96 *(.init.text) 97 97 _einittext = .; 98 98 } 99 + /* .exit.text is discarded at runtime, not link time, 100 + to deal with references from __bug_table */ 101 + .exit.text : { *(.exit.text) } 99 102 .init.data : { 100 103 *(.init.data); 101 104 __vtop_table_begin = .; ··· 193 190 /* Sections to be discarded. */ 194 191 /DISCARD/ : { 195 192 *(.exitcall.exit) 193 + *(.exit.data) 196 194 } 197 195 }