Linux ELF 32bits loading
Posted: Sun Aug 26, 2012 8:07 pm
I'm writing an x86 binary interpreter.
At the moment I'm dealing with loading the executable file and shared objects. However I'm stuck with some doubts:
1) Does the dynamic linker/loader concatenate .ini sections of the main executable and shared libraries to generate just one .ini section for the process image? And for the .fini section?
2) Does it concatenate the many symbol and string table?
3) I'm lost about relocations. They happen should be made at the moment the binary is loaded or just when a procedure is called? I guess I didn't understand how the dynamic linker/loader manages the relocations.
4) Why there exist .hash and .gnu.hash sections? Why do I need 'hash' a symbol?
Can someone comment on this?
At the moment I'm dealing with loading the executable file and shared objects. However I'm stuck with some doubts:
1) Does the dynamic linker/loader concatenate .ini sections of the main executable and shared libraries to generate just one .ini section for the process image? And for the .fini section?
2) Does it concatenate the many symbol and string table?
3) I'm lost about relocations. They happen should be made at the moment the binary is loaded or just when a procedure is called? I guess I didn't understand how the dynamic linker/loader manages the relocations.
4) Why there exist .hash and .gnu.hash sections? Why do I need 'hash' a symbol?
Can someone comment on this?