1 ## When the offset of a non-PT_LOAD segment (e.g. PT_INTERP) equals the offset
2 ## of a PT_LOAD segment, set the parent of the segment with a smaller alignment
3 ## to the segment with a larger alignment, ensuring that the offset is correctly
6 # RUN: yaml2obj %s -o %t
7 # RUN: llvm-objcopy %t %t2
8 # RUN: llvm-readelf -Sl %t2 | FileCheck %s
10 # CHECK: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
11 # CHECK-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
12 # CHECK-NEXT: [ 1] .text PROGBITS 0000000000201000 001000 000001 00 0 0 4
13 # CHECK-NEXT: [ 2] .interp PROGBITS 0000000000202000 002000 00001c 00 0 0 1
14 # CHECK-NEXT: [ 3] .rodata PROGBITS 0000000000202020 002020 000001 00 0 0 1
15 # CHECK-NEXT: [ 4] .tdata PROGBITS 0000000000203000 003000 000001 00 0 0 4096
16 # CHECK-NEXT: [ 5] .relro_padding NOBITS 0000000000203001 003001 000fff 00 0 0 1
17 # CHECK-NEXT: [ 6] .strtab STRTAB 0000000000000000 003001 000001 00 0 0 1
18 # CHECK-NEXT: [ 7] .shstrtab STRTAB 0000000000000000 003002 00003f 00 0 0 1
20 # CHECK: Program Headers:
21 # CHECK-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
22 # CHECK-NEXT: PHDR 0x000040 0x0000000000200040 0x0000000000200040 0x0001c0 0x0001c0 0x8
23 # CHECK-NEXT: INTERP 0x002000 0x0000000000202000 0x0000000000202000 0x00001c 0x00001c 0x1
24 # CHECK-NEXT: [Requesting program interpreter: ]
25 # CHECK-NEXT: LOAD 0x000000 0x0000000000200000 0x0000000000200000 0x000200 0x000200 0x1000
26 # CHECK-NEXT: LOAD 0x001000 0x0000000000201000 0x0000000000201000 0x000001 0x000001 0x1000
27 # CHECK-NEXT: LOAD 0x002000 0x0000000000202000 0x0000000000202000 0x000021 0x000021 0x1000
28 # CHECK-NEXT: TLS 0x003000 0x0000000000203000 0x0000000000203000 0x000001 0x001000 0x1000
29 # CHECK-NEXT: GNU_RELRO 0x003000 0x0000000000203000 0x0000000000203000 0x000001 0x001000 0x1000
30 # CHECK-NEXT: LOAD 0x003000 0x0000000000203000 0x0000000000203000 0x000001 0x001000 0x1000
48 ## The address equals the address of its containing PT_LOAD.
69 ## Intentionally place PT_TLS/PT_GNU_RELRO before PT_LOAD to test that we
70 ## correctly set parent segments.
73 LastSec: .relro_padding
79 LastSec: .relro_padding
85 LastSec: .relro_padding
114 - Name: .relro_padding