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

            Bug ID: 32589
           Summary: function start address is zero in SFrame section dump
           Product: binutils
           Version: 2.45 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libsframe
          Assignee: indu.bhagat at oracle dot com
          Reporter: indu.bhagat at oracle dot com
  Target Milestone: ---

It will be useful for readelf / objdump to display the appropriate function
start address (see pc = 0x0, and the PC of the first FRE) in the SFrame section
dump.

   $ readelf --sframe file.o

     ...
     Function Index :

    func idx [0]: pc = 0x0, size = 48 bytes
    STARTPC         CFA       FP        RA          
    0000000000000000  sp+8      u         f            
    0000000000000005  sp+16     c-16      f            
    0000000000000008  fp+16     c-16      f            
    000000000000002f  sp+8      c-16      f            

    func idx [1]: pc = 0x0, size = 13 bytes
    STARTPC         CFA       FP        RA          
    0000000000000000  sp+8      u         f            

    func idx [2]: pc = 0x0, size = 148 bytes
    STARTPC         CFA       FP        RA          
    0000000000000000  sp+8      u         f            
    0000000000000005  sp+16     c-16      f            
    0000000000000008  fp+16     c-16      f            
    0000000000000093  sp+8      c-16      f          

$ objdump -d file.o
Disassembly of section .text:
...
0000000000000000 <func1>:
...
0000000000000030 <func2>:
...
0000000000000040 <func3>:
...

On linked artifacts, the function start address matches the PC of the function
in the ELF component. E.g.,

$ readelf --sframe binary
   func idx [0]: pc = 0x401020, size = 16 bytes
    STARTPC         CFA       FP        RA          
    0000000000401020  sp+16     u         f            
    0000000000401026  sp+24     u         f            

    func idx [1]: pc = 0x401030, size = 48 bytes
    STARTPC[m]      CFA       FP        RA          
    0000000000000000  sp+8      u         f            
    0000000000000009  sp+16     u         f            

    func idx [2]: pc = 0x401060, size = 48 bytes
    STARTPC[m]      CFA       FP        RA          
    0000000000000000  sp+8      u         f            

    func idx [3]: pc = 0x401090, size = 113 bytes
    STARTPC         CFA       FP        RA          
    0000000000401090  sp+8      u         f            
    0000000000401098  sp+32     u         f            
    0000000000401100  sp+8      u         f            

    func idx [4]: pc = 0x401200, size = 5 bytes
    STARTPC         CFA       FP        RA          
    0000000000401200  sp+8      u         f            

$ objdump -d binary
  ...
  0000000000401000 <_init>:
  ...
  0000000000401020 <.plt>:
  ...
  0000000000401060 <printf@plt>:
  ...
  0000000000401070 <gettimeofday@plt>:
  ...
  0000000000401080 <rand@plt>:
  ...
  0000000000401090 <main>:
  ...

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

Reply via email to