2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 # RUN: ld.lld %t.o -r -o %t-rel
4 # RUN: llvm-readobj -S --section-data %t-rel | FileCheck %s
6 # When linker generates a relocatable object it does string merging in the same
7 # way as for regular link. It should keep SHF_MERGE flag and set proper sh_entsize
8 # value so that final link can perform the final merging optimization.
12 # CHECK: Name: .rodata.1 (
13 # CHECK-NEXT: Type: SHT_PROGBITS
15 # CHECK-NEXT: SHF_ALLOC
16 # CHECK-NEXT: SHF_MERGE
18 # CHECK-NEXT: Address:
23 # CHECK-NEXT: AddressAlignment: 4
24 # CHECK-NEXT: EntrySize: 4
25 # CHECK-NEXT: SectionData (
26 # CHECK-NEXT: 0000: 42000000
31 # CHECK: Name: .rodata.2 (
32 # CHECK-NEXT: Type: SHT_PROGBITS
34 # CHECK-NEXT: SHF_ALLOC
35 # CHECK-NEXT: SHF_MERGE
37 # CHECK-NEXT: Address:
42 # CHECK-NEXT: AddressAlignment: 8
43 # CHECK-NEXT: EntrySize: 8
44 # CHECK-NEXT: SectionData (
45 # CHECK-NEXT: 0000: 42000000 42000000
51 # CHECK-NEXT: Type: SHT_PROGBITS
53 # CHECK-NEXT: SHF_ALLOC
54 # CHECK-NEXT: SHF_WRITE
56 # CHECK-NEXT: Address:
58 # CHECK-NEXT: Size: 16
61 # CHECK-NEXT: AddressAlignment: 1
62 # CHECK-NEXT: EntrySize: 0
63 # CHECK-NEXT: SectionData (
64 # CHECK-NEXT: 0000: 42000000 42000000 42000000 42000000
68 .section .rodata.1,"aM",@progbits,4
76 .section .rodata.2,"aM",@progbits,8