-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
[lld] After 46453119335, internal linker error: wrote incorrect addend value 0x74C08500 instead of 0x0 for dynamic relocation R_386_32 at offset 0x4016C7 against symbol __gxx_personality_v0 #59381
Comments
@llvm/issue-subscribers-lld-elf |
@MaskRay might lld be running into some sort of wrapping or overflow issue? I have seen a few other port failures with clang & lld 15 on i386 due to this type of error, so it could also be a problem in the object files emitted by clang 15. |
FWIW adding |
A minimal reproduce is: echo 'void bar(); int main() { try { bar(); } catch (...) {} }' > a.cc
echo 'void bar() {}' > b.cc
clang++ -m32 -fno-pic -no-pie -fuse-ld=lld -z notext a.cc b.cc Compared with GNU ld, lld prefers to use more text relocations than canonical PLT/copy relocations. I think we should just find a way to ignore |
Hmm that's a good one. I don't really know why the port added |
Ah yes, the
I'm unsure whether just blindly slapping |
Ah, and those errors seem to be caused by the symbols having 'protected' visibility:
It seems to be on purpose: https://github.com/kcat/openal-soft/blob/master/CMakeLists.txt#L338, but I'm not sure why the openal-soft library wants this particular visibility. |
We added a lot of |
Well, in this particular case the libopenal CMake stuff explicitly wants to enable protected visibility (for reasons unknown), and that apparently doesn't work with lld, at least on i386? I am unsure as to why it would be necessary to preempt the symbol, if the goal is simply to link the |
The protected visibility stuff has a history with lld: see #30308, #30842, or even #26954 which is pretty old... The gist of those bugs was mostly that BFD ld seem to ignore the protected visibility in these cases, while lld complains and stops. Note that lld still does that, but only for i386, not x86_64! The workarounds are to link the executable with |
I have changed latest GNU ld aarch64/x86 to disallow copy relocation/canonical PLT on protected symbol.
Because of the overly strict
If |
Perhaps we should use |
As reported in https://pkg-status.freebsd.org/gohan05/data/maini386PR265425-default/2022-12-06_12h24m32s/logs/errors/openal-soft-1.21.1_3.log, linking openal-soft's
sofa-info
andmakemhr
tools while targeting i386-freebsd results in errors of the form:Bisecting shows that this starts appearing after 4645311 ("[ELF] --emit-relocs: adjust offsets of .rel[a].eh_frame relocations").
Reproduction tarball: openal-soft-repro.tar.gz
The text was updated successfully, but these errors were encountered: