linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix .altinstructions linking failures
@ 2003-05-06  6:30 Andi Kleen
  2003-05-06 16:44 ` Adrian Bunk
  2003-05-07  9:23 ` Jörn Engel
  0 siblings, 2 replies; 12+ messages in thread
From: Andi Kleen @ 2003-05-06  6:30 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel


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.

Idea from Andrew Morton.

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) 

Index: linux/arch/i386/vmlinux.lds.S
===================================================================
RCS file: /home/cvs/linux-2.5/arch/i386/vmlinux.lds.S,v
retrieving revision 1.18
diff -u -u -r1.18 vmlinux.lds.S
--- linux/arch/i386/vmlinux.lds.S	30 Apr 2003 14:32:05 -0000	1.18
+++ linux/arch/i386/vmlinux.lds.S	6 May 2003 05:28:28 -0000
@@ -85,7 +85,10 @@
   __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) }
   . = ALIGN(4096);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
@@ -106,7 +109,6 @@
 
   /* Sections to be discarded */
   /DISCARD/ : {
-	*(.exit.text)
 	*(.exit.data)
 	*(.exitcall.exit)
 	}


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-05-10 15:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-06  6:30 [PATCH] Fix .altinstructions linking failures Andi Kleen
2003-05-06 16:44 ` Adrian Bunk
2003-05-06 19:56   ` Andi Kleen
2003-05-06 21:08     ` Andi Kleen
2003-05-06 21:25       ` Andrew Morton
2003-05-06 21:45         ` Andi Kleen
2003-05-07  9:23 ` Jörn Engel
2003-05-07  9:47   ` Andi Kleen
2003-05-07 10:16     ` Jörn Engel
2003-05-07 16:38     ` Greg KH
2003-05-10  8:50     ` Adrian Bunk
2003-05-10 15:41       ` Jörn Engel

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).