2 ## Show how symbols in GCed mergeable pieces behave.
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
5 # RUN: ld.lld --gc-sections %t.o -o %t.elf
6 # RUN: llvm-readelf %t.elf --sections --syms | FileCheck %s
8 .section .rodata.merge,"aM",@progbits,4
9 a1
: ## Unreferenced. In first fragment, kept by a2 reference.
13 b1
: ## Unreferenced. Discarded as second fragment is unreferenced.
15 b2
: ## Unreferenced. Discarded as second fragment is unreferenced.
19 c2
: ## Unreferenced. In third fragment, kept by c1 reference.
28 # CHECK: .rodata PROGBITS [[#%x, ADDR:]]
30 # CHECK: Symbol table '.symtab' contains 6 entries:
31 # CHECK-NEXT: Num: Value {{.*}} Ndx Name
32 # CHECK-NEXT: 0: {{.*}} UND{{ *$}}
33 # CHECK-NEXT: 1: {{0*}}[[#ADDR]] {{.*}} a1
34 # CHECK-NEXT: 2: {{0*}}[[#ADDR+2]] {{.*}} a2
35 # CHECK-NEXT: 3: {{0*}}[[#ADDR]] {{.*}} c1
36 # CHECK-NEXT: 4: {{0*}}[[#ADDR+2]] {{.*}} c2
37 # CHECK-NEXT: 5: {{.*}} _start