riscv64:ld: option --oformat pei-riscv64-little raises segmentation fault (SIGSEGV)

Johannes Krottmayer krotti83@proton.me
Tue Feb 17 10:03:21 GMT 2026


Hello Jan!

On 2/17/26 10:44 AM, Jan Beulich wrote:
> On 17.02.2026 10:25, Johannes Krottmayer wrote:
>> On 2/16/26 9:02 AM, Jan Beulich wrote:
>>> On 16.02.2026 08:50, Johannes Krottmayer wrote:
>>>> I have tried to create a PE image for an EFI environment targeting
>>>> RISCV64. But when I try to pass the option --oformat pei-riscv64-little
>>>> to LD, LD crashes with a segmentation fault.
>>>
>>> It is my understanding that PE support for RISC-V (and also other targets,
>>> like Arm64) doesn't go as far as allowing ...
>>
>> Okay, but I think it's maybe better to disable this option in further
>> releases and don't let LD crash if another user tries the same
>> like me.
> 
> "disable this option" may sound easier than it is. I for one can't think of
> a good way to filter out such pretty special cases. Much of ld's cross-
> format linking may be limited to "known good" cases, without others getting
> explicitly rejected. Furthermore, even "assumed good" cases lik
e ELF->PE on
> x86 of course have meaningful restrictions on what the input objects may
> legitimately contain. All of this is, I fear, pretty much a grey area.

Okay, I understand.

BTW:
I asked the *issue* in the official GitHub repo for the GNU toolchains
from RISC-V first:

https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1836

I also mentioned and linked the the mailing history from this thread
in the list.

> Jan

Kind regards,

Johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: publickey - krotti83@proton.me - 0x1A5D6E0E.asc
Type: application/pgp-keys
Size: 888 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260217/ef3f12b6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 322 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20260217/ef3f12b6/attachment.sig>


More information about the Binutils mailing list