Yes they're still used. C++ heavily uses them as you've guessed. Off the top of my head QEMU also uses them as a way to register all the machine variants it supports internally without having big per arch tables in source that everyone needs to constantly have merge conflicts with.
Re:Anatomy of Linux Dynamic Libraries
by cryptonector on Thursday October 13, 2022 @12:52PM
(#33193569)
The Solaris Linker Guide is still the best document written on ELF and dynamic linking. I highly recommend spending some time with it.
Re:Anatomy of Linux Dynamic Libraries
by akshaykumar90 on Thursday October 13, 2022 @01:44PM
(#33194225)
Can you share a link if available?
Re:Anatomy of Linux Dynamic Libraries
by cryptonector on Thursday October 13, 2022 @03:12PM
(#33195198)
I'd like to comment on this:
> When the relocations are complete, the dynamic linker allows any loaded shared object to execute optional initialization code. This functionality allows the library to initialize internal data and prepare for use.
> This code is defined in the .init section of the ELF image. When the library is unloaded, it may also call a termination function (defined as the .fini section in the image).
There are huge problems with this stuff. Are these sections still used? I know you can add functions to these sections with a GCC attribute but I don't know why anyone would do that. Do other languages like C++ use these sections?
https://blogs.oracle.com/solaris/post/init-and-fini-processi...