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 /llvm/unittests/Support/TargetParserTest.cpp | |
| parent | 5ba5aefad6e73ea02d3dd2feb18a709c20027efe (diff) | |
| download | llvm-8a900f2438b4a167b98404565ad4da2645cc9330.zip llvm-8a900f2438b4a167b98404565ad4da2645cc9330.tar.gz llvm-8a900f2438b4a167b98404565ad4da2645cc9330.tar.bz2 | |
[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 'llvm/unittests/Support/TargetParserTest.cpp')
0 files changed, 0 insertions, 0 deletions
