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

Re: xen.efi has MEM_DISCARDABLE flag in Characteristics field of .reloc section



Hello Demi Marie, Jan, Nick, all,

Thank you Demi Marie for bringing this topic on the mailing list.

I discussed it a bit with Jan on Matrix but the situation is not pretty, 
there is no clean solution that stands out easily.

As Jan said, it seems .reloc is meant to be discardable, so we can't 
blame binutils LD for putting it:

https://github.com/bminor/binutils-gdb/commit/25c80428af3311e761c87d8f706596b9701602ec#diff-078cf751467928c038996b40073a682425712b9b01182424e68cf18fb08a75b5R953-R977

And we can't obviously blame the loaders for honoring this flag.

Most reasonable solution indeed would be to ask binutils to add a link 
flag to say "please do not put the DISCARDABLE flag on the .reloc section"

I'm adding Nick Clifton from binutils in CC so that he can comment on 
this possible outcome or any other possible solution.

In the mean time, while waiting for a solution to emerge (and be merged, 
and released) what do we do?

Do we put some hack in Xen build Makefiles so that xen.efi is 
post-processed to strip this bit?

This could be the temporary solution.

Regards,

Yann

On 7/17/25 08:04, Jan Beulich wrote:
> On 17.07.2025 05:11, Demi Marie Obenour wrote:
>> This was discovered by GitHub user @fallen and leads
>> to an "Unsupported relocation type" crash during boot
>> because shim and some patched versions of GRUB do not load
>> the section.  See
>> https://github.com/QubesOS/qubes-issues/issues/8206#issuecomment-3078795967
>> for more details.
>>
>> I'm not sure if this is a bug in Xen or a bug in the linker.
> As said on Matrix, my take is that - if at all - the linker could do something
> about it only with a to-be-added command line option. For all "normal" 
> purposes
> .reloc being discardable is what is wanted. Since such a command line option
> would be extremely niche, I think this will need taking care of on the Xen 
> side
> (which, however, is unlikely to end up very pretty).
>
> Jan
>


Yann Sionneau | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.