[llvm-branch-commits] [lld] [PAC][lld][AArch64][ELF] Support signed GOT with tiny code model (PR #113816)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Nov 1 11:14:54 PDT 2024


================
@@ -78,6 +78,79 @@ _start:
   adrp x1, :got_auth:zed
   add  x1, x1, :got_auth_lo12:zed
 
+#--- ok-tiny.s
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux ok-tiny.s -o ok-tiny.o
+
+# RUN: ld.lld ok-tiny.o a.so -pie -o external-tiny
+# RUN: llvm-readelf -r -S -x .got external-tiny | FileCheck %s --check-prefix=EXTERNAL-TINY
+
+# RUN: ld.lld ok-tiny.o a.o -pie -o local-tiny
+# RUN: llvm-readelf -r -S -x .got -s local-tiny | FileCheck %s --check-prefix=LOCAL-TINY
+
+# EXTERNAL-TINY:      Offset            Info             Type                    Symbol's Value   Symbol's Name + Addend
+# EXTERNAL-TINY-NEXT: 0000000000020380  000000010000e201 R_AARCH64_AUTH_GLOB_DAT 0000000000000000 bar + 0
+# EXTERNAL-TINY-NEXT: 0000000000020388  000000020000e201 R_AARCH64_AUTH_GLOB_DAT 0000000000000000 zed + 0
+
+## Symbol's values for bar and zed are equal since they contain no content (see Inputs/shared.s)
+# LOCAL-TINY:         Offset            Info             Type                    Symbol's Value   Symbol's Name + Addend
+# LOCAL-TINY-NEXT:    0000000000020320  0000000000000411 R_AARCH64_AUTH_RELATIVE 10260
+# LOCAL-TINY-NEXT:    0000000000020328  0000000000000411 R_AARCH64_AUTH_RELATIVE 10260
+
+# EXTERNAL-TINY:      Hex dump of section '.got':
+# EXTERNAL-TINY-NEXT: 0x00020380 00000000 00000080 00000000 000000a0
+#                                               ^^
+#                                               0b10000000 bit 63 address diversity = true, bits 61..60 key = IA
+#                                                                 ^^
+#                                                                 0b10100000 bit 63 address diversity = true, bits 61..60 key = DA
----------------
ilovepi wrote:

A thanks for the explanation. I think I made a similar comment in one of the other PRs before I saw this. Feel free to ignore that/mark it resolved.

https://github.com/llvm/llvm-project/pull/113816


More information about the llvm-branch-commits mailing list