63 lines · plain
1/// Check that we write addends for AArch64 TLSDESC relocations with -z rel2/// See https://bugs.llvm.org/show_bug.cgi?id=470093// REQUIRES: aarch644// RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o5// RUN: ld.lld -shared %t.o -o %t-rela.so6// RUN: llvm-readobj -W -r -x .got %t-rela.so | FileCheck %s --check-prefixes=RELA,RELA-NO-ADDENDS7// RUN: ld.lld -shared %t.o -o %t-rela-addends.so --apply-dynamic-relocs8// RUN: llvm-readobj -W -r -x .got %t-rela-addends.so | FileCheck %s --check-prefixes=RELA,RELA-WITH-ADDENDS9 10// RELA: Relocations [11// RELA-NEXT: Section (5) .rela.dyn {12// RELA-NEXT: 0x[[#%x,ADDR:]] R_AARCH64_TLSDESC - 0x013// RELA-NEXT: 0x[[#ADDR+16]] R_AARCH64_TLSDESC - 0x414// RELA-NEXT: }15// RELA-NEXT: ]16// RELA-EMPTY:17// RELA-NEXT: Hex dump of section '.got':18// RELA-NEXT: 0x000[[#ADDR]] 00000000 00000000 00000000 0000000019// RELA-NO-ADDENDS-NEXT: 0x000[[#ADDR+16]] 00000000 00000000 00000000 0000000020// RELA-WITH-ADDENDS-NEXT: 0x000[[#ADDR+16]] 00000000 00000000 04000000 0000000021/// Addend 0x4 for R_AARCH64_TLSDESC -----^22// RELA-EMPTY:23 24// RUN: ld.lld -shared %t.o -o %t-rel.so -z rel25// RUN: llvm-readobj -W -r -x .got %t-rel.so | FileCheck %s --check-prefix=REL26// REL: Relocations [27// REL-NEXT: Section (5) .rel.dyn {28// REL-NEXT: 0x[[#%x,ADDR:]] R_AARCH64_TLSDESC -{{$}}29// REL-NEXT: 0x[[#ADDR+16]] R_AARCH64_TLSDESC -{{$}}30// REL-NEXT: }31// REL-NEXT: ]32// REL-EMPTY:33// REL-NEXT: Hex dump of section '.got':34// REL-NEXT: 0x000[[#ADDR]] 00000000 00000000 00000000 0000000035// REL-NEXT: 0x000[[#ADDR+16]] 00000000 00000000 04000000 0000000036/// Addend 0x4 for R_AARCH64_TLSDESC -----^37// REL-EMPTY:38 39 .text40foo:41 adrp x0, :tlsdesc:x42 ldr x1, [x0, :tlsdesc_lo12:x]43 add x0, x0, :tlsdesc_lo12:x44 .tlsdesccall x45 blr x146 adrp x0, :tlsdesc:y47 ldr x1, [x0, :tlsdesc_lo12:y]48 add x0, x0, :tlsdesc_lo12:y49 .tlsdesccall y50 blr x151 ret52 53 .section .tbss,"awT",@nobits54 .p2align 255 .hidden x56x:57 .word 058 59 .p2align 260 .hidden y61y:62 .word 063