linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] discard *.exit.text and *.exit.data sections
@ 2005-09-05  5:46 Eugene Surovegin
  0 siblings, 0 replies; only message in thread
From: Eugene Surovegin @ 2005-09-05  5:46 UTC (permalink / raw)
  To: linuxppc-dev

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>

diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -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)
   }
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-05  5:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-05  5:46 [PATCH] discard *.exit.text and *.exit.data sections Eugene Surovegin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).