diff options
author | Fangrui Song <i@maskray.me> | 2022-12-08 09:53:40 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-08 09:53:40 +0000 |
commit | 8a900f2438b4a167b98404565ad4da2645cc9330 (patch) | |
tree | f474cc8cc99a995ec9e11ec7408e054fac9f67d7 /lld/docs | |
parent | 5ba5aefad6e73ea02d3dd2feb18a709c20027efe (diff) | |
download | llvm-8a900f2438b4a167b98404565ad4da2645cc9330.tar.gz |
[ELF] Merge SHT_RISCV_ATTRIBUTES sections
Currently we take the first SHT_RISCV_ATTRIBUTES (.riscv.attributes) as the
output. If we link an object without an extension with an object with the
extension, the output Tag_RISCV_arch may not contain the extension and some
tools like objdump -d will not decode the related instructions.
This patch implements
Tag_RISCV_stack_align/Tag_RISCV_arch/Tag_RISCV_unaligned_access merge as
specified by
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#attributes
For the deprecated Tag_RISCV_priv_spec{,_minor,_revision}, dump the attribute to
the output iff all input agree on the value. This is different from GNU ld but
our simple approach should be ok for deprecated tags.
`RISCVAttributeParser::handler` currently warns about unknown tags. This
behavior is retained. In GNU ld arm, tags >= 64 (mod 128) are ignored with a
warning. If RISC-V ever wants to do something similar
(https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/352), consider
documenting it in the psABI and changing RISCVAttributeParser.
Like GNU ld, zero value integer attributes and empty string attributes are not
dumped to the output.
Reviewed By: asb, kito-cheng
Differential Revision: https://reviews.llvm.org/D138550
Diffstat (limited to 'lld/docs')
-rw-r--r-- | lld/docs/ReleaseNotes.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst index cf52fd322286..c350aa9e714c 100644 --- a/lld/docs/ReleaseNotes.rst +++ b/lld/docs/ReleaseNotes.rst @@ -39,6 +39,9 @@ ELF Improvements * ``--no-undefined-version`` is now the default; symbols named in version scripts that have no matching symbol in the output will be reported. Use ``--undefined-version`` to revert to the old behavior. +* The output ``SHT_RISCV_ATTRIBUTES`` section now merges all input components + instead of picking the first input component. + (`D138550 <https://reviews.llvm.org/D138550>`_) Breaking changes ---------------- |