Compiler segments

  • Thread starter karthik.infoguy
  • Start date
K

karthik.infoguy

Any one just let me know what are the different segments in a compiler
and what data
are stored in different segments????
 
R

Rolf Magnus

karthik.infoguy said:
Any one just let me know what are the different segments in a compiler
and what data are stored in different segments????

I have no idea what you mean by "segments in a compiler". Could you
elaborate?
 
S

Sarath

Any one just let me know what are the different segments in a compiler
and what data
are stored in different segments????

Are you asking different phases of compilation?
 
J

Jim Langston

karthik.infoguy said:
Any one just let me know what are the different segments in a compiler
and what data
are stored in different segments????

I think you are ocnfusing your terms. A compiler is a program that compiles
a program into object code which is then linked into an executable by a
linker, sometimes by the compiler itself.

Just what is your question?
 
K

Kaz Kylheku

Any one just let me know what are the different segments in a compiler
and what data
are stored in different segments????

Segments are a platform-specific linkage concept, not a C++ concept.

Consult the reference documentation for your tools.
 
K

Kaz Kylheku

I think you are ocnfusing your terms. A compiler is a program that compiles
a program into object code which is then linked into an executable by a
linker, sometimes by the compiler itself.

That object code is typically organized into sections or segments.
Code goes into a code or "text" section, static read/write data into a
data section, data which can be initialized to zero bits into yet
another section and so on. A C++ compiler may use special sections due
to its linkage model for inline functions and other data which may be
generated more than once in different compilation units and have to be
merged. Special sections may be used for pointers to the constructor
and destructor stubs, so that when these are collected together into a
section, they form a table that can be iterated over to do the call-
outs. All of this is very platform-specific, of course.
 
T

Thomas Matthews

karthik.infoguy said:
Any one just let me know what are the different segments in a compiler
and what data
are stored in different segments????
Segments, in linking terminology, are a concept for organizing a
translation unit's code and data. This is not required by the C++
language, but added on by many compilers and linkers. There is no
official standard either.

Some common segments:
text -- could contain read only data.
code -- the executable code
read/write -- run-time variables

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top