[PATCH] D149340: [AMDGPU] Place global constructors in .init_array and .fini_array
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 27 16:07:53 PDT 2023
MaskRay added a comment.
I know little about GPU. The generic code emittings constructors to assembly is `AsmPrinter::emitSpecialLLVMGlobal` and `AsmPrinter::emitXXStructorList`. It will use `.init_array`.
The priority works this way. Note that in the absence of a `.N` suffix, `.init_array` has the highest priority. https://maskray.me/blog/2021-11-07-init-ctors-init-array
a.o:(.init_array.1) b.o:(.init_array.1)
a.o:(.init_array.2) b.o:(.init_array.2)
...
a.o:(.init_array.65533) b.o:(.init_array.65533)
a.o:(.init_array.65534) b.o:(.init_array.65534)
a.o:(.init_array) b.o:(.init_array)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149340/new/
https://reviews.llvm.org/D149340
More information about the llvm-commits
mailing list