[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 17:11:24 PST 2019
jrtc27 added inline comments.
================
Comment at: lld/ELF/Arch/RISCV.cpp:119
if ((eflags & EF_RISCV_FLOAT_ABI) != (target & EF_RISCV_FLOAT_ABI))
error(toString(f) +
----------------
bsdjhb wrote:
> The BFD linker is a bit more forgiving in these flag checks to seemingly cater to mixing objects linked with '-b binary' with other objects. Specifically, it only checks for flag mismatches when an object file contains text sections (since the float ABI and RVE only matter for instructions). In FreeBSD's case the kernel is soft-float and doesn't use RVE, so a flags value of 0 for the '-b binary' case is already compatible.
It's worth noting that, just because an object file only has data, doesn't mean it's ABI-independent. For example, a jmp_buf will change size based on the floating-point ABI. Having said that, that is a rare case, and the flags are never intended to stop every way of screwing things up, but as a safety net to spot obviously-wrong things, so I think it's ok to have that accepted.
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