https://llvm.org/bugs/show_bug.cgi?id=30680
Bug ID: 30680 Summary: lld + LTO: symbol __start_($SECTION_NAME) is missing type Product: lld Version: unspecified Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: ELF Assignee: unassignedb...@nondot.org Reporter: kra...@google.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 17429 --> https://llvm.org/bugs/attachment.cgi?id=17429&action=edit the reproducer Consider the following shared object (the full reproducer is attached): bar.cc: __attribute((visibility("default"))) __attribute__ ((section("play_go"))) void* get_start(); extern "C" char __start_play_go[] __attribute__((weak)); void* get_start() { return reinterpret_cast<void*>(__start_play_go); } Basically, we put get_start function into play_go section and also use __start_play_go symbol to keep it there. Then we try to use this symbol from main.cc #include <stdio.h> extern "C" char __start_play_go[] __attribute__((weak)); int main(void) { printf("__start_play_go: %p\n", __start_play_go); } Building: $ clang++ -shared -o libbar.so bar.cc $ clang++ -c main.cc -flto $ clang++ -o sections main.o libbar.so -flto -fuse-ld=lld symbol __start_play_go is missing type clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation) I observe that while building Chromium, as tcmalloc uses this dark magic of sections for hooks. -- 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