2013-04-04 02:31:38 +08:00
|
|
|
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 \
|
2013-04-11 10:52:29 +08:00
|
|
|
RUN: | FileCheck %s -check-prefix MACHO-I386
|
|
|
|
RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \
|
|
|
|
RUN: | FileCheck %s -check-prefix MACHO-X86-64
|
2013-04-13 09:45:40 +08:00
|
|
|
RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-ppc \
|
|
|
|
RUN: | FileCheck %s -check-prefix MACHO-PPC
|
|
|
|
RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-ppc64 \
|
|
|
|
RUN: | FileCheck %s -check-prefix MACHO-PPC64
|
2013-04-19 02:08:55 +08:00
|
|
|
RUN: llvm-readobj -r -expand-relocs %p/Inputs/trivial.obj.macho-arm \
|
|
|
|
RUN: | FileCheck %s -check-prefix MACHO-ARM
|
2013-04-04 02:31:38 +08:00
|
|
|
|
|
|
|
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 [
|
2013-05-30 11:05:14 +08:00
|
|
|
ELF-NEXT: Section (2) .rel.text {
|
2013-04-04 02:31:38 +08:00
|
|
|
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: ]
|
|
|
|
|
2013-04-11 10:52:29 +08:00
|
|
|
MACHO-I386: Relocations [
|
|
|
|
MACHO-I386-NEXT: Section __text {
|
2013-04-12 08:17:33 +08:00
|
|
|
MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
|
|
|
|
MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
|
|
|
|
MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
|
2013-04-11 10:52:29 +08:00
|
|
|
MACHO-I386-NEXT: }
|
|
|
|
MACHO-I386-NEXT: ]
|
|
|
|
|
|
|
|
MACHO-X86-64: Relocations [
|
|
|
|
MACHO-X86-64-NEXT: Section __text {
|
2013-04-12 08:17:33 +08:00
|
|
|
MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction
|
|
|
|
MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts
|
|
|
|
MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str
|
2013-04-11 10:52:29 +08:00
|
|
|
MACHO-X86-64-NEXT: }
|
|
|
|
MACHO-X86-64-NEXT:]
|
2013-04-13 09:45:40 +08:00
|
|
|
|
|
|
|
MACHO-PPC: Relocations [
|
|
|
|
MACHO-PPC-NEXT: Section __text {
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-PPC-NEXT: 0x24 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x64
|
|
|
|
MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0xC
|
|
|
|
MACHO-PPC-NEXT: 0x1C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x64
|
|
|
|
MACHO-PPC-NEXT: 0x58 0 2 n/a PPC_RELOC_PAIR 1 0xC
|
|
|
|
MACHO-PPC-NEXT: 0x18 1 2 0 PPC_RELOC_BR24 0 0x2
|
2013-04-13 09:45:40 +08:00
|
|
|
MACHO-PPC-NEXT: }
|
|
|
|
MACHO-PPC-NEXT: Section __picsymbolstub1 {
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-PPC-NEXT: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x68
|
|
|
|
MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0x48
|
|
|
|
MACHO-PPC-NEXT: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x68
|
|
|
|
MACHO-PPC-NEXT: 0x20 0 2 n/a PPC_RELOC_PAIR 1 0x48
|
2013-04-13 09:45:40 +08:00
|
|
|
MACHO-PPC-NEXT: }
|
|
|
|
MACHO-PPC-NEXT: Section __la_symbol_ptr {
|
|
|
|
MACHO-PPC-NEXT: 0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper
|
|
|
|
MACHO-PPC-NEXT: }
|
|
|
|
MACHO-PPC-NEXT: ]
|
|
|
|
|
|
|
|
MACHO-PPC64: Relocations [
|
|
|
|
MACHO-PPC64-NEXT: Section __text {
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 0x64
|
|
|
|
MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 0xC
|
|
|
|
MACHO-PPC64-NEXT: 0x1C 0 2 n/a 1 0x64
|
|
|
|
MACHO-PPC64-NEXT: 0x58 0 2 n/a 1 0xC
|
|
|
|
MACHO-PPC64-NEXT: 0x18 1 2 0 0 0x2
|
2013-04-13 09:45:40 +08:00
|
|
|
MACHO-PPC64-NEXT: }
|
|
|
|
MACHO-PPC64-NEXT: Section __picsymbolstub1 {
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-PPC64-NEXT: 0x14 0 2 n/a 1 0x6C
|
|
|
|
MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 0x48
|
|
|
|
MACHO-PPC64-NEXT: 0xC 0 2 n/a 1 0x6C
|
|
|
|
MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 0x48
|
2013-04-13 09:45:40 +08:00
|
|
|
MACHO-PPC64-NEXT: }
|
|
|
|
MACHO-PPC64-NEXT: Section __la_symbol_ptr {
|
|
|
|
MACHO-PPC64-NEXT: 0x0 0 3 1 0 dyld_stub_binding_helper
|
|
|
|
MACHO-PPC64-NEXT: }
|
|
|
|
MACHO-PPC64-NEXT: ]
|
2013-04-19 02:08:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
MACHO-ARM: Relocations [
|
|
|
|
MACHO-ARM-NEXT: Section __text {
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x38
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 2
|
|
|
|
MACHO-ARM-NEXT: Extern: N/A
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-ARM-NEXT: Symbol: 0x40
|
2013-04-19 02:08:55 +08:00
|
|
|
MACHO-ARM-NEXT: Scattered: 1
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x0
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 2
|
|
|
|
MACHO-ARM-NEXT: Extern: N/A
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-ARM-NEXT: Symbol: 0x28
|
2013-04-19 02:08:55 +08:00
|
|
|
MACHO-ARM-NEXT: Scattered: 1
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x20
|
|
|
|
MACHO-ARM-NEXT: PCRel: 1
|
|
|
|
MACHO-ARM-NEXT: Length: 2
|
|
|
|
MACHO-ARM-NEXT: Extern: 1
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5)
|
|
|
|
MACHO-ARM-NEXT: Symbol: _g
|
|
|
|
MACHO-ARM-NEXT: Scattered: 0
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x1C
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 1
|
|
|
|
MACHO-ARM-NEXT: Extern: 1
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
|
|
|
|
MACHO-ARM-NEXT: Symbol: _g
|
|
|
|
MACHO-ARM-NEXT: Scattered: 0
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x0
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 1
|
|
|
|
MACHO-ARM-NEXT: Extern: 0
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-ARM-NEXT: Symbol: 0xFFFFFF
|
2013-04-19 02:08:55 +08:00
|
|
|
MACHO-ARM-NEXT: Scattered: 0
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x18
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 0
|
|
|
|
MACHO-ARM-NEXT: Extern: 1
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8)
|
|
|
|
MACHO-ARM-NEXT: Symbol: _g
|
|
|
|
MACHO-ARM-NEXT: Scattered: 0
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x0
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 0
|
|
|
|
MACHO-ARM-NEXT: Extern: 0
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-ARM-NEXT: Symbol: 0xFFFFFF
|
2013-04-19 02:08:55 +08:00
|
|
|
MACHO-ARM-NEXT: Scattered: 0
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0xC
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 2
|
|
|
|
MACHO-ARM-NEXT: Extern: N/A
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-ARM-NEXT: Symbol: 0x44
|
2013-04-19 02:08:55 +08:00
|
|
|
MACHO-ARM-NEXT: Scattered: 1
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: Relocation {
|
|
|
|
MACHO-ARM-NEXT: Offset: 0x0
|
|
|
|
MACHO-ARM-NEXT: PCRel: 0
|
|
|
|
MACHO-ARM-NEXT: Length: 2
|
|
|
|
MACHO-ARM-NEXT: Extern: N/A
|
|
|
|
MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
|
2014-07-04 18:57:56 +08:00
|
|
|
MACHO-ARM-NEXT: Symbol: 0x4
|
2013-04-19 02:08:55 +08:00
|
|
|
MACHO-ARM-NEXT: Scattered: 1
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: }
|
|
|
|
MACHO-ARM-NEXT: ]
|