You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FreeBSD doesn't like rearranged program headers #153
FreeBSD has decided that the program header of ELF files must fit within the first page. This is a bit of a problem, as patchelf often relocates the program header to the end of the ELF header, causing it to no longer fit within the first page. I'm not sure the best way to fix this, but I thought I would open an issue so others that run into the program header too large issue that FreeBSD often spits out can gather here to discuss possible solutions (other than rewriting the FreeBSD dynamic loader, of course).
Reacted by Alex Arslan, Will Dietz, Iblis Lin and probonopd
Reproducing this 2 years later will be a bit tricky, as much has changed... The problematic binaries used originally are from the FreeBSD release asset from v1.0.1 of https://github.com/bicycle1885/XML2Builder. The infrastructure used to cross compile binaries has evolved, and the resulting libxml2 no longer exhibits this problem. @staticfloat, any idea on how we might be able to verify whether this has been fixed?
I have no experience with the binary in question but trying to run a particular AppImage on Linuxulator also gave me the "Program headers not in the first page" error. This check is still in /usr/src/sys/kern/imgact_elf.c:1130 as of 14.2-RELEASE.
Activity
ararslan commentedon Jul 11, 2018
I've submitted a companion bug report to FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229708
domenkozar commentedon Jun 9, 2020
Could you try with 0.11 / master?
ararslan commentedon Jun 9, 2020
Reproducing this 2 years later will be a bit tricky, as much has changed... The problematic binaries used originally are from the FreeBSD release asset from v1.0.1 of https://github.com/bicycle1885/XML2Builder. The infrastructure used to cross compile binaries has evolved, and the resulting libxml2 no longer exhibits this problem. @staticfloat, any idea on how we might be able to verify whether this has been fixed?
vchuravy commentedon Oct 25, 2021
Apparently running
patchelfon libLLVM.so also shows the problem.Mic92 commentedon Oct 26, 2021
Do you mean patching
libLLVM.sowith patchelf on freebsd?vchuravy commentedon Oct 26, 2021
Yeah:
On the libLLVM from https://github.com/JuliaBinaryWrappers/libLLVM_jll.jl/releases/download/libLLVM-v13.0.0%2B0/libLLVM.v13.0.0.x86_64-unknown-freebsd.tar.gz
ararslan commentedon Oct 26, 2021
FYI this has apparently been fixed upstream in FreeBSD and backported to multiple active release branches. See the bug report I opened a while back: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229708. Based on the timing, I imagine it will be in FreeBSD 12.3.
ararslan commentedon Oct 29, 2021
Note though that the problem remains for current FreeBSD versions.
rhaberkorn commentedon Feb 25, 2025
I have no experience with the binary in question but trying to run a particular AppImage on Linuxulator also gave me the "Program headers not in the first page" error. This check is still in /usr/src/sys/kern/imgact_elf.c:1130 as of 14.2-RELEASE.