bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/12253] New: .eh_frame_hdr not properly sorted with mixed .eh_fra


From: ro at TechFak dot Uni-Bielefeld.DE
Subject: [Bug ld/12253] New: .eh_frame_hdr not properly sorted with mixed .eh_frame encodings
Date: Mon, 22 Nov 2010 17:49:41 +0000

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: address@hidden
        ReportedBy: address@hidden
                CC: address@hidden
              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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]