Skip to content

[lld][ELF] lld doesn't check RISC-V e_flags for ET_DYN inputs #143023

Open
@mysterymath

Description

@mysterymath

RISC-V linkers check e_flags for ABI compatibility between input files. LLD seems to do this only for ET_REL (.o) files. GNU (BFD) ld also checks ET_DYN (.so) files.

This led to an issue in Fuchsia WRT llvm-ifs. (See the corresponding Fuchsia issue for details.)

This reproducer succeeds on LLD, but it produces the following on GNU LD:

% ./prebuilt/third_party/gcc/linux-x64/bin/riscv64-elf-ld.bfd -o foo foo.o libbar.so
./prebuilt/third_party/gcc/linux-x64/bin/riscv64-elf-ld.bfd: libbar.so: can't link soft-float modules with double-float modules
./prebuilt/third_party/gcc/linux-x64/bin/riscv64-elf-ld.bfd: failed to merge target specific data of file libbar.so

Originally filed by @frobtech downstream; adding for context/discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions