61 lines · plain
1## Check that llvm-objcopy preserves ARM mapping symbols for relocatable files.2# RUN: yaml2obj %s -o %t.o -DTYPE=REL3# RUN: llvm-objcopy --strip-unneeded %t.o %t1.o4# RUN: llvm-nm -j --special-syms %t1.o | FileCheck %s --match-full-lines5# RUN: llvm-objcopy --discard-all %t.o %t2.o6# RUN: llvm-nm -j --special-syms %t2.o | FileCheck %s --match-full-lines7 8# CHECK: $a9# CHECK-NEXT: $a.a10# CHECK-NEXT: $d11# CHECK-NEXT: $d.d12# CHECK-NEXT: $t13# CHECK-NEXT: $t.t14# CHECK-NOT: $x15 16## A mapping symbol can be deleted if specified explicitly.17# RUN: llvm-objcopy -w -N '$d*' %t.o %t3.o18# RUN: llvm-nm --special-syms %t3.o | FileCheck /dev/null --implicit-check-not='$d'19 20## Mapping symbols are not preserved for executable files21# RUN: yaml2obj %s -o %t.exec -DTYPE=EXEC22# RUN: llvm-objcopy --strip-unneeded %t.exec %t1.exec23# RUN: llvm-nm --special-syms %t1.exec | count 024 25# RUN: yaml2obj %s -o %t.so -DTYPE=DYN26# RUN: llvm-objcopy --strip-unneeded %t.so %t1.so27# RUN: llvm-nm --special-syms %t1.so | count 028 29!ELF30FileHeader:31 Class: ELFCLASS3232 Data: ELFDATA2LSB33 Type: ET_[[TYPE]]34 Machine: EM_ARM35Sections:36 - Name: .text37 Type: SHT_PROGBITS38Symbols:39 - Name: $a40 Section: .text41 - Name: $aa42 Section: .text43 - Name: $a.a44 Section: .text45 - Name: $d46 Section: .text47 - Name: $dd48 Section: .text49 - Name: $d.d50 Section: .text51 - Name: $m52 Section: .text53 - Name: $t54 Section: .text55 - Name: $tt56 Section: .text57 - Name: $t.t58 Section: .text59 - Name: $x60 Section: .text61