brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 4f83179 Raw
38 lines · plain
1# REQUIRES: x862## Show how symbols in GCed mergeable pieces behave.3 4# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o5# RUN: ld.lld --gc-sections %t.o -o %t.elf6# RUN: llvm-readelf %t.elf --sections --syms | FileCheck %s7 8.section .rodata.merge,"aM",@progbits,49a1: ## Unreferenced. In first fragment, kept by a2 reference.10    .short 111a2: ## Referenced.12    .short 113b1: ## Unreferenced. Discarded as second fragment is unreferenced.14    .short 115b2: ## Unreferenced. Discarded as second fragment is unreferenced.16    .short 117c1: ## Referenced.18    .short 119c2: ## Unreferenced. In third fragment, kept by c1 reference.20    .short 121 22.data23.global _start24_start:25    .quad a226    .quad c127 28# CHECK:      .rodata PROGBITS [[#%x, ADDR:]]29 30# CHECK:      Symbol table '.symtab' contains 6 entries:31# CHECK-NEXT:   Num:    Value          {{.*}} Ndx Name32# CHECK-NEXT:     0:                   {{.*}} UND{{ *$}}33# CHECK-NEXT:     1: {{0*}}[[#ADDR]]   {{.*}}     a134# CHECK-NEXT:     2: {{0*}}[[#ADDR+2]] {{.*}}     a235# CHECK-NEXT:     3: {{0*}}[[#ADDR]]   {{.*}}     c136# CHECK-NEXT:     4: {{0*}}[[#ADDR+2]] {{.*}}     c237# CHECK-NEXT:     5:                   {{.*}}     _start38