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

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 04:07:36 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) {
----------------
sivan-shani wrote:

Assigning `GnuPropertiesInfo`:
```
gnuProperty = readGnuProperty(
    ctx,
    InputSection(*this, sec, check(obj.getSectionName(sec, shstrtab))),
    *this);
```
It requires `sec`, `obj` which in turn is:
```
const Elf_Shdr &sec = objSections[i];
...
object::ELFFile<ELFT> obj = this->getObj();
```
And objSections are:
```
ArrayRef<Elf_Shdr> objSections = getELFShdrs<ELFT>();
```
Therefore Assigning `GnuPropertiesInfo` inside the function will require to duplicate some code and to pass `i`

Is that better then the current code?

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


More information about the llvm-commits mailing list