generating symbol table

Programming, for all ages and all languages.
Post Reply
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

generating symbol table

Post by yemista »

How do you generate the symbol table? Shouldnt ld do it automatically?
User avatar
Combuster
Member
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: generating symbol table

Post by Combuster »

tried

Code: Select all

man ld
?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

Re: generating symbol table

Post 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.
SimonZilch
Posts: 8
Joined: Thu Jan 22, 2009 12:19 am

Re: generating symbol table

Post 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.
Post Reply