Bug ID: 30680
           Summary: lld + LTO: symbol __start_($SECTION_NAME) is missing
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
    Classification: Unclassified

Created attachment 17429
the reproducer

Consider the following shared object (the full reproducer is attached):

__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

#include <stdio.h>

extern "C" char __start_play_go[] __attribute__((weak));

int main(void) {
  printf("__start_play_go: %p\n", __start_play_go);


$ clang++ -shared -o
$ clang++ -c -flto
$ clang++ -o sections main.o -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

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

Reply via email to