Support for musl libc under Linux#528
Merged
Merged
Conversation
Notably, this allows loading shared libraries on Linux systems using musl libc, which uses displacements for DT_STRTAB. The old logic based on negative displacements was nonsense because the dynamic string table can't possibly come before the base address, so effectively, we always assumed an absolute address under non-Android Linux. The new logic should be mostly free of false positives, but since it's still guesswork, we only use it when absolutely necessary. Technically, the code for FreeBSD/Solaris/Android also changes here because the displacement is no longer signed, but as explained above, displacements should never be negative.
- Don't use the glibc-specific struct _libc_xmmreg - Dummy out gnu_get_libc_version() if unavailable - Remove unused fpu_control.h include - Correct a typo in _LARGEFILE64_SOURCE (did nothing ever rely on lseek64?) - Guard the glibc-specific mcheck.h behind __GLIBC__
Member
|
Thank you for your patch. I am not worried about the mcheck stuff; as you note, it's for unusual debugging situations only anyway. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hope the commit messages explain the exact changes well enough.
I'm not super happy with the solution for
mcheck.h, but as I understand it,start-mtraceandstop-mtraceare intended to be called manually for debugging purposes anyway, so it's not a big deal if the functions exist but fail.