mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 01:16:05 +00:00

Whilst reviewing some internal testing, I noticed a couple of holes in coverage of mergeable sections containing symbols. This patch addresses these holes: 1) Show that mid-piece symbols have their values updated properly when pieces are merged. 2) Show the behaviour of symbols in mergeable pieces when --gc-sections is enabled. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D86543
22 lines
659 B
ArmAsm
22 lines
659 B
ArmAsm
// REQUIRES: x86
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
|
// RUN: ld.lld %t.o -o %t.so -shared
|
|
// RUN: llvm-readelf --symbols -S %t.so | FileCheck %s
|
|
|
|
.section .rodata.cst4,"aM",@progbits,4
|
|
.short 0
|
|
foo:
|
|
.short 42
|
|
|
|
.short 0
|
|
bar:
|
|
.short 42
|
|
|
|
// CHECK: Name Type Address {{.*}} ES Flg
|
|
// CHECK: .rodata PROGBITS [[#%x, ADDR:]] {{.*}} 04 AM{{ }}
|
|
|
|
// CHECK: Symbol table '.symtab' contains {{.*}} entries:
|
|
// CHECK-NEXT: Num: Value {{.*}} Name
|
|
// CHECK-DAG: {{.*}}: {{0*}}[[#ADDR+2]] {{.*}} foo
|
|
// CHECK-DAG: {{.*}}: {{0*}}[[#ADDR+2]] {{.*}} bar
|