https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121733
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2025-08-31
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Right now:
```
static void
expand_main_function (void)
{
#if (defined(INVOKE__main) \
|| (!defined(HAS_INIT_SECTION) \
&& !defined(INIT_SECTION_ASM_OP) \
&& !defined(INIT_ARRAY_SECTION_ASM_OP)))
emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode);
#endif
}
```
This is not controlled at runtime only compile time.
This would require a new target hook (variable?). to handle this.