[lld] [ELF][AArch64] Do not treat missing build attributes as defined (PR #213600)
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 3 12:03:51 PDT 2026
igorkudrin wrote:
In our downstream toolchain, we need to attach some additional properties to relocatable files, and private subsections work well for that. When compiling an assembly file, there is a command-line option `-aarch64-mark-bti-property` to emit a corresponding GNU Property, but it does not add a build attribute. When 'lld' processes such a file, it overrides the correct and expected value read from the GNU Properties section with the default '0', https://github.com/llvm/llvm-project/blob/4296c142ee473b640fac9c8f0af0012e8496d039/lld/ELF/InputFiles.cpp#L567. This does not seem like correct behavior of the linker; thus the fix.
The issue can be fixed in several ways, including improving the assembler to keep the properties in sync, or asking users to update source files and build instructions. Still, the absence of a build attribute when the corresponding GNU Property is present does not make the object file malformed, so the linker should handle it.
https://github.com/llvm/llvm-project/pull/213600
More information about the llvm-commits
mailing list