[PATCH] D138550: [ELF] Combine .riscv.attributes

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 01:06:51 PST 2022


MaskRay created this revision.
Herald added subscribers: sunshaoce, VincentWu, ormris, StephenFan, vkmr, frasercrmck, jdoerfert, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, steven_wu, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson, emaste.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD.
Herald added a project: LLVM.

Alternative to D136344 <https://reviews.llvm.org/D136344>

Currently we take the first .riscv.attributes as the output. 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

Like GNU ld, zero value integer attributes and empty string attributes are not
dumped to the output .riscv.attributes. For an unknown attribute, we retain it
if all input sections with the attribute agree on the value. Like GNU ld, there
is no error.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138550

Files:
  lld/ELF/Arch/RISCV.cpp
  lld/ELF/Driver.cpp
  lld/ELF/InputFiles.cpp
  lld/ELF/SyntheticSections.cpp
  lld/ELF/SyntheticSections.h
  lld/ELF/Target.h
  lld/test/ELF/lto/riscv-attributes.ll
  lld/test/ELF/riscv-attributes.s
  llvm/include/llvm/Support/RISCVISAInfo.h
  llvm/lib/Support/RISCVISAInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138550.477410.patch
Type: text/x-patch
Size: 18793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221123/1804543c/attachment.bin>


More information about the llvm-commits mailing list