Linker Scripts - Tutorial?
Posted: Tue Jul 15, 2003 4:35 am
One thing that gives me a headache are linker scripts.
I mean, of course I've read the ld manual. And there are lots of linker scrpts around on various tutorial webpages and everything.
But... the manual tells me how to do things, and those tutorials tell me what to do, but there's little to no information on the why.
I found stuff like "*.o (.gnu.linkonce.t.*) /*C++ templates? */" in one tutorial which I found nowhere else - and where do I check what .gnu.linkonce.t.* really stands for to do away with the question mark (I hate question marks in comments)?
I found references to ".stab" and ".stabstr" (huh?), some examples link "*.o (COMMON)" while others don't, and yet others write it as "*(.common)". Some scripts call SORT() on .ctors which I found no explanation for, etc. etc. ad absurdum.
Google gives me a plethora of examples, but virtually no explanations. Anybody knowing a source of enlightenment?
I mean, of course I've read the ld manual. And there are lots of linker scrpts around on various tutorial webpages and everything.
But... the manual tells me how to do things, and those tutorials tell me what to do, but there's little to no information on the why.
I found stuff like "*.o (.gnu.linkonce.t.*) /*C++ templates? */" in one tutorial which I found nowhere else - and where do I check what .gnu.linkonce.t.* really stands for to do away with the question mark (I hate question marks in comments)?
I found references to ".stab" and ".stabstr" (huh?), some examples link "*.o (COMMON)" while others don't, and yet others write it as "*(.common)". Some scripts call SORT() on .ctors which I found no explanation for, etc. etc. ad absurdum.
Google gives me a plethora of examples, but virtually no explanations. Anybody knowing a source of enlightenment?