diff options
author | Fangrui Song <maskray@google.com> | 2018-07-31 21:26:35 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-07-31 21:26:35 +0000 |
commit | 402cad06199cdf730f7c9b9692bdde07d6c1928f (patch) | |
tree | 1878448e35b1f93e642a1b1b2e7ca8d48ec83b33 /tools/llvm-objcopy | |
parent | 0da00372337cd831ba9ba13a7700009c4dae19c0 (diff) |
[llvm-objcopy] Make --strip-debug strip .gdb_index
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.
Reviewers: dblaikie, alexshap, jakehehrlich, jhenderson
Reviewed By: alexshap, jakehehrlich
Subscribers: aprantl, JDevlieghere, jakehehrlich, llvm-commits
Differential Revision: https://reviews.llvm.org/D50100
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objcopy')
-rw-r--r-- | tools/llvm-objcopy/llvm-objcopy.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/llvm-objcopy/llvm-objcopy.cpp b/tools/llvm-objcopy/llvm-objcopy.cpp index e903e57ad5f..21a1622db76 100644 --- a/tools/llvm-objcopy/llvm-objcopy.cpp +++ b/tools/llvm-objcopy/llvm-objcopy.cpp @@ -186,7 +186,8 @@ LLVM_ATTRIBUTE_NORETURN void reportError(StringRef File, Error E) { } // end namespace llvm static bool IsDebugSection(const SectionBase &Sec) { - return Sec.Name.startswith(".debug") || Sec.Name.startswith(".zdebug"); + return Sec.Name.startswith(".debug") || Sec.Name.startswith(".zdebug") || + Sec.Name == ".gdb_index"; } static bool IsDWOSection(const SectionBase &Sec) { |