Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD doesn't like rearranged program headers #153

Closed
staticfloat opened this issue Jul 11, 2018 · 8 comments
Closed

FreeBSD doesn't like rearranged program headers #153

staticfloat opened this issue Jul 11, 2018 · 8 comments

Comments

@staticfloat
Copy link

staticfloat commented Jul 11, 2018

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).

@ararslan
Copy link

I've submitted a companion bug report to FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229708

@domenkozar
Copy link
Member

Could you try with 0.11 / master?

@ararslan
Copy link

ararslan commented 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
Copy link

any idea on how we might be able to verify whether this has been fixed?

Apparently running patchelf on libLLVM.so also shows the problem.

@Mic92
Copy link
Member

Mic92 commented Oct 26, 2021

any idea on how we might be able to verify whether this has been fixed?

Apparently running patchelf on libLLVM.so also shows the problem.

Do you mean patching libLLVM.so with patchelf on freebsd?

@vchuravy
Copy link

@ararslan
Copy link

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
Copy link

Note though that the problem remains for current FreeBSD versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants