| 1 | ## Check we are able to set a custom sh_addralign field for different sections |
| 2 | ## and that doing this does not affect the output size. |
| 3 | |
| 4 | ## Test that we are able to override the sh_addralign section |
| 5 | ## field with use of the "ShAddrAlign" key. |
| 6 | |
| 7 | # RUN: yaml2obj %s -o %t |
| 8 | # RUN: llvm-readelf --sections %t | FileCheck %s --check-prefix=CHECK |
| 9 | |
| 10 | # CHECK: Section Headers: |
| 11 | # CHECK-NEXT: [Nr] Name {{.*}} Off Size ES Flg Lk Inf Al |
| 12 | # CHECK-NEXT: [ 0] {{.*}} 000000 000000 00 0 0 0 |
| 13 | # CHECK-NEXT: [ 1] .foo {{.*}} 000080 000000 00 0 0 1229782938247303441 |
| 14 | # CHECK-NEXT: [ 2] .bar {{.*}} 000100 000000 00 0 0 2459565876494606882 |
| 15 | # CHECK-NEXT: [ 3] .strtab {{.*}} 000100 000001 00 0 0 1 |
| 16 | |
| 17 | --- !ELF |
| 18 | FileHeader: |
| 19 | Class: ELFCLASS64 |
| 20 | Data: ELFDATA2LSB |
| 21 | Type: ET_REL |
| 22 | Sections: |
| 23 | - Name: .foo |
| 24 | Type: SHT_PROGBITS |
| 25 | AddressAlign: 0x80 |
| 26 | ShAddrAlign: 0x1111111111111111 |
| 27 | - Name: .bar |
| 28 | Type: SHT_PROGBITS |
| 29 | AddressAlign: 0x100 |
| 30 | ShAddrAlign: 0x2222222222222222 |