[PATCH] D71101: [lld][RISCV] Use an e_flags of 0 if there are only binary input files.
James Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 18:35:18 PST 2019
jrtc27 added inline comments.
================
Comment at: lld/ELF/Arch/RISCV.cpp:109
uint32_t RISCV::calcEFlags() const {
- assert(!objectFiles.empty());
+ if (objectFiles.empty())
+ return 0;
----------------
MaskRay wrote:
> For reasonable change that applies to other targets as well, we should try making them generic.
There are only 6 architectures that override calcEFlags to be non-zero:
AMDGPU: Also has the same assert
ARM: Conditioned solely on config
Hexagon: Also has the same assert
Mips: Defaults to 0 if the list is empty
PPC64: Hard-coded to 2 (for the ABI version), but checks any input if present (allowed to be empty)
RISC-V: This
calcEFlags is already very target-specific and inconsistent, so I don't know how you intend to make this generic?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71101/new/
https://reviews.llvm.org/D71101
More information about the llvm-commits
mailing list