
From: Andi Kleen <ak@muc.de>

Some configs didn't link anymore because they got references from
.altinstructions to __exit functions.  Fixing it at the linker level is not
easily possible.  This patch just discards .text.exit at runtime instead of
link time to avoid this.

It will also fix a related problem with .eh_frame in modern gcc (so far only
observed on x86-64, but could happen on i386 too) 



 25-akpm/arch/i386/vmlinux.lds.S |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -puN arch/i386/vmlinux.lds.S~altinstruction-linkage-fix arch/i386/vmlinux.lds.S
--- 25/arch/i386/vmlinux.lds.S~altinstruction-linkage-fix	Tue May  6 13:52:10 2003
+++ 25-akpm/arch/i386/vmlinux.lds.S	Tue May  6 13:54:06 2003
@@ -85,7 +85,11 @@ SECTIONS
   __alt_instructions = .;
   .altinstructions : { *(.altinstructions) } 
   __alt_instructions_end = .; 
- .altinstr_replacement : { *(.altinstr_replacement) }
+ .altinstr_replacement : { *(.altinstr_replacement) } 
+  /* .exit.text is discard at runtime, not link time, to deal with references
+     from .altinstructions and .eh_frame */
+  .exit.text : { *(.exit.text) }
+  .exit.data : { *(.exit.data) }
   . = ALIGN(4096);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
@@ -106,8 +110,6 @@ SECTIONS
 
   /* Sections to be discarded */
   /DISCARD/ : {
-	*(.exit.text)
-	*(.exit.data)
 	*(.exitcall.exit)
 	}
 

_
