Can the new function be set to the constructor in the LLVM pass before calling main()?

I added a function in the pass phase and did some initialization, which I wanted to execute before main was called. In c++ I can do this by setting _attribute(constructor). In pass I want to do this by addfnattr, but I don’t seem to have constructor.

FunctionType *Ty = FunctionType::get(Type::getVoidTy(*Ctx), false);
 static Function* new_func = llvm::Function::Create(Ty, Function::ExternalLinkage, "new_func", M);

In IR that’s not represented by an attribute. Instead there’s a special global variable @llvm.global_ctors used to implement this functionality. For example: Compiler Explorer

Get it! Thanks!