Skip to content

Commit f5cf51c

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 f5cf51c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lld/ELF/InputFiles.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,14 @@ 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)
572+
// of (0, 1) maps to an explicit PAuth property of platform = 0, version =
573+
// 0 ('Invalid').
574+
if (baInfo.Pauth.TagPlatform == 0 && baInfo.Pauth.TagSchema == 1) {
575+
file->aarch64PauthAbiCoreInfo = {0, 0};
576+
}
569577
file->aarch64PauthAbiCoreInfo = {baInfo.Pauth.TagPlatform,
570578
baInfo.Pauth.TagSchema};
571579
}

0 commit comments

Comments
 (0)