28 lines · plain
1# REQUIRES: x86, aarch642# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t.o3# RUN: ld.lld -o %t.so --script %s %t.o -shared4# RUN: llvm-readobj --symbols %t.so | FileCheck %s5 6## Test that the script creates a non absolute symbol with value7## 0 I.E., a symbol that refers to the load address.8 9# CHECK: Symbol {10# CHECK: Name: foo11# CHECK-NEXT: Value: 0x012# CHECK-NEXT: Size: 013# CHECK-NEXT: Binding: Global14# CHECK-NEXT: Type: None15# CHECK-NEXT: Other: 016# CHECK-NEXT: Section: .text17# CHECK-NEXT: }18 19## Because of a bug we had a different behavior (different symbol 'foo' value)20## on a platforms that might use thunks, like AArch64. Check that issue is fixed.21# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu /dev/null -o %t.o22# RUN: ld.lld -o %t.so --script %s %t.o -shared23# RUN: llvm-readobj --symbols %t.so | FileCheck %s24 25SECTIONS {26 foo = ADDR(.text) - ABSOLUTE(ADDR(.text));27};28