[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
Wed Jul 2 09:21:57 PDT 2025
================
@@ -552,8 +599,31 @@ template <class ELFT> void ObjFile<ELFT>::parse(bool ignoreComdats) {
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 gnuProperty;
+ bool hasAArch64BuildAttributes = false;
+ bool hasGNUProperties = false;
+
for (size_t i = 0; i != size; ++i) {
const Elf_Shdr &sec = objSections[i];
+ // Object files that use processor features such as Intel Control-Flow
----------------
smithp35 wrote:
I think we can shorten the comment here and the one below GNU properties. I think the most important think to get across is that we just read the raw data into an intermediate form and process it later. GNU properties are quite well known so we don't need to go into details of what might use them here. The bitmap part is only true for AndFeatures so we're arguably being too specific here anyway.
I suggest something like:
"Read GNU property section into a per-InputFile structure that will be merged at a later stage. A synthetic section will be created for the merged contents."
We can then drop the second content as it is obvious that we can drop the section.
This part becomes
```
// Read GNU property section into a per-InputFile structure that will be merged at a later stage.
// A synthetic section will be created for the merged contents.
for (size_t i = 0; i != size; ++i) {
const Elf_Shdr &sec = objSections[i];
if (check(obj.getSectionName(sec, shstrtab)) == ".note.gnu.property") {
gnuProperty = readGnuProperty(
ctx,
InputSection(*this, sec, check(obj.getSectionName(sec, shstrtab))),
*this);
hasGNUProperties = true;
sections[i] = &InputSection::discarded;
}
```
https://github.com/llvm/llvm-project/pull/144082
More information about the llvm-commits
mailing list