[PATCH] D107133: [AVR] emit `MCSA_Global` references to `__do_global_ctors` and `__do_global_dtors`
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 3 21:18:40 PDT 2021
MaskRay added inline comments.
================
Comment at: llvm/test/CodeGen/AVR/ctors.ll:11
+
+; CHECK: .globl __do_global_ctors
+ at llvm.global_ctors = appending global [1 x { i32, void () addrspace(1)*, i8* }] [{ i32, void () addrspace(1)*, i8* } { i32 65535, void () addrspace(1)* @do_nothing, i8* null }]
----------------
mhjacobson wrote:
> MaskRay wrote:
> > This is insufficient. It should additionally check whether the label is defined.
> The label isn't expected to be defined. The symbol comes from libgcc.a.
>
> This directive simply tells the assembler to emit an undefined-symbol reference to `__do_global_ctors`. The actual implementation comes at link time, from libgcc.
>
> For comparison, see `llvm/test/CodeGen/AVR/clear-bss.ll`, which does the same thing.
>
> (Apologies if I'm misunderstanding your request here.)
OK. This is resolved. Thanks for the reply.
Please add `;; Emit .globl __do_global_ctors to leave an undefined symbol. This matches GNU as and is needed to pull the definition from libgcc.a` or something similar.
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