Eric Christopher | 9cad53c | 2013-04-03 18:31:38 +0000 | [diff] [blame] | 1 | RUN: llvm-readobj -r %p/Inputs/trivial.obj.coff-i386 \ |
| 2 | RUN: | FileCheck %s -check-prefix COFF |
| 3 | RUN: llvm-readobj -r %p/Inputs/trivial.obj.elf-i386 \ |
| 4 | RUN: | FileCheck %s -check-prefix ELF |
| 5 | RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \ |
Rafael Espindola | 1d532a3 | 2013-04-11 02:52:29 +0000 | [diff] [blame^] | 6 | RUN: | FileCheck %s -check-prefix MACHO-I386 |
| 7 | RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \ |
| 8 | RUN: | FileCheck %s -check-prefix MACHO-X86-64 |
Eric Christopher | 9cad53c | 2013-04-03 18:31:38 +0000 | [diff] [blame] | 9 | |
| 10 | COFF: Relocations [ |
| 11 | COFF-NEXT: Section (1) .text { |
| 12 | COFF-NEXT: 0x4 IMAGE_REL_I386_DIR32 .data |
| 13 | COFF-NEXT: 0x9 IMAGE_REL_I386_REL32 _puts |
| 14 | COFF-NEXT: 0xE IMAGE_REL_I386_REL32 _SomeOtherFunction |
| 15 | COFF-NEXT: } |
| 16 | COFF-NEXT: ] |
| 17 | |
| 18 | ELF: Relocations [ |
| 19 | ELF-NEXT: Section (1) .text { |
| 20 | ELF-NEXT: 0xC R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 0x0 |
| 21 | ELF-NEXT: 0x12 R_386_GOTOFF .L.str 0x0 |
| 22 | ELF-NEXT: 0x1A R_386_PLT32 puts 0x0 |
| 23 | ELF-NEXT: 0x1F R_386_PLT32 SomeOtherFunction 0x0 |
| 24 | ELF-NEXT: } |
| 25 | ELF-NEXT: ] |
| 26 | |
Rafael Espindola | 1d532a3 | 2013-04-11 02:52:29 +0000 | [diff] [blame^] | 27 | MACHO-I386: Relocations [ |
| 28 | MACHO-I386-NEXT: Section __text { |
| 29 | MACHO-I386-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0 |
| 30 | MACHO-I386-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0 |
| 31 | MACHO-I386-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}} |
| 32 | MACHO-I386-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}} |
| 33 | MACHO-I386-NEXT: } |
| 34 | MACHO-I386-NEXT: ] |
| 35 | |
| 36 | MACHO-X86-64: Relocations [ |
| 37 | MACHO-X86-64-NEXT: Section __text { |
| 38 | MACHO-X86-64-NEXT: 0xE X86_64_RELOC_BRANCH _SomeOtherFunction 0x0 |
| 39 | MACHO-X86-64-NEXT: 0x9 X86_64_RELOC_BRANCH _puts 0x0 |
| 40 | MACHO-X86-64-NEXT: 0x4 X86_64_RELOC_SIGNED L_.str 0x0 |
| 41 | MACHO-X86-64-NEXT: } |
| 42 | MACHO-X86-64-NEXT:] |