[lld] [llvm] [lld][AArch64][Build Attributes] Add support for AArch64 Build Attributes (PR #144082)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 05:36:02 PDT 2025


================
@@ -537,6 +538,52 @@ uint32_t ObjFile<ELFT>::getSectionIndex(const Elf_Sym &sym) const {
       this);
 }
 
+template <class ELFT>
+static void
+handleAArch64BAAndGnuProperties(ObjFile<ELFT> *file, Ctx &ctx, bool hasGP,
+                                const AArch64BuildAttrSubsections &baInfo,
+                                const GnuPropertiesInfo &gpInfo) {
----------------
smithp35 wrote:

What I meant was that in this function we have a pointer to file. On line 575 we use that pointer to assign to  https://github.com/llvm/llvm-project/pull/144082/files#diff-1a6e8fdd6339ca831ba81ed9fb4f94c42419f91d67c9e16322b71a3e011b42d2R575
```
file->aarch64PauthAbiCoreInfo = {baInfo.Pauth.TagPlatform,
                                         baInfo.Pauth.TagSchema};
```
And on line 579
```
file->andFeatures = baInfo.AndFeatures;
```
The gpInfo that is passed into this function is created from on line 1118 (https://github.com/llvm/llvm-project/pull/144082/files#diff-1a6e8fdd6339ca831ba81ed9fb4f94c42419f91d67c9e16322b71a3e011b42d2R1118) 
```
return GnuPropertiesInfo{f.andFeatures, f.aarch64PauthAbiCoreInfo};
```

It looks like we can replace all the calls to if (gpInfo. ) with if (file-> ).

I could be missing something obvious as I'm looking at the code-changes. We would need gpinfo if file->andFeatures and f->aarch64PauthABICoreInfo hadn't been written to already.


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


More information about the llvm-commits mailing list