blob: 268b097255db73ddcbf67883ea8d80a8d497379c [file] [log] [blame]
Martin Storsjoe30487c2019-01-15 09:34:45 +00001RUN: yaml2obj %p/Inputs/strip-symbols.yaml > %t.in.o
Martin Storsjo10b72962019-01-10 21:28:24 +00002
Martin Storsjoe30487c2019-01-15 09:34:45 +00003RUN: llvm-readobj -relocations %t.in.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-PRE
4RUN: llvm-objdump -t %t.in.o | FileCheck %s --check-prefixes=SYMBOLS,SYMBOLS-PRE
Martin Storsjo10b72962019-01-10 21:28:24 +00005
Martin Storsjoe30487c2019-01-15 09:34:45 +00006RUN: llvm-objcopy -N mainfunc %t.in.o %t.out.o
7RUN: llvm-readobj -relocations %t.out.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-POST
8RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefix=SYMBOLS
Martin Storsjo10b72962019-01-10 21:28:24 +00009
Martin Storsjoe30487c2019-01-15 09:34:45 +000010RUN: llvm-objcopy --strip-symbol mainfunc %t.in.o %t.out.o
11RUN: llvm-readobj -relocations %t.out.o | FileCheck %s --check-prefixes=RELOCS,RELOCS-POST
12RUN: llvm-objdump -t %t.out.o | FileCheck %s --check-prefix=SYMBOLS
Martin Storsjo10b72962019-01-10 21:28:24 +000013
Martin Storsjoe30487c2019-01-15 09:34:45 +000014Explicitly listing the relocations for the input as well, to show
15that the symbol index of the symbol foo is updated in the relocations,
16while keeping relocations to two distinct .rdata symbols separate.
Martin Storsjo10b72962019-01-10 21:28:24 +000017
Martin Storsjoe30487c2019-01-15 09:34:45 +000018RELOCS: 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: ]
Martin Storsjo10b72962019-01-10 21:28:24 +000026
Martin Storsjoe30487c2019-01-15 09:34:45 +000027SYMBOLS: SYMBOL TABLE:
28SYMBOLS-NEXT: .rdata
29SYMBOLS-NEXT: .rdata
30SYMBOLS-PRE-NEXT: mainfunc
31SYMBOLS-NEXT: foo
32SYMBOLS-EMPTY: