Fix getRelocationValueString to return the symbol name for EM_386.
[oota-llvm.git] / test / Object / objdump-relocations.test
1 RUN: llvm-objdump -r %p/Inputs/trivial-object-test.coff-i386 \
2 RUN:              | FileCheck %s -check-prefix COFF-i386
3 RUN: llvm-objdump -r %p/Inputs/trivial-object-test.coff-x86-64 \
4 RUN:              | FileCheck %s -check-prefix COFF-x86-64
5 RUN: llvm-objdump -r %p/Inputs/trivial-object-test.elf-i386 \
6 RUN:              | FileCheck %s -check-prefix ELF-i386
7 RUN: llvm-objdump -r %p/Inputs/trivial-object-test.elf-x86-64 \
8 RUN:              | FileCheck %s -check-prefix ELF-x86-64
9 RUN: llvm-objdump -r %p/Inputs/trivial-object-test.elf-hexagon \
10 RUN:              | FileCheck %s -check-prefix ELF-hexagon
11 RUN: llvm-objdump -r %p/Inputs/trivial-object-test.elf-mips64el \
12 RUN:              | FileCheck %s -check-prefix ELF-MIPS64EL
13 RUN: llvm-objdump -r %p/Inputs/trivial-object-test.elf-mipsel \
14 RUN:              | FileCheck %s -check-prefix ELF-MIPSEL
15
16 RUN: llvm-objdump -r %p/Inputs/relocations.elf-x86-64 \
17 RUN:              | FileCheck %s -check-prefix ELF-complex-x86-64
18
19 COFF-i386: .text
20 COFF-i386: IMAGE_REL_I386_DIR32 L_.str
21 COFF-i386: IMAGE_REL_I386_REL32 _puts
22 COFF-i386: IMAGE_REL_I386_REL32 _SomeOtherFunction
23
24 COFF-x86-64: .text
25 COFF-x86-64: IMAGE_REL_AMD64_REL32 L.str
26 COFF-x86-64: IMAGE_REL_AMD64_REL32 puts
27 COFF-x86-64: IMAGE_REL_AMD64_REL32 SomeOtherFunction
28
29 ELF-i386: .text
30 ELF-i386: R_386_32 .rodata.str1.1
31 ELF-i386: R_386_PC32 puts
32 ELF-i386: R_386_PC32 SomeOtherFunction
33
34 ELF-x86-64: .text
35 ELF-x86-64: R_X86_64_32S .rodata.str1.1
36 ELF-x86-64: R_X86_64_PC32 puts
37 ELF-x86-64: R_X86_64_PC32 SomeOtherFunction
38
39 ELF-hexagon: .text
40 ELF-hexagon: R_HEX_GOTREL_HI16 .main
41 ELF-hexagon: R_HEX_GOTREL_LO16 .main
42 ELF-hexagon: R_HEX_HI16 puts
43 ELF-hexagon: R_HEX_LO16 puts
44 ELF-hexagon: R_HEX_B15_PCREL testf
45 ELF-hexagon: R_HEX_B22_PCREL puts
46
47 // Note: this file was produced with gas to make sure we don't end up in a
48 // situation where LLVM produces and accepts a broken file.
49 ELF-MIPS64EL: .data
50 ELF-MIPS64EL: R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE zed
51
52 ELF-MIPSEL: .rel.text
53 ELF-MIPSEL: R_MIPS_HI16 _gp_disp
54 ELF-MIPSEL: R_MIPS_LO16 _gp_disp
55 ELF-MIPSEL: R_MIPS_GOT16 $.str
56 ELF-MIPSEL: R_MIPS_LO16 $.str
57 ELF-MIPSEL: R_MIPS_CALL16 puts
58 ELF-MIPSEL: R_MIPS_CALL16 SomeOtherFunction
59
60 ELF-complex-x86-64: .text
61 ELF-complex-x86-64-NEXT: R_X86_64_8 .data-4
62 ELF-complex-x86-64-NEXT: R_X86_64_16 .data-4
63 ELF-complex-x86-64-NEXT: R_X86_64_32 .data-4
64 ELF-complex-x86-64-NEXT: R_X86_64_32S .data-4
65 ELF-complex-x86-64-NEXT: R_X86_64_64 .data-4
66 ELF-complex-x86-64-NEXT: R_X86_64_PC32 .data-4-P
67 ELF-complex-x86-64-NEXT: R_X86_64_32 .data+0
68 ELF-complex-x86-64-NEXT: R_X86_64_32 .data+4