33 lines · plain
1RUN: yaml2obj %p/Inputs/strip-symbols.yaml -o %t.in.o2 3RUN: llvm-readobj -r %t.in.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-PRE4RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-PRE5 6RUN: llvm-objcopy -N mainfunc %t.in.o %t.out.o7RUN: llvm-readobj -r %t.out.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-POST8RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefix=SYMBOLS9 10RUN: llvm-objcopy --strip-symbol mainfunc %t.in.o %t.out.o11RUN: llvm-readobj -r %t.out.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-POST12RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefix=SYMBOLS13 14Explicitly listing the relocations for the input as well, to show15that the symbol index of the symbol foo is updated in the relocations,16while keeping relocations to two distinct .rdata symbols separate.17 18RELOCS: Relocations [19RELOCS-NEXT: Section (1) .text {20RELOCS-NEXT: 0x3 IMAGE_REL_AMD64_REL32 .rdata (0)21RELOCS-NEXT: 0xA IMAGE_REL_AMD64_REL32 .rdata (1)22RELOCS-PRE-NEXT: 0x11 IMAGE_REL_AMD64_REL32 foo (3)23RELOCS-POST-NEXT: 0x11 IMAGE_REL_AMD64_REL32 foo (2)24RELOCS-NEXT: }25RELOCS-NEXT: ]26 27SYMBOLS: SYMBOL TABLE:28SYMBOLS-NEXT: .rdata29SYMBOLS-NEXT: .rdata30SYMBOLS-PRE-NEXT: mainfunc31SYMBOLS-NEXT: foo32SYMBOLS-EMPTY:33