From 6e9aeb88bcf274995e952706ff20f44d24f2ab74 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Thu, 23 Apr 2026 09:25:16 +0100 Subject: [PATCH 1/2] [pauthabi64] Require 0 addend for signing of undefined weak ref When there is a non-zero addend to an undefined weak-reference then do not apply the rule the the result of the relocation is 0 regardless of the signing schema. The intent was that null-pointers could be easily tested for without worrying about signing schemas. However if there was a non-zero addend the result of the relocation, outside the pauthabi would be non-zero and hence wouldn't be a null-pointer. Clarify that the relocation addend must also be 0 for the result of the relocation to be 0, regardless of signing-schema. Raised from: https://github.com/llvm/llvm-project/issues/173296 --- pauthabielf64/pauthabielf64.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pauthabielf64/pauthabielf64.rst b/pauthabielf64/pauthabielf64.rst index 3b836b1b..609142c0 100644 --- a/pauthabielf64/pauthabielf64.rst +++ b/pauthabielf64/pauthabielf64.rst @@ -678,9 +678,10 @@ this should be sufficient. be set to 0 by a producer. A consumer must not assume that reserved bits are set to 0. -For a relocation that involves signing a pointer, if the target symbol -is an undefined weak reference, the result of the -relocation is 0 (nullptr) regardless of the signing schema. +For a relocation that involves signing a pointer, and the relocation +addend is 0, if the target symbol is an undefined weak reference, the +result of the relocation is 0 (nullptr) regardless of the signing +schema. The computation to form the ``modifier`` is the same as ARM64E_. ``Place`` is the relocation target address. From 6159ebf31b1e96356e0081326e3a0a7645b70a8d Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 24 Apr 2026 10:39:18 +0100 Subject: [PATCH 2/2] [pauthabi64] Review comments --- pauthabielf64/pauthabielf64.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pauthabielf64/pauthabielf64.rst b/pauthabielf64/pauthabielf64.rst index 609142c0..29383ff2 100644 --- a/pauthabielf64/pauthabielf64.rst +++ b/pauthabielf64/pauthabielf64.rst @@ -678,10 +678,10 @@ this should be sufficient. be set to 0 by a producer. A consumer must not assume that reserved bits are set to 0. -For a relocation that involves signing a pointer, and the relocation -addend is 0, if the target symbol is an undefined weak reference, the -result of the relocation is 0 (nullptr) regardless of the signing -schema. +For a relocation that involves signing a pointer, if the target symbol +is an undefined weak reference, the result of the relocation is not +signed. If the relocation addend is 0, this means the result of the +relocation is 0 (nullptr) regardless of the signing schema. The computation to form the ``modifier`` is the same as ARM64E_. ``Place`` is the relocation target address.