diff options
author | Faraz Shahbazker <fshahbazker@wavecomp.com> | 2019-04-28 21:17:14 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-04-29 11:44:24 +0300 |
commit | ab2901c843c2b9226f9319a8242fffbdf002e8bc (patch) | |
tree | 9eae8297f04464d6a5baca48fda89f35874e6831 /libgloss/mips/mti64_64.ld | |
parent | 440559c40a4879ddfe0a73282aab994c53955cef (diff) |
Fix order of eh_frame sections in linker scripts
The compiler driver positions the linker script at the end of the linker
command-line, after crtend.o. As a result, any INPUT objects and archive
GROUPs introduced by the linker script are placed after crtend.o and the
end-of-frame marker provided by crtend.o ends up in between .eh_frames
instead of being at the end.
This has always been a problem, but a binutils update to clean-up
redundant NULL markers in .eh_frame exposes it as a execution failure in
exception-handling tests. This patch re-orders .eh_frames in all
MIPS linker scripts so that the one from crtend.o is always placed last.
libgloss/
* mips/array.ld: Re-order to place .eh_frame from crtend.o
after all other .eh_frame sections.
* mips/cfe.ld: Likewise.
* mips/ddb-kseg0.ld: Likewise.
* mips/ddb.ld: Likewise.
* mips/dve.ld: Likewise.
* mips/idt.ld: Likewise.
* mips/idt32.ld: Likewise.
* mips/idt64.ld: Likewise.
* mips/jmr3904app.ld: Likewise.
* mips/lsi.ld: Likewise.
* mips/mti32.ld: Likewise.
* mips/mti64.ld: Likewise.
* mips/mti64_64.ld: Likewise.
* mips/mti64_n32.ld: Likewise.
* mips/nullmon.ld: Likewise.
* mips/pmon.ld: Likewise.
* mips/sde32.ld: Likewise.
* mips/sde64.ld: Likewise.
Diffstat (limited to 'libgloss/mips/mti64_64.ld')
-rw-r--r-- | libgloss/mips/mti64_64.ld | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libgloss/mips/mti64_64.ld b/libgloss/mips/mti64_64.ld index 7a2074f1a..81704f065 100644 --- a/libgloss/mips/mti64_64.ld +++ b/libgloss/mips/mti64_64.ld @@ -62,7 +62,13 @@ SECTIONS _etext = .; .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : { KEEP (*(.eh_frame)) } + .eh_frame : + { + /* The .eh_frame section from the crtend file contains the + end of eh_frame marker and it must be last. */ + KEEP (*(EXCLUDE_FILE (*crtend.o) .eh_frame)) + KEEP (*(.eh_frame)) + } .gcc_except_table : { *(.gcc_except_table) } .jcr : { KEEP (*(.jcr)) } .ctors : |