brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · 60404a1 Raw
119 lines · plain
1## When the offset of a non-PT_LOAD segment (e.g. PT_INTERP) equals the offset2## of a PT_LOAD segment, set the parent of the segment with a smaller alignment3## to the segment with a larger alignment, ensuring that the offset is correctly4## aligned.5 6# RUN: yaml2obj %s -o %t7# RUN: llvm-objcopy %t %t28# RUN: llvm-readelf -Sl %t2 | FileCheck %s9 10# CHECK:       [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al11# CHECK-NEXT:  [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  012# CHECK-NEXT:  [ 1] .text             PROGBITS        0000000000201000 001000 000001 00      0   0  413# CHECK-NEXT:  [ 2] .interp           PROGBITS        0000000000202000 002000 00001c 00      0   0  114# CHECK-NEXT:  [ 3] .rodata           PROGBITS        0000000000202020 002020 000001 00      0   0  115# CHECK-NEXT:  [ 4] .tdata            PROGBITS        0000000000203000 003000 000001 00      0   0 409616# CHECK-NEXT:  [ 5] .relro_padding    NOBITS          0000000000203001 003001 000fff 00      0   0  117# CHECK-NEXT:  [ 6] .strtab           STRTAB          0000000000000000 003001 000001 00      0   0  118# CHECK-NEXT:  [ 7] .shstrtab         STRTAB          0000000000000000 003002 00003f 00      0   0  119 20# CHECK:     Program Headers:21# CHECK-NEXT:  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align22# CHECK-NEXT:  PHDR           0x000040 0x0000000000200040 0x0000000000200040 0x0001c0 0x0001c0     0x823# CHECK-NEXT:  INTERP         0x002000 0x0000000000202000 0x0000000000202000 0x00001c 0x00001c     0x124# CHECK-NEXT:      [Requesting program interpreter: ]25# CHECK-NEXT:  LOAD           0x000000 0x0000000000200000 0x0000000000200000 0x000200 0x000200     0x100026# CHECK-NEXT:  LOAD           0x001000 0x0000000000201000 0x0000000000201000 0x000001 0x000001     0x100027# CHECK-NEXT:  LOAD           0x002000 0x0000000000202000 0x0000000000202000 0x000021 0x000021     0x100028# CHECK-NEXT:  TLS            0x003000 0x0000000000203000 0x0000000000203000 0x000001 0x001000     0x100029# CHECK-NEXT:  GNU_RELRO      0x003000 0x0000000000203000 0x0000000000203000 0x000001 0x001000     0x100030# CHECK-NEXT:  LOAD           0x003000 0x0000000000203000 0x0000000000203000 0x000001 0x001000     0x100031 32--- !ELF33FileHeader:34  Class:           ELFCLASS6435  Data:            ELFDATA2LSB36  Type:            ET_EXEC37  Machine:         EM_X86_6438ProgramHeaders:39  - Type:            PT_PHDR40    VAddr:           0x20004041    Align:           0x842    Offset:          0x4043    FileSize:        0x1c044    MemSize:         0x1c045  - Type:            PT_INTERP46    FirstSec:        .interp47    LastSec:         .interp48    ## The address equals the address of its containing PT_LOAD.49    VAddr:           0x20200050    Offset:          0x200051  - Type:            PT_LOAD52    VAddr:           0x20000053    Align:           0x100054    Offset:          0x055    FileSize:        0x20056    MemSize:         0x20057  - Type:            PT_LOAD58    FirstSec:        .text59    LastSec:         .text60    VAddr:           0x20100061    Align:           0x100062    Offset:          0x100063  - Type:            PT_LOAD64    FirstSec:        .interp65    LastSec:         .rodata66    VAddr:           0x20200067    Align:           0x100068    Offset:          0x200069  ## Intentionally place PT_TLS/PT_GNU_RELRO before PT_LOAD to test that we70  ## correctly set parent segments.71  - Type:            PT_TLS72    FirstSec:        .tdata73    LastSec:         .relro_padding74    VAddr:           0x20300075    Align:           0x100076    Offset:          0x300077  - Type:            PT_GNU_RELRO78    FirstSec:        .tdata79    LastSec:         .relro_padding80    VAddr:           0x20300081    Align:           0x100082    Offset:          0x300083  - Type:            PT_LOAD84    FirstSec:        .tdata85    LastSec:         .relro_padding86    VAddr:           0x20300087    Align:           0x100088    Offset:          0x300089Sections:90  - Name:            .text91    Type:            SHT_PROGBITS92    Address:         0x20100093    AddressAlign:    0x494    Offset:          0x100095    Content:         C396  - Name:            .interp97    Type:            SHT_PROGBITS98    Address:         0x20200099    AddressAlign:    0x1100    Offset:          0x2000101    Size:            0x1C102  - Name:            .rodata103    Type:            SHT_PROGBITS104    Address:         0x202020105    AddressAlign:    0x1106    Offset:          0x2020107    Size:            1108  - Name:            .tdata109    Type:            SHT_PROGBITS110    Address:         0x203000111    AddressAlign:    0x1000112    Offset:          0x3000113    Size:            1114  - Name:            .relro_padding115    Type:            SHT_NOBITS116    Address:         0x203001117    AddressAlign:    0x1118    Size:            0xFFF119