https://sourceware.org/bugzilla/show_bug.cgi?id=32298

            Bug ID: 32298
           Summary: sframe: no SFrame stack trace info generated for
                    .plt.got
           Product: binutils
           Version: 2.43
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: indu.bhagat at oracle dot com
  Target Milestone: ---

The linker currently does not generate any SFrame stack trace information for
the .plt.got sections.  There is SFrame information for other PLT sections
(.plt, .plt.sec) though.

$ cat bar.c 
void foo ();
unsigned long var;
void test () {
  var = (unsigned long)foo;
  foo ();
}

$ cat foo.s 
.globl foo
foo:
.section        .note.GNU-stack,"",@progbits

$ as --gsframe -o foo.o foo.s

$ gcc -O2 -Wa,--gsframe -fPIC -c -o bar.o bar.c

$ ld -shared -z now -o pltsec.so foo.o bar.o

$ objdump -d pltsec.so

...
Disassembly of section .plt:

0000000000001000 <.plt>:
    1000:       ff 35 da 2f 00 00       push   0x2fda(%rip)        # 3fe0
<_GLOBAL_OFFSET_TABLE_+0x8>
    1006:       ff 25 dc 2f 00 00       jmp    *0x2fdc(%rip)        # 3fe8
<_GLOBAL_OFFSET_TABLE_+0x10>
    100c:       0f 1f 40 00             nopl   0x0(%rax)

Disassembly of section .plt.got:

0000000000001010 <foo@plt>:
    1010:       ff 25 e2 2f 00 00       jmp    *0x2fe2(%rip)        # 3ff8
<foo+0x2fd8>
    1016:       66 90                   xchg   %ax,%ax

Disassembly of section .text:

0000000000001020 <test>:
    1020:       48 8b 05 c9 2f 00 00    mov    0x2fc9(%rip),%rax        # 3ff0
<var-0x10>
    1027:       48 8b 15 ca 2f 00 00    mov    0x2fca(%rip),%rdx        # 3ff8
<foo+0x2fd8>
    102e:       48 89 10                mov    %rdx,(%rax)
    1031:       31 c0                   xor    %eax,%eax
    1033:       e9 d8 ff ff ff          jmp    1010 <foo@plt>



$ objdump --sframe pltsec.so
...

Contents of the SFrame section .sframe:
  Header :

    Version: SFRAME_VERSION_2
    Flags: SFRAME_F_FDE_SORTED
    CFA fixed RA offset: -8
    Num FDEs: 2
    Num FREs: 3

  Function Index :

    func idx [0]: pc = 0x1000, size = 16 bytes
    STARTPC         CFA       FP        RA           
    0000000000001000  sp+16     u         f            
    0000000000001006  sp+24     u         f            

    func idx [1]: pc = 0x1020, size = 24 bytes
    STARTPC         CFA       FP        RA           
    0000000000001020  sp+8      u         f

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to