when will __attribute__((constructor)) NOT called

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Sep 6 12:46:00 GMT 2017


'.ctor' section was the 'old' way, afaik GCC will now create and emit
entries on 'init_array' section, as for C++ initialization code.

It won't run either by a bug on the loader or if it does not support
it (not the case on glibc).

On 06/09/2017 07:37, Yubin Ruan wrote:
> I saw somewhere that "__attribute__((constructor)) will make GCC
> create a '.ctor' section in the generated .so file, which is run when
> a shared library is loaded, typically at program startup".
> 
> A question:
>   Are there any case where "__attribute__((constructor))" will not be run?
> 
> Thanks,
> Yubin
> 



More information about the Libc-help mailing list