1// REQUIRES: x86
2// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3// RUN: ld.lld %t.o -o %t
4// RUN: llvm-readobj -S %t | FileCheck %s
5
6        .section  .rodata.1,"aM",@progbits,1
7        .p2align 2
8        .byte 0x42
9
10// sh_addralign = 4 while sh_entsize = 3.
11// sh_entsize is not necessarily a power of 2 and it can be unrelated to sh_addralign.
12        .section  .rodata.2,"aM",@progbits,3
13        .p2align 2
14        .short 0x42
15        .byte 0
16
17// Since the output section has both .rodata.1 and .rodata.2, it
18// contains elements of different sizes and we use an entsize of 0.
19
20// CHECK:      Name: .rodata (
21// CHECK-NEXT: Type: SHT_PROGBITS
22// CHECK-NEXT: Flags [
23// CHECK-NEXT:   SHF_ALLOC
24// CHECK-NEXT:   SHF_MERGE
25// CHECK-NEXT: ]
26// CHECK-NEXT: Address:
27// CHECK-NEXT: Offset:
28// CHECK-NEXT: Size:
29// CHECK-NEXT: Link:
30// CHECK-NEXT: Info:
31// CHECK-NEXT: AddressAlignment: 4
32// CHECK-NEXT: EntrySize: 0
33