diff options
| author | Paul Semel <semelpaul@gmail.com> | 2018-05-26 08:10:37 +0000 |
|---|---|---|
| committer | Paul Semel <semelpaul@gmail.com> | 2018-05-26 08:10:37 +0000 |
| commit | cf51c80bf1adfa3bb2eb0ac5a8990a076b4c7256 (patch) | |
| tree | 4f0c6ebfc9880e0ce7e7a9e70e8759a0e0eb8782 /llvm/test/tools/llvm-objcopy | |
| parent | fb89e7a943bb4cf32a9b61817654b735ff737dc3 (diff) | |
| download | bcm5719-llvm-cf51c80bf1adfa3bb2eb0ac5a8990a076b4c7256.tar.gz bcm5719-llvm-cf51c80bf1adfa3bb2eb0ac5a8990a076b4c7256.zip | |
[llvm-objcopy] Add --keep-file-symbols option
This option prevent from removing file symbols while removing symbols.
Differential Revision: https://reviews.llvm.org/D46830
llvm-svn: 333339
Diffstat (limited to 'llvm/test/tools/llvm-objcopy')
| -rw-r--r-- | llvm/test/tools/llvm-objcopy/keep-file-symbols.test | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/keep-file-symbols.test b/llvm/test/tools/llvm-objcopy/keep-file-symbols.test new file mode 100644 index 00000000000..04b07b7652b --- /dev/null +++ b/llvm/test/tools/llvm-objcopy/keep-file-symbols.test @@ -0,0 +1,70 @@ +# RUN: yaml2obj %s > %t +# RUN: llvm-objcopy --strip-all --keep-file-symbols %t %t2 +# RUN: llvm-readobj -symbols %t2 | FileCheck %s --check-prefix=STRIPALL +# RUN: llvm-objcopy --keep-file-symbols --strip-symbol foo %t %t2 +# RUN: llvm-readobj -symbols %t2 | FileCheck %s --check-prefix=STRIP + +!ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x1000 + AddressAlign: 0x0000000000000010 + Size: 64 +Symbols: + Local: + - Name: foo + Type: STT_FILE + Section: .text + Global: + - Name: bar + Type: STT_FUNC + Section: .text + +#STRIPALL: Symbols [ +#STRIPALL-NEXT: Symbol { +#STRIPALL-NEXT: Name: foo +#STRIPALL-NEXT: Value: 0x0 +#STRIPALL-NEXT: Size: 0 +#STRIPALL-NEXT: Binding: Local +#STRIPALL-NEXT: Type: File +#STRIPALL-NEXT: Other: 0 +#STRIPALL-NEXT: Section: .text +#STRIPALL-NEXT: } +#STRIPALL-NEXT:] + +#STRIP: Symbols [ +#STRIP-NEXT: Symbol { +#STRIP-NEXT: Name: +#STRIP-NEXT: Value: 0x0 +#STRIP-NEXT: Size: 0 +#STRIP-NEXT: Binding: Local +#STRIP-NEXT: Type: None +#STRIP-NEXT: Other: 0 +#STRIP-NEXT: Section: Undefined +#STRIP-NEXT: } +#STRIP-NEXT: Symbol { +#STRIP-NEXT: Name: foo +#STRIP-NEXT: Value: 0x0 +#STRIP-NEXT: Size: 0 +#STRIP-NEXT: Binding: Local +#STRIP-NEXT: Type: File +#STRIP-NEXT: Other: 0 +#STRIP-NEXT: Section: .text +#STRIP-NEXT: } +#STRIP-NEXT: Symbol { +#STRIP-NEXT: Name: bar +#STRIP-NEXT: Value: 0x0 +#STRIP-NEXT: Size: 0 +#STRIP-NEXT: Binding: Global +#STRIP-NEXT: Type: Function +#STRIP-NEXT: Other: 0 +#STRIP-NEXT: Section: .text +#STRIP-NEXT: } +#STRIP-NEXT:] |

