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?
Linux ELF 32bits loading
Re: Linux ELF 32bits loading
RTFM and search before you ask.
-
- Posts: 6
- Joined: Wed Jun 01, 2011 1:35 pm
Re: Linux ELF 32bits loading
If you have something that contribute to an answer say it.
If not, just doesn't waste your time and mine with quite obvious things.
If not, just doesn't waste your time and mine with quite obvious things.
Re: Linux ELF 32bits loading
Indeed RTFM (Read the full! manual) is an answer.
(1) The expected behavior of program loader, including dynamic linking, is documented on the manual.
(2) String table are usually used only during loading, it's up to the program loader to handle them, however I do not see it necessary to concatenate it but just drop them after loading.
(3) It's up to the loader for how and when to resolve them. And it's possible to do lazy loading that only pull in shared object upon its used.
(4) Check the manual.
(1) The expected behavior of program loader, including dynamic linking, is documented on the manual.
(2) String table are usually used only during loading, it's up to the program loader to handle them, however I do not see it necessary to concatenate it but just drop them after loading.
(3) It's up to the loader for how and when to resolve them. And it's possible to do lazy loading that only pull in shared object upon its used.
(4) Check the manual.
-
- Posts: 6
- Joined: Wed Jun 01, 2011 1:35 pm
Re: Linux ELF 32bits loading
Look, here is a descent *answer*: http://stackoverflow.com/questions/1213 ... ts-loading
Re: Linux ELF 32bits loading
This forum is not a Q/A site.
We show you the door, it is up to you to go through it.
We show you the door, it is up to you to go through it.
-
- Posts: 6
- Joined: Wed Jun 01, 2011 1:35 pm
Re: Linux ELF 32bits loading
Indeed it isn't a Q/A site, and this is the main reason that I was expecting a comment to start a discussion not a one line 'answer'.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Linux ELF 32bits loading
Then you obviously asked the wrong question.