3 ms·
It's a compiler "hack" for shared libraries, because there is no other way to run initialization for elf objects. [1] The C standard doesn't allow it. And gcc
by bb88 9y ago
It's a compiler "hack" for shared libraries, because there is no other way to run initialization for elf objects. [1] The C standard doesn't allow it. And gcc forces you to be explicit about it.
[1]: https://www.geeksforgeeks.org/__attribute__constructor-__attribute__destructor-syntaxes-c/ https://www.geeksforgeeks.org/__attribute__constructor-__att...