This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RFH: MIPS ld breaking .eh_frame data ...
- From: David Daney <ddaney at avtrex dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 15 Sep 2006 17:56:38 -0700
- Subject: RFH: MIPS ld breaking .eh_frame data ...
I am seeing a wierd problem building libgcj with a mipsel-linux cross
compiler.
mipsel-linux-ld --version
GNU ld version 060915 20060915
But I get the same results with 2.17 also.
mipsel-linux-gcj --version
mipsel-linux-gcj (GCC) 4.2.0 20060914 (experimental)
ld appears to be changing the augmentation data for some CIEs
For example, here is the data for _Jv_Throw which is part of libgcj. If
I look at the .eh_frame before linking
mipsel-linux-readelf --debug-dump=frames exception.o
.
.
.
The section .eh_frame contains:
00000000 00000014 00000000 CIE
Version: 1
Augmentation: "zP"
Code alignment factor: 1
Data alignment factor: -4
Return address column: 31
Augmentation data: 00 00 00 00 00
DW_CFA_def_cfa: r29 ofs 0
.
.
.
0000009c 0000001c 000000a0 FDE cie=00000000 pc=00000328..000003cc
DW_CFA_set_loc: 00000338
DW_CFA_def_cfa_offset: 40
DW_CFA_advance_loc: 12 to 00000344
DW_CFA_offset: r16 at cfa-16
DW_CFA_offset: r17 at cfa-12
DW_CFA_offset: r31 at cfa-8
DW_CFA_nop
As far as I can tell, this is all correct.
Now if I look at libgcj.so.8.0.0 after linking, I get:
.
.
.
00004084 00000018 00000000 CIE
Version: 1
Augmentation: "zRP"
Code alignment factor: 1
Data alignment factor: -4
Return address column: 31
Augmentation data: 10 00 00 00 00 00
DW_CFA_def_cfa: r29 ofs 0
DW_CFA_nop
DW_CFA_nop
.
.
.
00004124 0000001c 000000a4 FDE cie=00004084 pc=00c51888..00c5192c
DW_CFA_set_loc: 026679ce
DW_CFA_def_cfa_offset: 40
DW_CFA_advance_loc: 12 to 026679da
DW_CFA_offset: r16 at cfa-16
DW_CFA_offset: r17 at cfa-12
DW_CFA_offset: r31 at cfa-8
DW_CFA_nop
The FDE data is unchanged, however its interpretation has changed due to
the added PC relative augmentation data in the CIE. Note that the
DW_CFA_set_loc in the first instruction pushes the PC out of the range
of the function so that the unwinder completly ignores the rest of the
FDE program causing a crash at runtime.
I used to be able to build (and run) libgcj with slightly older versions
of binutils, and gcc.
Does this seem like a problem with ld? Or is gcc creating something
inconsistent here?
Thanks in advance,
David Daney.