xref: /llvm-project/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-section.yaml (revision 62e3b2ec1d8e54d2b377623c485d5399bc94521f)
1# Test behavior on strange (invalid?) elf files where the sections cross segment
2# boundary. The test input was generated from this yaml file, but the program
3# header was modified by hand, so this input is here for reference only.
4#
5# Right now lldb shortens sections to make sure every section is fully contained
6# within a segment, but other behaviors are possible too (including outright
7# rejecting such files).
8
9# RUN: lldb-test object-file %S/Inputs/PT_LOAD-overlap-section.elf | FileCheck %s
10
11# CHECK:      Index: 0
12# CHECK-NEXT: ID: 0xffffffffffffffff
13# CHECK-NEXT: Name: PT_LOAD[0]
14# CHECK-NEXT: Type: container
15# CHECK-NEXT: Permissions: rwx
16# CHECK-NEXT: Thread specific: no
17# CHECK-NEXT: VM address: 0x1006
18# CHECK-NEXT: VM size: 8
19# CHECK-NEXT: File size: 8
20# CHECK-NEXT: Showing 1 subsections
21# CHECK-NEXT:   Index: 0
22# CHECK-NEXT:   ID: 0x2
23# CHECK-NEXT:   Name: .text
24# CHECK-NEXT:   Type: code
25# CHECK-NEXT:   Permissions: r-x
26# CHECK-NEXT:   Thread specific: no
27# CHECK-NEXT:   VM address: 0x1008
28# CHECK-NEXT:   VM size: 6
29# CHECK-NEXT:   File size: 8
30
31# CHECK:      Index: 1
32# CHECK-NEXT: ID: 0x1
33# CHECK-NEXT: Name: .interp
34# CHECK-NEXT: Type: regular
35# CHECK-NEXT: Permissions: r--
36# CHECK-NEXT: Thread specific: no
37# CHECK-NEXT: VM address: 0x1000
38# CHECK-NEXT: VM size: 6
39# CHECK-NEXT: File size: 8
40
41!ELF
42FileHeader:
43  Class:           ELFCLASS32
44  Data:            ELFDATA2LSB
45  Type:            ET_EXEC
46  Machine:         EM_ARM
47Sections:
48  - Name:            .interp
49    Type:            SHT_PROGBITS
50    Flags:           [ SHF_ALLOC ]
51    Address:         0x1000
52    AddressAlign:    0x4
53    Content:         DEADBEEFBAADF00D
54  - Name:            .text
55    Type:            SHT_PROGBITS
56    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
57    Address:         0x1008
58    AddressAlign:    0x4
59    Content:         DEADBEEFBAADF00D
60ProgramHeaders:
61  - Type: PT_LOAD
62    Flags: [ PF_X, PF_W, PF_R ]
63    VAddr: 0x1008 # Modified by hand to start at 0x1006
64    Align: 0x4
65    FirstSec: .text
66    LastSec:  .text
67