[PATCH] D28791: [compiler-rt][crt] Simple crtbegin and crtend implementation

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 15:57:33 PST 2017


phosek added a comment.

We discussed this with @mcgrathr and came up with a possible alternative solution: Currently the only bit of `crtbegin.o` we're missing is the `__dso_handle` symbol because Clang generates a reference to it when compiling C++ code. That symbol has been historically defined in `crtbegin.o`, but there's no reason it has to be defined there. The only requirement is that this symbol is defined in a statically linked archive/object. That means that we could alternatively define this symbol in the builtins library; since this library is always linked as static, it satisfies the requirement, and it also means that if `crtbegin.o` is being linked in e.g. on Linux, linker will use the symbol from `crtbegin.o` and ignore the one defined in the builtins library.


Repository:
  rL LLVM

https://reviews.llvm.org/D28791





More information about the llvm-commits mailing list