Bug 10255 - no .eh_frame_hdr table will be created.
Summary: no .eh_frame_hdr table will be created.
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.19
: P2 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-09 10:51 UTC by Joost VandeVondele
Modified: 2009-06-29 09:55 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Last reconfirmed:


Attachments
z2.s.bz2 (53.97 KB, application/octet-stream)
2009-06-09 11:43 UTC, Jakub Jelinek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2009-06-09 10:51:02 UTC
as discussed in the gcc bugzilla, linking a recent version of cp2k with trunk
gcc produces an number of unexpected errors:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40332

this happens with older and more recent (2.19.1) ld. 

http://www.pci.uzh.ch/vandevondele/tmp/PR40332.tgz

contains the relevant object files and libraries, plus a README that provides
the exact command line I use
Comment 1 Jakub Jelinek 2009-06-09 11:43:11 UTC
Created attachment 3988 [details]
z2.s.bz2

This looks like a gas bug to me.  At least from brief look at .cfi_* directives
in the assembly they look ok, but after assembling we see:
00000044 0000002c 00000048 FDE cie=00000000 pc=0000339f..00016d6a
  DW_CFA_advance_loc: 1 to 000033a0
  DW_CFA_def_cfa_offset: 16
  DW_CFA_advance_loc: 3 to 000033a3
  DW_CFA_offset: r6 (rbp) at cfa-16
  DW_CFA_def_cfa_register: r6 (rbp)
  DW_CFA_advance_loc2: 332 to 000034ef
  DW_CFA_offset: r3 (rbx) at cfa-56
  DW_CFA_offset: r12 (r12) at cfa-48
  DW_CFA_offset: r13 (r13) at cfa-40
  DW_CFA_offset: r14 (r14) at cfa-32
  DW_CFA_offset: r15 (r15) at cfa-24
  DW_CFA_nop
  DW_CFA_advance_loc: 58 to 00003529
  DW_CFA_??? (User defined call frame op: 0x38)
in the second FDE.  I guess gas just doesn't handle the huge location advance
well (from 34ef to 16d69).  Looking into it...
Comment 2 Jakub Jelinek 2009-06-09 11:48:09 UTC
Small testcase:
.text
.cfi_startproc
.skip 16
.cfi_def_cfa 0, 16
.skip 75031
.cfi_def_cfa 0, 64
.cfi_endproc
Comment 3 Paul Pluzhnikov 2009-06-17 20:38:04 UTC
I just hit this as well: corrupt .eh_frame in one of my object files with a huge
location advance.

Verified that this change to binutils/gas

2009-06-09  Jakub Jelinek  <jakub@redhat.com>

        PR gas/10255
        * dw2gencfi.c (output_cfi_insn): Initialize fragment before rs_cfa
        to DW_CFA_advance_loc4.

fixes it for me.
Comment 4 H.J. Lu 2009-06-18 13:57:00 UTC
Fixed.
Comment 5 Peter Bergner 2009-06-18 19:47:42 UTC
The new test case is failing for me on ppc64 like:

/home/bergner/binutils/build/binutils-pr10255/gas/testsuite/../../binutils/readelf
 -wf dump.o
Executing on host: sh -c
{/home/bergner/binutils/build/binutils-pr10255/gas/testsuite/../../binutils/readelf
 -wf dump.o >dump.out 2>gas.stderr}  /dev/null  (timeout = 300)
regexp_diff match failure
regexp "^00000014 000000(1c|20) 00000018 FDE cie=00000000 pc=.*$"
line   "00000014 00000018 00000018 FDE cie=00000000 pc=00000000..00012527"
regexp_diff match failure
regexp "^  DW_CFA_advance_loc4: 75031 to .*$"
line   "  DW_CFA_advance_loc2: 75028 to 00012524"
FAIL: CFI common 7

Configure options used were:
  --target=powerpc-linux
  --host=powerpc-linux
  --build=powerpc-linux
  --enable-targets=powerpc64-linux
Comment 6 Alan Modra 2009-06-18 23:20:17 UTC
Testcase fixed.
Comment 7 M R Swami Reddy 2009-06-29 09:55:06 UTC
Hello, Similar issue Igetting with cr16-elf tools? Is this patch taget 
specific? Thanks for any input.

Thanks
Swami