blob: 96aac231dba92ef170c41cee2a22b9ef74e5e67b [file] [log] [blame]
Eric Christopher9cad53c2013-04-03 18:31:38 +00001RUN: llvm-readobj -r %p/Inputs/trivial.obj.coff-i386 \
2RUN: | FileCheck %s -check-prefix COFF
3RUN: llvm-readobj -r %p/Inputs/trivial.obj.elf-i386 \
4RUN: | FileCheck %s -check-prefix ELF
5RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \
Rafael Espindola1d532a32013-04-11 02:52:29 +00006RUN: | FileCheck %s -check-prefix MACHO-I386
7RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \
8RUN: | FileCheck %s -check-prefix MACHO-X86-64
Eric Christopher9cad53c2013-04-03 18:31:38 +00009
10COFF: Relocations [
11COFF-NEXT: Section (1) .text {
12COFF-NEXT: 0x4 IMAGE_REL_I386_DIR32 .data
13COFF-NEXT: 0x9 IMAGE_REL_I386_REL32 _puts
14COFF-NEXT: 0xE IMAGE_REL_I386_REL32 _SomeOtherFunction
15COFF-NEXT: }
16COFF-NEXT: ]
17
18ELF: Relocations [
19ELF-NEXT: Section (1) .text {
20ELF-NEXT: 0xC R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 0x0
21ELF-NEXT: 0x12 R_386_GOTOFF .L.str 0x0
22ELF-NEXT: 0x1A R_386_PLT32 puts 0x0
23ELF-NEXT: 0x1F R_386_PLT32 SomeOtherFunction 0x0
24ELF-NEXT: }
25ELF-NEXT: ]
26
Rafael Espindola1d532a32013-04-11 02:52:29 +000027MACHO-I386: Relocations [
28MACHO-I386-NEXT: Section __text {
Rafael Espindolaecf13202013-04-12 00:17:33 +000029MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
30MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
31MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 _main
32MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 _main
Rafael Espindola1d532a32013-04-11 02:52:29 +000033MACHO-I386-NEXT: }
34MACHO-I386-NEXT: ]
35
36MACHO-X86-64: Relocations [
37MACHO-X86-64-NEXT: Section __text {
Rafael Espindolaecf13202013-04-12 00:17:33 +000038MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction
39MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts
40MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str
Rafael Espindola1d532a32013-04-11 02:52:29 +000041MACHO-X86-64-NEXT: }
42MACHO-X86-64-NEXT:]