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: b...@freebsd.org
          Reporter: ma...@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.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to