bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/29594] New: [ld, feature request] Add --ctf-functions


From: vries at gcc dot gnu.org
Subject: [Bug ld/29594] New: [ld, feature request] Add --ctf-functions
Date: Wed, 21 Sep 2022 08:56:36 +0000

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

            Bug ID: 29594
           Summary: [ld, feature request] Add --ctf-functions
           Product: binutils
           Version: 2.40 (HEAD)
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Normally, when using gcc -gctf, gcc produces info for various things:
...
Contents of CTF section .ctf:

  Header:
    Magic number: 0xdff2
    Version: 4 (CTF_VERSION_3)
    Flags: 0x2 (CTF_F_NEWFUNCINFO)
    Compilation unit name: gdb/testsuite/gdb.base/ctf-constvars.c
    Data object section:        0x0 -- 0xcb (0xcc bytes)
    Function info section:      0xcc -- 0xcf (0x4 bytes)
    Object index section:       0xd0 -- 0x19b (0xcc bytes)
    Function index section:     0x19c -- 0x19f (0x4 bytes)
    Variable section:   0x1a0 -- 0x337 (0x198 bytes)
    Type section:       0x338 -- 0x7ab (0x474 bytes)
    String section:     0x7ac -- 0x9dc (0x231 bytes)
...
but after linking, both functions and variables are dropped:
...
  Header:
    Magic number: 0xdff2
    Version: 4 (CTF_VERSION_3)
    Flags: 0xe (CTF_F_NEWFUNCINFO, CTF_F_IDXSORTED, CTF_F_DYNSTR)
    Compilation unit name: gdb/testsuite/gdb.base/ctf-constvars.c
    Type section:       0x0 -- 0x473 (0x474 bytes)
    String section:     0x474 -- 0x51b (0xa8 bytes)
...

There's a linker flag: -Wl,--ctf-variables that makes ld pass variable info to
the exec, such that we have:
...
Contents of CTF section .ctf:

  Header:
    Magic number: 0xdff2
    Version: 4 (CTF_VERSION_3)
    Flags: 0xe (CTF_F_NEWFUNCINFO, CTF_F_IDXSORTED, CTF_F_DYNSTR)
    Compilation unit name: gdb/testsuite/gdb.base/ctf-constvars.c
    Variable section:   0x0 -- 0x19f (0x1a0 bytes)
    Type section:       0x1a0 -- 0x613 (0x474 bytes)
    String section:     0x614 -- 0x844 (0x231 bytes)
...

But there's no equivalent for functions, so these still go missing.

-- 
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]