[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/23856] New: Executables linked with gold against musl segfault
mail at nh2 dot me
[Bug gold/23856] New: Executables linked with gold against musl segfault at startup
Sun, 04 Nov 2018 11:53:55 +0000
Bug ID: 23856
Summary: Executables linked with gold against musl segfault at
Assignee: ccoutant at gmail dot com
Reporter: mail at nh2 dot me
CC: ian at airs dot com
Target Milestone: ---
we're trying to link (dynamically) some executables against musl with gold.
When we link with GNU ld, everything works fine, but with gold the executables
segfault at startup.
GNU gold (GNU Binutils 2.30) 1.15
We strongly suspect that it is the issue described in here:
The problem is that gold does not know how to process relocations for
undefined weak references correctly. When the code in question is
PIC/PIE, the weak reference can be kept for resolving at runtime.
804846f: b8 70 83 04 08 mov $0x8048370,%eax
where the linker filled in a fixed address (the PLT slot) which the
code happily sees is non-zero and then calls it, PIC code would read
the address from the GOT. In non-PIC code, the linker (ld) *MUST*
resolve undefined weak references to the address zero; they are not
overridable at runtime because non-PIC doesn't support that.
This is a bug in gold, but I have no idea how it works at all, even
with glibc. The same issue should arise in gcc's crt files.
You can probably work around it for now by building the app as PIE.
Here the musl author suggests that it's a bug in gold, but from what I can
tell, an issue was never filed, so I'm taking on that task now.
What is your take on this issue?
Is this something that you think gold should support, or is this a feature
intentionally left out (or maybe something else is at play)?
Thanks a lot!
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/23856] New: Executables linked with gold against musl segfault at startup,
mail at nh2 dot me <=