[PATCH] D43475: [llvm-objcopy] Implement --only-keep-debug

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 02:46:25 PST 2018


arichardson added a comment.

It seems like changing all alloc sections to NOBITS is probably the correct way of doing this. So I guess https://reviews.llvm.org/D40523 adjusted to always keep the named debug sections is better.
I don't think any of them are SHF_ALLOC anyway but checking the names shouldn't do any harm.

Looking at the source code it seems like bfd keeps sections starting with: `".debug", ".zdebug", ".gdb_index", ".line", ".stab", ".gnu.linkonce.wi."`
and elftoolchian keeps: `".apple_", ".debug", ".gnu.linkonce.wi.",  ".line", ".stab"`


Repository:
  rL LLVM

https://reviews.llvm.org/D43475





More information about the llvm-commits mailing list