Commit 00b31e9a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix .altinstructions linking failures

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)
parent 441d6fd9
......@@ -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)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment