aboutsummaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorPaul Kirth <paulkirth@google.com>2024-07-02 08:23:03 -0700
committerGitHub <noreply@github.com>2024-07-02 08:23:03 -0700
commitb146a57f6739846f7749daad099882fbd33e3066 (patch)
treec9b058d4a3459735149ebafc0bdd35a11e843ff1 /lld
parentcfbad45339edb4a512982d9180e6fd4bae781d8a (diff)
downloadllvm-b146a57f6739846f7749daad099882fbd33e3066.zip
llvm-b146a57f6739846f7749daad099882fbd33e3066.tar.gz
llvm-b146a57f6739846f7749daad099882fbd33e3066.tar.bz2
Reapply "[RISCV] Support RISCV Atomics ABI attributes (#84597)"
This patch adds support for the atomic_abi attribute, specifid in https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#tag_riscv_atomic_abi-14-uleb128version. This was previously reverted due to ld.bfd segfaulting w/ unknown riscv attributes. Attribute emission is now guarded by a backend flag `--riscv-abi-attributes`, which is off by default. Linker support in LLD for attribute merging is now in a standalone patch. Reviewers: kito-cheng, MaskRay, asb Reviewed By: MaskRay Pull Request: https://github.com/llvm/llvm-project/pull/90266
Diffstat (limited to 'lld')
-rw-r--r--lld/ELF/Arch/RISCV.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/ELF/Arch/RISCV.cpp b/lld/ELF/Arch/RISCV.cpp
index e4d6325..281567e 100644
--- a/lld/ELF/Arch/RISCV.cpp
+++ b/lld/ELF/Arch/RISCV.cpp
@@ -1134,6 +1134,10 @@ mergeAttributesSection(const SmallVector<InputSectionBase *, 0> &sections) {
case RISCVAttrs::PRIV_SPEC_MINOR:
case RISCVAttrs::PRIV_SPEC_REVISION:
break;
+
+ case RISCVAttrs::AttrType::ATOMIC_ABI:
+ // TODO: Handle ATOMIC_ABI tag merging
+ continue;
}
// Fallback for deprecated priv_spec* and other unknown attributes: retain