On 17.04.2024 17:05, Ross Lagerwall wrote: > On Wed, Apr 17, 2024 at 3:15 PM Jan Beulich <jbeul...@suse.com> wrote: >> >> On 10.04.2024 11:41, Ross Lagerwall wrote: >>> On Mon, Apr 8, 2024 at 11:25 AM Jan Beulich <jbeul...@suse.com> wrote: >>>> On 28.03.2024 16:11, Ross Lagerwall wrote: >>>>> * The image base address is set to 0 since it must necessarily be below >>>>> 4 GiB and the loader will relocate it anyway. >>>> >>>> While technically okay, what is the reason for this adjustment? >>> >>> The multiboot2 spec generally uses 32 bit addresses for everything and >>> says: >>> >>> "The bootloader must not load any part of the kernel, the modules, the >>> Multiboot2 information structure, etc. higher than 4 GiB - 1." >>> >>> An image base address above 4 GiB causes trouble because multiboot2 >>> wasn't designed for this. >> >> Yet mb2 doesn't care about that PE header field at all, does it? In which >> case my question remains: What purpose does this particular modification >> of the image have? >> > > With the currently published version of mb2, it doesn't look at the PE > header field since it has no knowledge about PE binaries. > > With the proposal on the grub-devel list [1], mb2 would use the PE > header to load the new xen-mbi binary in which case, the image base > address is indeed relevant.
But then how can you strip .reloc? If the image base field is to be used, and if the image can't be placed there, relocation needs to happen. (As an aside, [1] looks to be talking of the entry point only, not the image base?) Jan > [1] https://lists.gnu.org/archive/html/grub-devel/2024-03/msg00081.html