[PATCH] D107133: [AVR] emit `MCSA_Global` references to `__do_global_ctors` and `__do_global_dtors`

Matt Jacobson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 20:57:10 PDT 2021


mhjacobson added a comment.

In D107133#2924267 <https://reviews.llvm.org/D107133#2924267>, @MaskRay wrote:

> Defining `__do_global_ctors` looks like ld's work (in GNU ld), not the assembler's.

Maybe—though note that GCC //does// handle this in the compiler, and LLVM itself handles the similar symbols `__do_copy_data` and `__do_clear_bss` in the compiler (as we've been discussing here).

Adding such functionality to the GNU linker probably isn't straightforward.  The linker has no concept of constructor functions, AFAIK.  The only thing that directs the `.ctors` table to be linked in is the AVR linker script.

Assuming no such fix in the linker is imminent, could we agree that supporting this in LLVM would be a good improvement for now?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107133/new/

https://reviews.llvm.org/D107133



More information about the llvm-commits mailing list