[PATCH] D86309: [ELF] Handle SHT_RISCV_ATTRIBUTES similarly to SHT_ARM_ATTRIBUTES

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 10:35:47 PDT 2020


jrtc27 created this revision.
jrtc27 added reviewers: MaskRay, HsiangKai.
Herald added subscribers: llvm-commits, danielkiss, evandro, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, lenary, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, kristof.beyls, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
jrtc27 requested review of this revision.

Currently we treat SHT_RISCV_ATTRIBUTES like a normal section and
concatenate all such input sections, yielding invalid output unless only
a single attributes section is present in the input. Instead, pick the
first as with SHT_ARM_ATTRIBUTES. We do not currently need to condition
our behaviour on the contents, unlike Arm. In future, we should both do
stricter validation of the input and merge all sections together to
ensure we have, for example, the full arch string requirement, but this
rudimentary implementation is good enough for most common cases.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86309

Files:
  lld/ELF/InputFiles.cpp
  lld/ELF/SyntheticSections.h
  lld/test/ELF/riscv-attributes.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86309.286856.patch
Type: text/x-patch
Size: 4992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200820/34635172/attachment.bin>


More information about the llvm-commits mailing list