Skip to contentSkip to conversation

discard *.exit.text and *.exit.data sections

PATCH New Eugene Surovegin 1 participant 1 message Sep 5, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

arch/ppc/kernel/vmlinux.lds.S +4 -0
@@ -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)
   }
 }