tags:

views:

121

answers:

5

I'm looking for a "human readable" article which describes, with examples, if possible, the transition from source code, say C, to an executable program. Ideally, the article shall contain descriptions about the object file format, how different sections of the code maps to to that of object files et.al. That hypothetical article would also explain how the linker uses more than one object file, how it makes use of different ELF entities and thus produces the ready-to-execute file. And also, say, what if the object file refers to external libraries. It shall assume an advanced/medium-level C/C++ knowledge.

I'd be interested to know if such an article/book/blog is known to mankind.

Thanks
:J

A: 

You could also check out the "dragon book" Compilers: Principles, Techniques, and Tools by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman if you want to get super in-depth.

HappyCodeMonkey
A: 

Jonathan - I'm not looking for a beginner-level tutorial or introduction. And that's the reason I mentioned medium-level/advanced knowledge is assumed!

HappyCodeMonkey - I believe that book describes how compiler translates code. My intention wasn't to delve into compiler internals, but rather from a user/hacker point of view.

Jeenu
Jeenu, this is not an "Answer". If you want to reply to our statements, do so as I am doing now, and post a comment beneath the answer.
Jonathan Sampson
You're apparently asking for "medium-level/advanced" topics, yet the question you asked didn't mention anything related to that. You're asking how to go from code to an executable, which isn't advanced. You need to be a bit more specific I guess as to what it is you're looking for.
Jonathan Sampson
I couldn't comment on that because I just registered and that I was told that I needed "reputations" to comment! But now I can. So ...Sorry if my question sounded so. But I wouldn't think of a beginner bothering about ELF, linker et.al. Anyway, now that you know, please post any links that you know of.
Jeenu
A: 

Unfortunately I don't know about such an article but GNU linker manual could answer some of your questions.

abababa22
A: 

"Linkers and loaders" by John R. Levine is quite good.

Linkers and Loaders

Torleif