On Thu, Oct 21, 2021 at 8:39 AM CHIGOT, CLEMENT <clement.chi...@atos.net> wrote: > > Hi David, > > The problem is that cdtors is created by the linker only when the -bcdtors > flag is provided. Thus, if we add "extern void (* _cdtors[]) (void);" to > the "crtcxa.c", we can't use it without using the new constructor types. > One solution would be to create another crtcxa (eg crtcxa_cdtors.o) which will > be replacing the default crtcxa.o when needed. I didn't think about that > when creating the patch. But it might be a better approach. What do you think > ?
Hi, Clement Another, optional object file in libgcc seems like a cleaner solution than collect2.c emitting all of the code. The file should not be called crtcxa_cdtors.o because "cxa" came from the name of the libstdc++ support functions. Maybe crtcdtors.o or crt_cdtors.o or aixcdtors.o or aix_cdtors.o . Thanks, David