https://llvm.org/bugs/show_bug.cgi?id=25528
Bug ID: 25528 Summary: lld -Bstatic fails to link because _end is undefined Product: lld Version: unspecified Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedb...@nondot.org Reporter: dav...@freebsd.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified The first bug found while building world on FreeBSD =) sbrk() access _end (directly!) to understand where .bss ends. The linker should probably insert that in the generated executable (at least when -Bstatic is used). It seems gold doesn't strip the symbol even if not referenced. % ./clang sbrk.c -fuse-ld=lld2 -o sbrs -static undefined symbol: _end in sbrk.o clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation) Linker invocation: "/exps/llvm-lld/build/bin/./ld.lld2" -Bstatic -o sbrs /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbeginT.o -L/usr/lib /tmp/sbrk-63b6db.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/crtend.o /usr/lib/crtn.o % cat sbrk.c #include <sys/types.h> #include <unistd.h> int main(void) { void *me = sbrk(42); return (0); } -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs