• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Show that dumping occurs even if there is no PT_DYNAMIC header.
2## This is inconsistent with the GNU behavior, but seems to be more reasonable.
3# RUN: yaml2obj %s -o %t.no-phdr
4# RUN: llvm-readobj --dynamic-table %t.no-phdr | FileCheck %s --check-prefix=LLVM
5# RUN: llvm-readelf --dynamic-table %t.no-phdr | FileCheck %s --check-prefix=GNU
6
7# LLVM:      File: {{.*}}.no-phdr
8# LLVM-NEXT: Format: elf64-x86-64
9# LLVM-NEXT: Arch: x86_64
10# LLVM-NEXT: AddressSize: 64bit
11# LLVM-NEXT: LoadName:{{ *}}
12# LLVM-NEXT: DynamicSection [ (1 entries)
13# LLVM-NEXT:   Tag                Type Name/Value
14# LLVM-NEXT:   0x0000000000000000 NULL 0x0
15# LLVM-NEXT: ]
16
17# GNU:      Dynamic section at offset 0x78 contains 1 entries:
18# GNU-NEXT: Tag                Type   Name/Value
19# GNU-NEXT: 0x0000000000000000 (NULL) 0x0
20
21--- !ELF
22FileHeader:
23  Class:   ELFCLASS64
24  Data:    ELFDATA2LSB
25  Type:    ET_EXEC
26  Machine: EM_X86_64
27Sections:
28  - Name:    .dynamic
29    Type:    SHT_DYNAMIC
30    Address: 0x1000
31    Entries:
32      - Tag:   DT_NULL
33        Value: 0
34ProgramHeaders:
35  - Type:     PT_LOAD
36    VAddr:    0x1000
37    FirstSec: .dynamic
38    LastSec:  .dynamic
39