http://sourceware.org/bugzilla/show_bug.cgi?id=12253
Summary: .eh_frame_hdr not properly sorted with mixed .eh_frame
encodings
Product: binutils
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Host: i386-pc-solaris2.11
Target: i386-pc-solaris2.11
Build: i386-pc-solaris2.11
I'm currently working to have the libgcc unwinder use dl_iterate_phdr which was
introduced in Solaris 11 build 135. When trying a GCC mainline bootstrap with
CVS gas and ld, I saw that the 32-bit libffi unwind tests and all 32-bit
libjava
execution tests failed.
Ultimately, I found that both failures have the same root cause: gld creates a
.eh_frame_hdr section where the search table isn't properly sorted, which
breaks
unwind-dw2-fde-glibc.c which does a binary search of that table.
The problem can be illustrated with the following example:
$ cat func.cc
extern int i;
void
func (void)
{
i++;
}
$ gcc -c -O2 -fPIC -Dfunc=datarel func.cc -o datarel.o
$ gcc -c -O2 -Dfunc=pcrel func.cc -o pcrel.o
$ elfdump -u datarel.o|grep enc
code pointer encoding: 0x30 [ datarel ]
$ elfdump -u pcrel.o|grep enc
code pointer encoding: 0x1b [ sdata4 pcrel ]
$ gcc -shared -o shlib.so datarel.o pcrel.o
$ elfdump -u shlib.o
shlib.so: .eh_frame_hdr: index[1]: invalid sort order
Unwind Section: .eh_frame_hdr
Frame Header:
Version: 1
FramePtrEnc: [ sdata4 pcrel ] FramePtr: 0x1458
FdeCntEnc: [ udata4 ] FdeCnt: 2
TableEnc: [ sdata4 datarel ]
Binary Search Table:
InitialLoc FdeLoc
0x000003d0 0x0000149c
0x000003c5 0x00001470
I'm using the Solaris elfdump command since it both shows the search table,
which readelf cannot currently do, and even complains about the unsorted
.eh_frame_hdr.
While I can workaround the issue in libffi where the pcrel encoding only
occurs in a single handwritten assembler file (libffi/src/x86/sysv.S), this
should be fixed.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-binutils