summaryrefslogtreecommitdiff
path: root/test/tools/llvm-readobj/relocations.test
blob: 06085653735646a622fec342aabf2e4b4c5cd7b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
RUN: llvm-readobj -r %p/Inputs/trivial.obj.coff-i386 \
RUN:   | FileCheck %s -check-prefix COFF
RUN: llvm-readobj -r %p/Inputs/trivial.obj.elf-i386 \
RUN:   | FileCheck %s -check-prefix ELF
RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \
RUN:   | FileCheck %s -check-prefix MACHO

COFF:      Relocations [
COFF-NEXT:   Section (1) .text {
COFF-NEXT:     0x4 IMAGE_REL_I386_DIR32 .data
COFF-NEXT:     0x9 IMAGE_REL_I386_REL32 _puts
COFF-NEXT:     0xE IMAGE_REL_I386_REL32 _SomeOtherFunction
COFF-NEXT:   }
COFF-NEXT: ]

ELF:      Relocations [
ELF-NEXT:   Section (1) .text {
ELF-NEXT:     0xC R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 0x0
ELF-NEXT:     0x12 R_386_GOTOFF .L.str 0x0
ELF-NEXT:     0x1A R_386_PLT32 puts 0x0
ELF-NEXT:     0x1F R_386_PLT32 SomeOtherFunction 0x0
ELF-NEXT:   }
ELF-NEXT: ]

MACHO:      Relocations [
MACHO-NEXT:   Section __text {
MACHO-NEXT:     0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0
MACHO-NEXT:     0x13 GENERIC_RELOC_VANILLA _puts 0x0
MACHO-NEXT:     0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}}
MACHO-NEXT:     0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}}
MACHO-NEXT:   }
MACHO-NEXT: ]