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

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 13:23:45 PST 2017


joerg added a comment.

It is functional only if a number of number of run time choices are made in the right way. That's exactly the reason why I am against shipping those files in first place: if you pick the wrong, you get a nicely linking binary that is magically broken much much later.

The choices available to the run time are:
(1) Should EH frame registration be attemped?
(2) Who is responsible for iterating .ctor/.dtor?
(3) Is __cxa_atexit supported by the platform?
(4) Are Java types supported?

The current version is noticably wrong for (3) on most modern systems, glibc include. This would prevent global dtors and the like in shared libraries be skipped.
Getting (1) wrong can break reasonable caching in libunwind, so it is also quite important.
Getting (2) wrong won't matter on newer glibc distros, but there are still enough systems that don't use INIT_ARRAY/FINI_ARRAY on non-EABI-ARM.

(4) is likely not relevant anymore.


Repository:
  rL LLVM

https://reviews.llvm.org/D28791





More information about the llvm-commits mailing list