https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101470

            Bug ID: 101470
           Summary: Support -gline-tables-only
           Product: gcc
           Version: 11.1.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

In a gdb discussion here (
https://sourceware.org/bugzilla/show_bug.cgi?id=28094 ) (starting from the fact
that the dwarf 5 standard mentions that there's a "common practice of stripping
all but the line number sections") it was observed that there's:
- a gold option -Wl,--strip-debug-non-line (not working with gdwarf-5, see
  https://sourceware.org/bugzilla/show_bug.cgi?id=28095)
- a 2018 patch proposing to add -Wl,--strip-debug-non-line to ldd
- clang -gline-tables-only
but that there's no gcc equivalent.

After realizing that clangs -gline-tables-only is an alias for -g1, I looked at
gcc's -g1 and found it does have line table info (since gcc 4.9), but emits a
bit more than clangs -g1.

I compared output for a hello world and found that gcc:
- emits a DIE for main, while clang does not
- emits a .debug_aranges section, while clang does not

Reply via email to