Dynamic library loading inner workings

Carlos O'Donell carlos@systemhalted.org
Thu Dec 2 20:25:00 GMT 2010


On Thu, Dec 2, 2010 at 1:07 PM, Andreas Fink
> Yes I know, that the libraries don't need to be unloaded from memory (as defined in the standard), but on linux they are unloaded,
> and if they are not unload from memory there is no way to reopen from harddisk!

Order of library loading matters. Order of library loading changes
relocation processing ordering. If any relocations are left
referencing a library it will not be unloaded, otherwise the program
might crash if it tries to use the relocated reference.

My first guess would be that there is a relocation that is processed
and it prevents one of the libraries from being unloaded.

You can see all of this by running your application with LD_DEBUG=all
environment variable set.

Cheers,
Carlos.



More information about the Libc-help mailing list