[Bug 228574] GNU ld doesn't emit _end when linking with lld-linked libc.so
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon May 28 21:03:09 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228574
Bug ID: 228574
Summary: GNU ld doesn't emit _end when linking with lld-linked
libc.so
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: misc
Assignee: bugs at FreeBSD.org
Reporter: markj at FreeBSD.org
One difference between a GNU ld-linked libc.so and an lld-linked libc.so is
that the former's _end symbol's section index is SHN_ABS, while the latter's is
that of the bss section. For some reason, GNU ld won't emit an _end symbol when
creating an executable linked with an lld-linked libc. This results in libc's
internal definition being used for curbrk, which is wrong and breaks brk() and
sbrk().
As an experiment, I hacked lld to emit _end with a section index of SHN_ABS,
and used it to link libc.so. Using that, GNU ld behaves as desired.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list