C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The symbol table

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Sourav Sahay
Guest





PostPosted: Tue Jan 18, 2005 11:03 pm    Post subject: The symbol table Reply with quote



What is symbol table? Is it created during run - time or during compile
- time? Is it a part of the C/C++ language or is it a part of the OS?


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
kanze@gabi-soft.fr
Guest





PostPosted: Wed Jan 19, 2005 11:06 pm    Post subject: Re: The symbol table Reply with quote



Sourav Sahay wrote:
Quote:
What is symbol table? Is it created during run - time or
during compile - time? Is it a part of the C/C++ language or
is it a part of the OS?

There isn't really a formal definition (and nothing in the
language concerning it), but most often, when someone speaks of
a symbol table, they mean a table in the compiler associating
the symbol (a string extracted from the source) with its meaning
(which can be quite complicated). At least part of this table
must be placed in the object files, for the linker, and if
dynamic linking is used, some of it ends up being exploited at
run time.

A more general definition would be any mapping of symbols to
something else. When the something else is just a value of a
different type (or the same type), it is more common to speak of
a dictionary, a map, or an associative array; if the value is
determined algorithmicly, rather than by table lookup, the term
symbol table doesn't apply. But any time you look up a "symbol"
(a string of textual characters) in order to determine a
behavior or a semantic, the term symbol table can be used.
Which means that it can be a run-time phenomena as well. (Which
is it for the compiler -- the compiler is, of course, a program,
and anything which we normally consider as compile-time is
run-time for the compiler program.)

In this larger acceptation, of course, the OS will also contain
symbol tables -- formally, a directory in the file system is
nothing other than a symbol table, and of course, in one way or
another, the OS also manages tables mapping user names (symbols)
to rights, etc., which are also symbol tables.

--
James Kanze GABI Software http://www.gabi-soft.fr
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
hesham ebrahimi
Guest





PostPosted: Wed Jan 19, 2005 11:13 pm    Post subject: Re: The symbol table Reply with quote



I think you should read a book about compiler(but some c++ books
introduce this subject), it will help you.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Patrick Leslie Polzer
Guest





PostPosted: Wed Jan 19, 2005 11:19 pm    Post subject: Re: The symbol table Reply with quote

Sourav Sahay wrote:
Quote:
What is symbol table? Is it created during run - time or during compile
- time? Is it a part of the C/C++ language or is it a part of the OS?
The symbol table maps strings to addresses.

It is created by the compiler at compile-time.

Leslie

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Maxim Yegorushkin
Guest





PostPosted: Wed Jan 19, 2005 11:48 pm    Post subject: Re: The symbol table Reply with quote

On 18 Jan 2005 18:03:01 -0500, Sourav Sahay <sourav_sahay (AT) hotmail (DOT) com>
wrote:

Quote:
What is symbol table?

It can be anything.

Othen, it's basically a table with symbol names, its types and their
offsets in the binary. They are othen used for displaying variable values
while debugging and for creating nice stack traces with calls along call
arguments during a crash.

Quote:
Is it created during run - time or during compile

They are created for binaries during link-time.

Quote:
- time? Is it a part of the C/C++ language or is it a part of the OS?

It's not a part of C/C++ standards.

--
Maxim Yegorushkin

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Raymond Martineau
Guest





PostPosted: Wed Jan 19, 2005 11:58 pm    Post subject: Re: The symbol table Reply with quote

On 18 Jan 2005 18:03:01 -0500, "Sourav Sahay" <sourav_sahay (AT) hotmail (DOT) com>
wrote:

Quote:
What is symbol table? Is it created during run - time or during compile
- time? Is it a part of the C/C++ language or is it a part of the OS?

The symbol table is created by the compiler while the program is being
compiled, andis used to link functions from different modules (e.g. your
program and the startup libraries, or different modules within your
program.)

The symbol table is also used by debuggers to help during a test run, by
providing the location of every variable in memory.

The symbol table is not part of the C language or Operating system, but
are used by programming tools. If you want to know the symbol table
specification, you need to look at the documentation that came with the
compiler (if it has any.)



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.