This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/15407] Partial frame info in sysdeps/x86_64/start.S
- From: "hjl.tools at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 26 Apr 2013 21:58:51 +0000
- Subject: [Bug libc/15407] Partial frame info in sysdeps/x86_64/start.S
- Auto-submitted: auto-generated
- References: <bug-15407-131 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=15407
--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> 2013-04-26 21:58:51 UTC ---
--build-id --no-add-needed --hash-style=gnu -m elf_x86_64 -static -fuse-ld=gold
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/crtbeginT.o
-L/usr/lib/gcc/x86_64-redhat-linux/4.7.2
-L/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../.. foo.o
-lstdc++ -lm --start-group -lgcc -lgcc_eh -lc --end-group
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crtn.o
is passed to linker. BFD linker puts the bad eh_frame section at
very beginning:
Contents of the .eh_frame section:
00000000 00000014 00000000 CIE
Version: 1
Augmentation: "zR"
Code alignment factor: 1
Data alignment factor: -8
Return address column: 16
Augmentation data: 1b
DW_CFA_def_cfa: r7 (rsp) ofs 8
DW_CFA_offset: r16 (rip) at cfa-8
DW_CFA_undefined: r16 (rip)
00000018 00000014 0000001c FDE cie=00000000 pc=00400d8c..00400db6
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
while gold puts it in the middle:
000099b0 0000004c 000099b4 FDE cie=00000000 pc=004928d0..00492b12
DW_CFA_advance_loc: 34 to 004928f2
DW_CFA_def_cfa_offset: 16
DW_CFA_offset: r14 (r14) at cfa-16
DW_CFA_advance_loc: 5 to 004928f7
DW_CFA_def_cfa_offset: 24
DW_CFA_offset: r13 (r13) at cfa-24
DW_CFA_advance_loc: 5 to 004928fc
DW_CFA_def_cfa_offset: 32
DW_CFA_offset: r12 (r12) at cfa-32
DW_CFA_advance_loc: 4 to 00492900
DW_CFA_def_cfa_offset: 40
DW_CFA_offset: r6 (rbp) at cfa-40
DW_CFA_advance_loc: 1 to 00492901
DW_CFA_def_cfa_offset: 48
DW_CFA_offset: r3 (rbx) at cfa-48
DW_CFA_advance_loc: 4 to 00492905
DW_CFA_def_cfa_offset: 128
DW_CFA_advance_loc2: 382 to 00492a83
DW_CFA_remember_state
DW_CFA_def_cfa_offset: 48
DW_CFA_advance_loc: 1 to 00492a84
DW_CFA_restore: r3 (rbx)
DW_CFA_def_cfa_offset: 40
DW_CFA_advance_loc: 1 to 00492a85
DW_CFA_restore: r6 (rbp)
DW_CFA_def_cfa_offset: 32
DW_CFA_advance_loc: 2 to 00492a87
DW_CFA_restore: r12 (r12)
DW_CFA_def_cfa_offset: 24
DW_CFA_advance_loc: 2 to 00492a89
DW_CFA_restore: r13 (r13)
DW_CFA_def_cfa_offset: 16
DW_CFA_advance_loc: 2 to 00492a8b
DW_CFA_restore: r14 (r14)
DW_CFA_def_cfa_offset: 8
DW_CFA_advance_loc: 5 to 00492a90
DW_CFA_restore_state
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
00009a00 00000024 00009a04 FDE cie=00000000 pc=004002e0..004003b0
DW_CFA_def_cfa_offset: 16
DW_CFA_advance_loc: 6 to 004002e6
DW_CFA_def_cfa_offset: 24
DW_CFA_advance_loc: 10 to 004002f0
DW_CFA_def_cfa_expression (DW_OP_breg7 (rsp): 8; DW_OP_breg16 (rip): 0;
DW_OP_lit15; DW_OP_and; DW_OP_lit11; DW_OP_ge; DW_OP_lit3; DW_OP_shl;
DW_OP_plus)
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
00009a28 00000014 00000000 CIE
Version: 1
Augmentation: "zR"
Code alignment factor: 1
Data alignment factor: -8
Return address column: 16
Augmentation data: 1b
DW_CFA_def_cfa: r7 (rsp) ofs 8
DW_CFA_offset: r16 (rip) at cfa-8
DW_CFA_undefined: r16 (rip)
00009a40 00000014 0000001c FDE cie=00009a28 pc=00400d9c..00400dc6
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
00009a58 00000014 00000000 CIE
Version: 1
Augmentation: "zR"
Code alignment factor: 1
Data alignment factor: -8
Return address column: 16
Augmentation data: 1b
DW_CFA_def_cfa: r7 (rsp) ofs 8
DW_CFA_offset: r16 (rip) at cfa-8
DW_CFA_def_cfa_offset: 24
00009a70 00000014 0000001c FDE cie=00009a58 pc=00451540..004515a1
DW_CFA_advance_loc: 4 to 00451544
The extra frame info comes from the first entry in PLT since gold
doesn't skip it in static executable. I think this combination
leads to the problem.
Dynamic executables are OK since they have GNU_EH_FRAME.
--
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.