Page 1 of 1
generating symbol table
Posted: Sat Jan 31, 2009 11:17 am
by yemista
How do you generate the symbol table? Shouldnt ld do it automatically?
Re: generating symbol table
Posted: Sat Jan 31, 2009 11:55 am
by Combuster
Re: generating symbol table
Posted: Sat Jan 31, 2009 1:03 pm
by yemista
i did actually, but i tend to only read for things im looking for, so ill check again. i even read the binutils documentation for ld.
I actually found out how to do it now, but imagine that, there is a tool called nm that has absolutley nothing to do with ld, and for some strange reason no matter how hard you read the man pages for ld and the online documentation, you will never encounter a single sentence that has anything to say about nm. Im real shocked, I dont know what to believe about anymore. Can you tell me where you download your man pages? I think mine are really screwed up. Ive lost my faith in linux.
Re: generating symbol table
Posted: Sat Jan 31, 2009 2:05 pm
by SimonZilch
yemista wrote:i did actually, but i tend to only read for things im looking for, so ill check again. i even read the binutils documentation for ld.
I actually found out how to do it now, but imagine that, there is a tool called nm that has absolutley nothing to do with ld, and for some strange reason no matter how hard you read the man pages for ld and the online documentation, you will never encounter a single sentence that has anything to say about nm. Im real shocked, I dont know what to believe about anymore. Can you tell me where you download your man pages? I think mine are really screwed up. Ive lost my faith in linux.
You seem a little confused. Why should the man page for ld talk about nm? Like you said, the tools are completely unrelated.
The answer to your original question is, yes, ld creates the symbol table automatically (within the object file), but it sounds like that's not the question you wanted answered. It sounds like the question you wanted answered was how to view a list of the symbols in human readable form. nm is one way; "objdump -t" is another (a very useful tool, by the way); and using the "-M" or "-Map" option of ld is yet another way.