From: Tom Rini <trini@kernel.crashing.org>

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>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 arch/ppc/kernel/vmlinux.lds.S |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN arch/ppc/kernel/vmlinux.lds.S~ppc32-discard-exittext-and-exitdata-sections arch/ppc/kernel/vmlinux.lds.S
--- devel/arch/ppc/kernel/vmlinux.lds.S~ppc32-discard-exittext-and-exitdata-sections	2005-09-09 11:53:09.000000000 -0700
+++ devel-akpm/arch/ppc/kernel/vmlinux.lds.S	2005-09-09 11:53:09.000000000 -0700
@@ -96,6 +96,9 @@ SECTIONS
 	*(.init.text)
 	_einittext = .;
   }
+  /* .exit.text is discarded at runtime, not link time,
+     to deal with references from __bug_table */
+  .exit.text : { *(.exit.text) }
   .init.data : {
     *(.init.data);
     __vtop_table_begin = .;
@@ -190,5 +193,6 @@ SECTIONS
   /* Sections to be discarded. */
   /DISCARD/ : {
     *(.exitcall.exit)
+    *(.exit.data)
   }
 }
_