This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Make --strip-debug strip .gdb_index
ClosedPublic

Authored by MaskRay on Jul 31 2018, 1:10 PM.

Details

Summary

See binutils-gdb/bfd/elf.c, GNU objcopy also strips .stab* (STABS)
.line* (DWARF 1) .gnu.linkonce.wi.* (linkonce section for .debug_info) but
I'm not sure we need to be compatible with it.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.Jul 31 2018, 1:10 PM

Can we add test? Otherwise this LGTM.

This revision is now accepted and ready to land.Jul 31 2018, 1:43 PM
jakehehrlich added inline comments.Jul 31 2018, 2:08 PM
test/tools/llvm-objcopy/strip-debug.test
94 ↗(On Diff #158374)

This wasn't a typeo, it was put there on purpose to test that anything start with ".debug" would trigger

MaskRay updated this revision to Diff 158386.Jul 31 2018, 2:25 PM

Use .debugfoo and .zdebugfoo

jakehehrlich accepted this revision.Jul 31 2018, 2:26 PM
This revision was automatically updated to reflect the committed changes.