blob: 5355b22328a7d46650819b2905112e8c4ffb7918 [file] [log] [blame]
Martin Storsjo10b72962019-01-10 21:28:24 +00001# RUN: yaml2obj %p/Inputs/strip-symbols.yaml > %t.in.o
2
3# RUN: llvm-readobj -relocations %t.in.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-PRE
4# RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-PRE
5
6# RUN: llvm-objcopy -N mainfunc %t.in.o %t.out.o
7# RUN: llvm-readobj -relocations %t.out.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-POST
8# RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefix=SYMBOLS
9
10# RUN: llvm-objcopy --strip-symbol mainfunc %t.in.o %t.out.o
11# RUN: llvm-readobj -relocations %t.out.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-POST
12# RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefix=SYMBOLS
13
14# Explicitly listing the relocations for the input as well, to show
15# that the symbol index of the symbol foo is updated in the relocations,
16# while keeping relocations to two distinct .rdata symbols separate.
17
18# RELOCS: Relocations [
19# RELOCS-NEXT: Section (1) .text {
20# RELOCS-NEXT: 0x3 IMAGE_REL_AMD64_REL32 .rdata (0)
21# RELOCS-NEXT: 0xA IMAGE_REL_AMD64_REL32 .rdata (1)
22# RELOCS-PRE-NEXT: 0x11 IMAGE_REL_AMD64_REL32 foo (3)
23# RELOCS-POST-NEXT: 0x11 IMAGE_REL_AMD64_REL32 foo (2)
24# RELOCS-NEXT: }
25# RELOCS-NEXT: ]
26
27# SYMBOLS: SYMBOL TABLE:
28# SYMBOLS-NEXT: .rdata
29# SYMBOLS-NEXT: .rdata
30# SYMBOLS-PRE-NEXT: mainfunc
31# SYMBOLS-NEXT: foo
32# SYMBOLS-EMPTY: