[lld] [llvm] [lld][AArch64][Build Attributes] Add support for converting AArch64 Build Attributes to GNU Properties (PR #131990)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 05:45:47 PDT 2025


================
@@ -638,27 +807,76 @@ template <class ELFT> void ObjFile<ELFT>::parse(bool ignoreComdats) {
         }
       }
       break;
-    case EM_AARCH64:
-      // FIXME: BuildAttributes have been implemented in llvm, but not yet in
-      // lld. Remove the section so that it does not accumulate in the output
-      // file. When support is implemented we expect not to output a build
-      // attributes section in files of type ET_EXEC or ET_SHARED, but ld -r
-      // ouptut will need a single merged attributes section.
-      if (sec.sh_type == SHT_AARCH64_ATTRIBUTES)
+    case EM_AARCH64: {
+      // The specification states that if a file contains both GNU properties
----------------
sivan-shani wrote:

This seems to depend also on your comment below:

 >What if the input object has a GNU properties section, but it does not have both of GNU_PROPERTY_AARCH64_FEATURE_1_AND and GNU_PROPERTY_AARCH64_FEATURE_PAUTH? In that case, we still need to parse the build attribute subsections which don't have the matching GNU properties subsections.
 
 If it is indeed possible to have any of the subsections in one file but not in the other, the files will have to be read. Which is basically depends on the meaning of `The specification states that if a file contains both GNU properties and AArch64 build attributes, they can be assumed to be identical.` 

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


More information about the llvm-commits mailing list