[PATCH] D97664: [llvm-objcopy][test] Fix test that could have passed spuriously

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 01:12:09 PST 2021


jhenderson created this revision.
jhenderson added reviewers: rupprecht, MaskRay, grimar, alexshap.
Herald added subscribers: abrachet, emaste.
jhenderson requested review of this revision.
Herald added a project: LLVM.

The test was showing that when --strip-unneeded is specified for an executable, all the symbols are stripped. However, the set of symbols used in the test would be stripped by --strip-unneeded for an ET_REL object too. Fix this by adding additional symbols that aren't normally stripped by --strip-unneeded.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97664

Files:
  llvm/test/tools/llvm-objcopy/ELF/strip-unneeded-all-symbols.test


Index: llvm/test/tools/llvm-objcopy/ELF/strip-unneeded-all-symbols.test
===================================================================
--- llvm/test/tools/llvm-objcopy/ELF/strip-unneeded-all-symbols.test
+++ llvm/test/tools/llvm-objcopy/ELF/strip-unneeded-all-symbols.test
@@ -13,9 +13,17 @@
   Data:     ELFDATA2LSB
   Type:     ET_EXEC
   Machine:  EM_X86_64
+Sections:
+  - Name: .text
+    Type: SHT_PROGBITS
 Symbols:
-  - Name:     bar
-  - Name:     foo
+  - Name:     local_undef
+  - Name:     local_def
+    Section:  .text
+  - Name:     global_undef
+    Binding:  STB_GLOBAL
+  - Name:     global_def
+    Section:  .text
     Binding:  STB_GLOBAL
 
 # CHECK-NOT: .symtab


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97664.327045.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210301/d6401572/attachment.bin>


More information about the llvm-commits mailing list