-
Notifications
You must be signed in to change notification settings - Fork 182
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
investigate ELFHack #157
Comments
llvm-project has been using
RELR can optimize
On a Linux desktop, this needs interest in glibc and musl. They haven't expressed interest. (I have a musl patch in 2019 but it cannot be accepted because it is not accepted ABI. However, ELF as an ABI has stopped evolving.) Realized that I sent https://sourceware.org/pipermail/binutils/2020-May/111086.html which got no response in binutils. Just sent a GNU ld feature request https://sourceware.org/bugzilla/show_bug.cgi?id=27923 and a glibc ld.so feature request https://sourceware.org/bugzilla/show_bug.cgi?id=27924 |
glibc ld.so's x86-64 port doesn't support REL. ld.so will not apply dynamic relocations in a clang built with With appropriate abstractions, supporting both REL and RELA should take relatively small efforts, e.g. ld.lld has proper abstraction so supporting |
ah, so then ELFHack is not converting RELA relocation types to REL, since glibc's dynamic linker would not process those relocation types? I guess clang could try to relocate itself; then it wouldn't be constrained to relocation types of the host's dynamic linker? I guess that would entail a non-standard PT_INTERP since you'd need to do that before the dynamic linker is run? (or maybe it doesn't matter?) |
I don't think you'd need a custom PT_INTERP. I think an executable could relocate itself by adding an entry at the start of You would also need to make sure that any GOT entries required by the self-relocator (e.g. So if you wanted to do this I think it would require some kind of custom linker extension. |
via https://glandium.org/blog/?p=1177 (@glandium).
I was thinking we might be able to use RELR
https://reviews.llvm.org/D48247
https://groups.google.com/g/generic-abi/c/bX460iggiKg
but @pcc had to implement relocation processing support in the Linux kernel for aarch64 to support this relocation type.
https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/
So I doubt any existing dynamic linker could process these for x86-64 quite yet.
I'm not sure how much of this might be irrelevant though with #150 or with @MaskRay 's work on enabling
-fno-semantic-interposition
in Clang's Cmake itself.https://reviews.llvm.org/D102453
I don't know if ELFhack is easy to fetch/use outside of mozilla-central.
The text was updated successfully, but these errors were encountered: