64 lines · plain
1## Test that we are able to print dynamic relocations with --dyn-relocations2## even when there are no section headers.3 4# RUN: yaml2obj %s -o %t5# RUN: llvm-readobj --dyn-relocations %t 2>&1 \6# RUN: | FileCheck %s -DFILE=%t --implicit-check-not="warning:" --check-prefix=LLVM-NO-SEC-TABLE7# RUN: llvm-readelf --dyn-relocations %t 2>&1 \8# RUN: | FileCheck %s -DFILE=%t --implicit-check-not="warning:" --check-prefix=GNU-NO-SEC-TABLE9 10# LLVM-NO-SEC-TABLE: Dynamic Relocations {11# LLVM-NO-SEC-TABLE-NEXT: 0x0 R_X86_64_NONE foo 0x012# LLVM-NO-SEC-TABLE-NEXT: }13 14# GNU-NO-SEC-TABLE: 'RELA' relocation section at offset 0xb0 contains 24 bytes:15# GNU-NO-SEC-TABLE-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend16# GNU-NO-SEC-TABLE-NEXT: 0000000000000000 0000000100000000 R_X86_64_NONE 0000000000000000 foo + 017 18--- !ELF19FileHeader:20 Class: ELFCLASS6421 Data: ELFDATA2LSB22 Type: ET_DYN23 Machine: EM_X86_6424Sections:25 - Name: .rela.dyn26 Type: SHT_RELA27 Relocations:28 - Type: R_X86_64_NONE29 Symbol: 0x130 - Name: .dynamic31 Type: SHT_DYNAMIC32 Entries:33 - Tag: DT_RELA34 Value: 0x035 - Tag: DT_RELASZ36 Value: 0x1837 - Tag: DT_RELAENT38 Value: 0x1839## Offset of .dynsym is 0x138. Offset of PT_LOAD is 0xb0.40## 0x138 - 0xb0 == 0x8841 - Tag: DT_SYMTAB42 Value: 0x8843 - Tag: DT_STRSZ44 Value: 0x545## Offset of .dynstr is 0x168. Offset of PT_LOAD is 0xb0.46## 0x168 - 0xb0 == 0xb847 - Tag: DT_STRTAB48 Value: 0xb849 - Tag: DT_NULL50 Value: 0x051 - Name: .dynsym52 Type: SHT_DYNSYM53 - Type: SectionHeaderTable54 NoHeaders: true55DynamicSymbols:56 - Name: foo57ProgramHeaders:58 - Type: PT_LOAD59 FirstSec: .rela.dyn60 LastSec: .dynstr61 - Type: PT_DYNAMIC62 FirstSec: .dynamic63 LastSec: .dynamic64