https://bugs.llvm.org/show_bug.cgi?id=47240
Bug ID: 47240
Summary: Static PIE executables segfault on initialization
Product: lld
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
When building a static PIE executable using LLD, the executable segfaults
before invoking main(). Using a debugger, I've traced the error back to the
glibc function apply_irel() in csu/libc_start.c. The same executable built
using ld.bfd works fine. A difference I've noticed between the two executables,
is that ld.bfd places ifunc relocations in a .rela.plt section, while ld.lld
places them in in the .rela.dyn section.
Even an empty program (int main(int argc, char** argv){}) gives these results,
so it seems to have nothing to do with the particulars of the software I was
compiling. The same results happen when using ld.lld as the linker for GCC.
I've tested it on Debian testing and Ubuntu 20.04 (tried LLD 10.0.1, 11.0.0,
and 12.0.0 on both) and Arch Linux (LLD 10.0.1). I've only tried x86_64,
because I don't have access to other hardware.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs