bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/27200] Bad RiscV64 ELF header flag using ld -b binary


From: bztemail at gmail dot com
Subject: [Bug ld/27200] Bad RiscV64 ELF header flag using ld -b binary
Date: Wed, 20 Jan 2021 14:54:36 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27200

--- Comment #12 from bzt <bztemail at gmail dot com> ---
> OK, so part of the problem is for the RISC-V, if the the ELF header flags are 
> zero then this means "uses soft float", rather than "no flags have been set".

Yes, agreed. The other part being not been able to set the flag from command
line for ld -b binary.

> What should happen here ?  If font.o is treated as having the default ABI 
> flags then it will not be possible to link it with c.o.

I think that's okay and perfectly fine since you've used explicit "-mabi=lp64"
on as command line, so it wasn't compiled for the default ABI. This can work if
"ld -b binary" also accepts the same "-mabi=lp64" command line option. IMHO.

> If none of them are riscv files (ie they are binary blobs) then the default 
> ABI flags should be set instead.  Do you agree ?

Well, I meant ABI flag set on object file creation, you seem to talk about
object file load. If by "none of them are riscv files" you mean they don't have
any text sections, only data section(s), then yes, can work. If I understand
you correctly you're saying that when ld loads an object file without text
segments, then it would assume default ABI for them? I guess the proper
solution would be to only check the ABI flag if there's text section involved
(only_data_sections == FALSE).

> please could you try out the patch that I am about to upload and let me know 
> if it solves the problem for you.

Of course, I'll try it and let you know the results.

> This looks like a hack, but I don't know why currently...

Yes, agreed very hackish. One thing that concerns me is that the order of the
object files matter. But defendable, and if I can link C or "as" generated
objects with binary objects then I'm fine with it!

I'll let you know if your patch worked, keep tuned.

Cheers,
bzt

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]