[lld] [llvm] [lld][AArch64][Build Attributes] Add support for converting AArch64 Build Attributes to GNU Properties (PR #131990)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 11 10:23:25 PDT 2025
================
@@ -547,15 +749,44 @@ template <class ELFT> void ObjFile<ELFT>::parse(bool ignoreComdats) {
initializeSymbols(obj);
return;
}
-
// Handle dependent libraries and selection of section groups as these are not
// done in parallel.
ArrayRef<Elf_Shdr> objSections = getELFShdrs<ELFT>();
StringRef shstrtab = CHECK2(obj.getSectionStringTable(objSections), this);
uint64_t size = objSections.size();
sections.resize(size);
+
+ // For handling AArch64 Build attributes and GNU properties
+ AArch64BuildAttrSubsections aarch64BAsubSections;
+ gnuPropertiesInfo gnuPropertiesInformation;
+ bool hasAArch64BuildAttributes = false;
+ bool hasGNUProperties = false;
+
for (size_t i = 0; i != size; ++i) {
const Elf_Shdr &sec = objSections[i];
+
----------------
smithp35 wrote:
It looks like BuildAttributes are read in parse() but gnu properties are read in as part of initializeSections.
As neither GNU properties or BuildAttributes rely on symbol information then it should be possible to read them here, move the BuildAttributes reading to initializeSections or delay the merging of BuildAttributes and GNU properties to after initializeSections.
If reading GNU properties is moved here, remember to remove them from createInputSection or they will get processed twice.
https://github.com/llvm/llvm-project/pull/131990/files#diff-1a6e8fdd6339ca831ba81ed9fb4f94c42419f91d67c9e16322b71a3e011b42d2R1234
https://github.com/llvm/llvm-project/pull/131990
More information about the llvm-commits
mailing list