[PATCH] D60324: [llvm-objcopy] Add switch to allow removing referenced sections
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 09:01:37 PDT 2019
grimar added inline comments.
================
Comment at: test/tools/llvm-objcopy/ELF/dynsym-error-remove-strtab.test:3
+# RUN: cp %p/Inputs/dynsym.so %t2
+## Use --strip-debug to suppress the default --strip-all behvior of llvm-strip.
+# RUN: not llvm-strip --strip-debug -R .dynstr %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
----------------
behvior -> behavior
================
Comment at: test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test:4
+# RUN: cp %t %t3
+## Use --strip-debug to suppress the default --strip-all behvior of llvm-strip.
+# RUN: not llvm-strip --strip-debug -R .symtab %t3 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
----------------
behvior -> behavior
================
Comment at: test/tools/llvm-objcopy/ELF/remove-linked-section.test:4
+# RUN: cp %t.o %t2
+## Use --strip-debug to suppress the default --strip-all behvior of llvm-strip.
+# RUN: not llvm-strip --strip-debug -R .foo %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
----------------
behvior -> behavior
================
Comment at: test/tools/llvm-objcopy/ELF/remove-linked-section.test:5
+## Use --strip-debug to suppress the default --strip-all behvior of llvm-strip.
+# RUN: not llvm-strip --strip-debug -R .foo %t2 2>&1 >/dev/null | FileCheck %s --check-prefix=ERR
+
----------------
I am not familiar with llvm-strip.
Looking at its code:
```
if (!Config.StripDebug && !Config.StripUnneeded &&
Config.DiscardMode == DiscardType::None && !Config.StripAllGNU && Config.SymbolsToRemove.empty())
Config.StripAll = true;
```
Seems that `-N fakesymbol` would prevent stripping all. Should it work in the same way for `-R`?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60324/new/
https://reviews.llvm.org/D60324
More information about the llvm-commits
mailing list