ELF: Fix the section that relocations apply to. Add test to verify. Patch by Danil...
[oota-llvm.git] / test / Object / objdump-relocations.test
1 RUN: llvm-objdump -r %p/TestObjectFiles/trivial-object-test.coff-i386 \
2 RUN:              | FileCheck %s -check-prefix COFF-i386
3 RUN: llvm-objdump -r %p/TestObjectFiles/trivial-object-test.coff-x86-64 \
4 RUN:              | FileCheck %s -check-prefix COFF-x86-64
5 RUN: llvm-objdump -r %p/TestObjectFiles/trivial-object-test.elf-i386 \
6 RUN:              | FileCheck %s -check-prefix ELF-i386
7 RUN: llvm-objdump -r %p/TestObjectFiles/trivial-object-test.elf-x86-64 \
8 RUN:              | FileCheck %s -check-prefix ELF-x86-64
9
10 COFF-i386: .text
11 COFF-i386: IMAGE_REL_I386_DIR32 L_.str
12 COFF-i386: IMAGE_REL_I386_REL32 _puts
13 COFF-i386: IMAGE_REL_I386_REL32 _SomeOtherFunction
14
15 COFF-x86-64: .text
16 COFF-x86-64: IMAGE_REL_AMD64_REL32 L.str
17 COFF-x86-64: IMAGE_REL_AMD64_REL32 puts
18 COFF-x86-64: IMAGE_REL_AMD64_REL32 SomeOtherFunction
19
20 ELF-i386: .text
21 ELF-i386: R_386_32
22 ELF-i386: R_386_PC32
23 ELF-i386: R_386_PC32
24
25 ELF-x86-64: .text
26 ELF-x86-64: R_X86_64_32S .rodata.str1.1
27 ELF-x86-64: R_X86_64_PC32 puts
28 ELF-x86-64: R_X86_64_PC32 SomeOtherFunction