diff options
| -rw-r--r-- | llvm/test/tools/llvm-objcopy/strip-debug.test | 8 | ||||
| -rw-r--r-- | llvm/tools/llvm-objcopy/llvm-objcopy.cpp | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/llvm/test/tools/llvm-objcopy/strip-debug.test b/llvm/test/tools/llvm-objcopy/strip-debug.test index c8f90d9ca19..6c833f301c7 100644 --- a/llvm/test/tools/llvm-objcopy/strip-debug.test +++ b/llvm/test/tools/llvm-objcopy/strip-debug.test @@ -67,7 +67,7 @@ # RUN: llvm-objcopy --strip-debug %t.thin.a %t2.thin.a # RUN: cat %t.thin.a | FileCheck %s --check-prefix=VERIFY-THIN-ARCHIVE # RUN: cat %t2.thin.a | FileCheck %s --check-prefix=VERIFY-THIN-ARCHIVE - + # VERIFY-THIN-ARCHIVE: !<thin> # Verify that the member of a thin archive was properly modified. @@ -94,6 +94,12 @@ Sections: - Name: .debugfoo Type: SHT_PROGBITS Content: "00000000" + - Name: .zdebugfoo + Type: SHT_PROGBITS + Content: "00000000" + - Name: .gdb_index + Type: SHT_PROGBITS + Content: "00000000" - Name: .text Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ] diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp index e903e57ad5f..21a1622db76 100644 --- a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp +++ b/llvm/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) { |

