Adainit/fini and ELF .init/.fini

Is there any reasons why GNAT doesn’t put the adainit/fini calls into the ELF .init/.fini sections??

Isn’t it related to Library_Auto_Init?

I am very happy that initialization of a dynamic library can be turned off and called explicitly.

Under Windows you will get a deadlock if your library uses any tasking stuff. This is because Windows loads a library under a critical section which Ada initialization tries re-take. Critical sections are not re-entrant. So Library_Auto_Init must be always False.

Thanks, the wording on that isn’t great. Is that set by default on ELF platforms?

It think the default is True.