[lld] [lld][ELF][AArch64] Support `R_AARCH64_GOT_LD_PREL19` relocation (PR #89592)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 02:43:15 PDT 2024
================
@@ -1,26 +1,44 @@
# REQUIRES: aarch64
-# RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o
-# RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %p/Inputs/shared.s -o %t-lib.o
-# RUN: ld.lld -shared %t-lib.o -soname t-lib.so -o %t-lib.so
+# RUN: rm -rf %t && split-file %s %t && cd %t
-# RUN: ld.lld %t-lib.so %t.o -o %t.exe
-# RUN: llvm-readobj -r %t.exe | FileCheck --check-prefix=RELOC %s
-# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.exe | FileCheck --check-prefix=DIS %s
+# RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %p/Inputs/shared.s -o lib.o
+# RUN: ld.lld -shared lib.o -soname lib.so -o lib.so
## Checks if got access to dynamic objects is done through a got relative
## dynamic relocation and not using plt relative (R_AARCH64_JUMP_SLOT).
# RELOC: .rela.dyn {
-# RELOC-NEXT: 0x220320 R_AARCH64_GLOB_DAT bar 0x0
+# RELOC-NEXT: 0x220318 R_AARCH64_GLOB_DAT bar 0x0
# RELOC-NEXT: }
-## page(0x220320) - page(0x210000) = 65536
-## page(0x220320) & 0xff8 = 800
-# DIS: <_start>:
-# DIS-NEXT: 210258: adrp x0, 0x220000
-# DIS-NEXT: 21025c: ldr x0, [x0, #800]
+#--- small.s
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux small.s -o small.o
+# RUN: ld.lld lib.so small.o -o small.exe
+# RUN: llvm-readobj -r small.exe | FileCheck --check-prefix=RELOC %s
+# RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn small.exe | FileCheck --check-prefix=DIS-SMALL %s
----------------
kovdan01 wrote:
> Is there a reason to use `--no-print-imm-hex`?
I don't see such a reason, I've just left it as it was. Deleted this as it does not look essential, thanks. Also switched to hex instead of decimal in comment below.
> (We usually avoid `.exe`. A file without a suffix is common for executables)
Thanks, deleted (the suffix was already there before, but I agree that it's not needed).
See 39e0eb6ac3e86423bef5c27c02fe1802957df637
https://github.com/llvm/llvm-project/pull/89592
More information about the llvm-commits
mailing list