Skip to contentSkip to conversation

ELF load command alignment not page-aligned

Qemu-devel Niccolò Belli 5 participants 7 messages Sep 16, 2019 – Sep 17, 2019

lore
Share & tools
lore
#0 lore raw

Hi,
I'm trying to use qemu-user-static to chroot into a foreign amd64 environment from my ppc64le host.
The host has a 64k page size, while x86_64 uses 4k.
I get those errors while loading shared libraries: "ELF load command alignment not page-aligned"
Is there any way to fix this? I cannot simply switch to 4k page size because my btrfs filesystem won't mount anymore (it requires the sectorsize to be equal to the page size).

Bests,
Niccolo'

#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 12 lines · Philippe Mathieu-Daudé

Cc'ing PPC folks and Laurent.

Quoted 9 lines · Niccolò Belli

Hi,
I'm trying to use qemu-user-static to chroot into a foreign amd64 environment from my ppc64le host.
The host has a 64k page size, while x86_64 uses 4k.
I get those errors while loading shared libraries: "ELF load command alignment not page-aligned"
Is there any way to fix this? I cannot simply switch to 4k page size because my btrfs filesystem won't mount anymore (it requires the sectorsize to be equal to the page size).

Which version of qemu do you use?

Last time I tested that on my PoweMac G5 (ppc64, qemu-4.0), it worked.

Thanks,
Laurent

#1 lore raw
In reply to Niccolò Belli

Cc'ing PPC folks and Laurent.

Quoted 13 lines · Niccolò Belli

Hi,
I'm trying to use qemu-user-static to chroot into a foreign amd64 environment from my ppc64le host.
The host has a 64k page size, while x86_64 uses 4k.
I get those errors while loading shared libraries: "ELF load command alignment not page-aligned"
Is there any way to fix this? I cannot simply switch to 4k page size because my btrfs filesystem won't mount anymore (it requires the sectorsize to be equal to the page size).

Bests,
Niccolo'

#3 lore raw
In reply to Laurent Vivier

Il 2019-09-17 12:40 Laurent Vivier ha scritto:

Quoted 3 lines

Which version of qemu do you use?

Last time I tested that on my PoweMac G5 (ppc64, qemu-4.0), it worked.

I'm using 4.1, but I also tried 3.1.1.

I can get some binaries to work, but lots of them won't.

Even debootstrapping a Debian system proves to be an issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=940183

So far I've managed to debootstrap only a "minbase" stretch.
If I chroot and try to install something like qt5-default it won't work anymore.

Thanks,
Niccolo'

#4 lore raw
Quoted 7 lines · Niccolò Belli

Il 2019-09-17 12:40 Laurent Vivier ha scritto:

Quoted 3 lines

Which version of qemu do you use?

Last time I tested that on my PoweMac G5 (ppc64, qemu-4.0), it worked.

I'm using 4.1, but I also tried 3.1.1.

Quoted 8 lines

I can get some binaries to work, but lots of them won't.

Even debootstrapping a Debian system proves to be an issue:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=940183

So far I've managed to debootstrap only a "minbase" stretch. If I chroot and try to install something like qt5-default it won't work anymore.

My test is to debootstrap a minbase stretch and then to run LTP inside the chroot. It's why I didn't see the problem.

I'm going to have a look to the bugreport, but I'm not sure it could be fixed.

Thanks,
Laurent

#5 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 13 lines · Philippe Mathieu-Daudé

Cc'ing PPC folks and Laurent.

Quoted 9 lines · Niccolò Belli

Hi,
I'm trying to use qemu-user-static to chroot into a foreign amd64 environment from my ppc64le host.
The host has a 64k page size, while x86_64 uses 4k.
I get those errors while loading shared libraries: "ELF load command alignment not page-aligned"
Is there any way to fix this? I cannot simply switch to 4k page size because my btrfs filesystem won't mount anymore (it requires the sectorsize to be equal to the page size).

I vaguely recall that the answer is that we don't really support running a linux-user guest which has a smaller page size than the host. There are some sort-of-hacks in the code, so some simple cases might more-or-less work, but I'm not very surprised that you've run into something that doesn't work.

Cc ing Richard who probably has a more accurate answer.

thanks
-- PMM

#6 lore raw
Quoted 15 lines · Peter Maydell
Quoted 13 lines · Philippe Mathieu-Daudé

Cc'ing PPC folks and Laurent.

Quoted 9 lines · Niccolò Belli

Hi,
I'm trying to use qemu-user-static to chroot into a foreign amd64 environment from my ppc64le host.
The host has a 64k page size, while x86_64 uses 4k.
I get those errors while loading shared libraries: "ELF load command alignment not page-aligned"
Is there any way to fix this? I cannot simply switch to 4k page size because my btrfs filesystem won't mount anymore (it requires the sectorsize to be equal to the page size).

Quoted 8 lines

I vaguely recall that the answer is that we don't really support running a linux-user guest which has a smaller page size than the host. There are some sort-of-hacks in the code, so some simple cases might more-or-less work, but I'm not very surprised that you've run into something that doesn't work.

Cc ing Richard who probably has a more accurate answer.

You are correct that this combination will not work.

This combination is exactly why I've proposed enabling softmmu for linux-user.
With that, arbitrary mappings can be made between host and guest. But it's a
fair amount of effort, which no one has yet found time for.

r~