[PATCH] D138221: [HIP] Fix lld failure when devie object is empty
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 21 13:19:59 PST 2022
MaskRay added a comment.
In D138221#3941173 <https://reviews.llvm.org/D138221#3941173>, @yaxunl wrote:
> In D138221#3939384 <https://reviews.llvm.org/D138221#3939384>, @MaskRay wrote:
>
>>> Some host relocatable objects may not contain device relocatable objects, where an empty file is passed to lld, which causes lld to fail.
>>
>> How is an empty file (size=0) passed to lld? If a dummy relocatable object file is parsed to lld, lld can infer the machine type from `e_machine` in the ELF header.
>> How does it work in other cases? Because a non-empty relocatable object file is used?
>>
>> I do not object to a new emulation which does not exist in GNU ld, but the description needs to be clarified.
>
> Updated description. The empty file is generated by clang-offload-bundler, which does not know how to create a dummy relocatable object file for a device target.
A size=0 file is handled like a linker script, not a relocatable object file. The linker script will be ignored.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138221/new/
https://reviews.llvm.org/D138221
More information about the cfe-commits
mailing list