Skip to content

Commit 9b0d862

Browse files
committed
Map (TagPlatform, TagSchema) = (0, 1) to explicit property of (0, 0)
According to the Arm BuildAttributes specification, a (TagPlatform, TagSchema) of (0, 1) corresponds to an explicit property with platform = 0 and version = 0 ('Invalid'). Update LLD to handle this case by mapping it to aarch64PauthAbiCoreInfo = {0, 0}. Update comment to clarify default behavior and mapping. Spec reference: https://github.com/ARM-software/abi-aa/pull/230/files#r1030
1 parent 59103c8 commit 9b0d862

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lld/ELF/InputFiles.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,13 @@ handleAArch64BAAndGnuProperties(ObjFile<ELFT> *file, Ctx &ctx, bool hasGP,
566566
// Unlike AArch64 Build Attributes, GNU properties does not give a way to
567567
// distinguish between no-value given to value of '0' given.
568568
if (baInfo.Pauth.TagPlatform || baInfo.Pauth.TagSchema) {
569+
// According to the BuildAttributes specification Build Attributes
570+
// default to a value of 0 when not present. A (TagPlatform, TagSchema) of
571+
// (0, 0) maps to 'no PAuth property present'. A (TagPlatform, TagSchema) of
572+
// (0, 1) maps to an explicit PAuth property of platform = 0, version = 0 ('Invalid').
573+
if (baInfo.Pauth.TagPlatform == 0 && baInfo.Pauth.TagSchema == 1) {
574+
file->aarch64PauthAbiCoreInfo = {0, 0};
575+
}
569576
file->aarch64PauthAbiCoreInfo = {baInfo.Pauth.TagPlatform,
570577
baInfo.Pauth.TagSchema};
571578
}

0 commit comments

Comments
 (0)