2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # RUN: echo "SECTIONS { \
5 # RUN: . = SIZEOF_HEADERS; \
6 # RUN: .foo : { begin = .; *(.foo.*) end = .;} \
8 # RUN: ld.lld -o %t1 --script %t.script %t -shared
9 # RUN: llvm-readobj -S --symbols %t1 | FileCheck %s
12 # CHECK-NEXT: Type: SHT_PROGBITS
14 # CHECK-NEXT: SHF_ALLOC
15 # CHECK-NEXT: SHF_MERGE
16 # CHECK-NEXT: SHF_STRINGS
18 # CHECK-NEXT: Address: 0x[[ADDR1:.*]]
19 # CHECK-NEXT: Offset: 0x[[ADDR1]]
23 # CHECK-NEXT: AddressAlignment: 2
24 # CHECK-NEXT: EntrySize: 0
28 # CHECK-NEXT: Value: 0x[[ADDR1]]
31 # CHECK-NEXT: Value: 0x268
33 # Check that we don't crash with --gc-sections
34 # RUN: ld.lld --gc-sections -o %t2 --script %t.script %t -shared
35 # RUN: llvm-readobj -S --symbols %t2 | FileCheck %s --check-prefix=GC
38 # GC-NEXT: Type: SHT_PROGBITS
43 .section .foo.1a,"aMS",@progbits,1
46 .section .foo.1b,"aMS",@progbits,1
49 .section .foo.2a,"aM",@progbits,1
52 .section .foo.2b,"aM",@progbits,1
55 .section .foo.3a,"aM",@progbits,2
59 .section .foo.3b,"aM",@progbits,2