loading of shared objects and executables

Michael Zintakis michael.zintakis@googlemail.com
Mon Oct 22 06:47:00 GMT 2012


Though not strictly 100% GCC subject, it is still GCC-related. A couple 
of queries I am hoping someone would be able to address for me.

I am trying to find out what is the process of loading a shared object 
file (.so) and the process of loading and executing a binary file (like 
/bin/bash for example) and what part of the Linux system (or files - 
like ld-linux.so may be?) is responsible for that process?

In other words, when I try to execute a file, I presume "something" 
loads it first into memory, resolves what other shared objects need to 
be loaded and then loads them, before passing the execution to the entry 
point of that executable. I am not interested in the process of the 
actual execution or resolving the external references - just the loading 
process of shared objects and executables, nothing more than that (at 
least not at this stage anyway).

Why would I like to know that?

I am trying to "intervene" in this process, so that before every file 
(shared object or executable) is loaded, I "verify" it and then pass the 
appropriate control to the "standard" loaders for either execution or 
resolving external references, or raise an exception if I don't like the 
file or the shared object about to be loaded.

All this would be done in a Linux environment (x86 - both 32 and 64-bit, 
as well as ARM), no Windoze! I would be glad if someone could give me a 
few pointers - at least to start with. Thanks!


MZ



More information about the Gcc-help mailing list