1# Test that sections are made child-sections of the PT_LOAD segments/sections.
2
3# RUN: yaml2obj %s -o %t
4# RUN: lldb-test object-file %t | FileCheck %s
5
6# CHECK:      Index: 0
7# CHECK-NEXT: ID: 0xffffffffffffffff
8# CHECK-NEXT: Name: PT_LOAD[0]
9# CHECK-NEXT: Type: container
10# CHECK-NEXT: Permissions: rwx
11# CHECK-NEXT: Thread specific: no
12# CHECK-NEXT: VM address: 0x1000
13# CHECK-NEXT: VM size: 10
14# CHECK-NEXT: File size: 10
15# CHECK-NEXT: Showing 2 subsections
16# CHECK-NEXT:   Index: 0
17# CHECK-NEXT:   ID: 0x1
18# CHECK-NEXT:   Name: .text
19# CHECK-NEXT:   Type: code
20# CHECK-NEXT:   Permissions: r-x
21# CHECK-NEXT:   Thread specific: no
22# CHECK-NEXT:   VM address: 0x1000
23# CHECK-NEXT:   VM size: 8
24# CHECK-NEXT:   File size: 8
25# CHECK-EMPTY:
26# CHECK-NEXT:   Index: 1
27# CHECK-NEXT:   ID: 0x2
28# CHECK-NEXT:   Name: .data
29# CHECK-NEXT:   Type: data
30# CHECK-NEXT:   Permissions: r--
31# CHECK-NEXT:   Thread specific: no
32# CHECK-NEXT:   VM address: 0x1008
33# CHECK-NEXT:   VM size: 2
34# CHECK-NEXT:   File size: 2
35# CHECK-EMPTY:
36# CHECK-EMPTY:
37# CHECK-NEXT: Index: 1
38# CHECK-NEXT: ID: 0x3
39# CHECK-NEXT: Name: .data_outside
40# CHECK-NEXT: Type: regular
41# CHECK-NEXT: Permissions: r--
42# CHECK-NEXT: Thread specific: no
43# CHECK-NEXT: VM address: 0x2000
44# CHECK-NEXT: VM size: 2
45# CHECK-NEXT: File size: 2
46
47!ELF
48FileHeader:
49  Class:           ELFCLASS32
50  Data:            ELFDATA2LSB
51  Type:            ET_EXEC
52  Machine:         EM_ARM
53Sections:
54  - Name:            .text
55    Type:            SHT_PROGBITS
56    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
57    Address:         0x1000
58    AddressAlign:    0x4
59    Content:         DEADBEEFBAADF00D
60  - Name:            .data
61    Type:            SHT_PROGBITS
62    Flags:           [ SHF_ALLOC ]
63    Address:         0x1008
64    AddressAlign:    0x4
65    Content:         3232
66  - Name:            .data_outside
67    Type:            SHT_PROGBITS
68    Flags:           [ SHF_ALLOC ]
69    Address:         0x2000
70    AddressAlign:    0x4
71    Content:         3232
72ProgramHeaders:
73  - Type: PT_LOAD
74    Flags: [ PF_X, PF_W, PF_R ]
75    VAddr: 0x1000
76    Align: 0x4
77    FirstSec: .text
78    LastSec:  .data
79