[PATCH] D46628: [ELF] Add --strip-debug-non-line option

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 06:26:04 PDT 2019


MaskRay added a comment.

This option is a bit weird to me because:

- In binutils-gdb, only two commits were specific to `gold/reduced_debug_output.cc`. This suggests to me either the feature works really reliably, or it stays unused since then.
- This features requires partial DWARF rewriting. I think this is against the spirit of ELF. `.debug_abbrev` and `.debug_info` get rewritten then references to them get repaired: fortunately there aren't many! Probably only .debug_info and .debug_aranges can reference .debug_info and for line tables to work, only `.debug_aranges` needs adjustment.

I believe the following is the list of debug sections that gold --strip-debug-non-line keeps:

  static const char* lines_only_debug_sections[] =
  {
    "abbrev",
    // "addr",      // Fission extension
    // "aranges",   // not used by gdb as of 7.4
    // "frame",
    // "gdb_scripts",
    "info",
    // "types",
    "line",
    // "loc",
    // "macinfo",
    // "macro",
    // "pubnames",  // not used by gdb as of 7.4
    // "pubtypes",  // not used by gdb as of 7.4
    // "gnu_pubnames",  // Fission extension
    // "gnu_pubtypes",  // Fission extension
    // "ranges",
    "str",
    "str_offsets",  // Fission extension
  };

Note the `aranges` line that is filtered out. I don't know how users of this feature expects to get a fast symbolizer...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D46628/new/

https://reviews.llvm.org/D46628





More information about the llvm-commits mailing list