1# REQUIRES: x86, aarch64 2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux /dev/null -o %t.o 3# RUN: ld.lld -o %t.so --script %s %t.o -shared 4# RUN: llvm-readobj --symbols %t.so | FileCheck %s 5 6## Test that the script creates a non absolute symbol with value 7## 0 I.E., a symbol that refers to the load address. 8 9# CHECK: Symbol { 10# CHECK: Name: foo 11# CHECK-NEXT: Value: 0x0 12# CHECK-NEXT: Size: 0 13# CHECK-NEXT: Binding: Global 14# CHECK-NEXT: Type: None 15# CHECK-NEXT: Other: 0 16# CHECK-NEXT: Section: .text 17# 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.o 22# RUN: ld.lld -o %t.so --script %s %t.o -shared 23# RUN: llvm-readobj --symbols %t.so | FileCheck %s 24 25SECTIONS { 26 foo = ADDR(.text) - ABSOLUTE(ADDR(.text)); 27}; 28