https://llvm.org/bugs/show_bug.cgi?id=26732
Bug ID: 26732 Summary: lld needs to provide _DYNAMIC symbol when creating a shared library Product: lld Version: unspecified Hardware: PC OS: FreeBSD Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedb...@nondot.org Reporter: ema...@freebsd.org CC: llvm-bugs@lists.llvm.org Blocks: 23214 Classification: Unclassified Created attachment 15943 --> https://llvm.org/bugs/attachment.cgi?id=15943&action=edit sample test case for _DYNAMIC symbol The linker-provided _DYNAMIC symbol is required by FreeBSD's rtld to find its own DYNAMIC segment. Example showing how it is used, from FreeBSD's rtld.c, rtld_machdep.h: --- /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) \ ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC)) #define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) extern Elf_Dyn _DYNAMIC; #pragma weak _DYNAMIC ... if (RTLD_IS_DYNAMIC()) { objtmp.dynamic = rtld_dynamic(&objtmp); --- Attached is a test case sample that passes with ld.bfd. -- 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