By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

Compiler segments

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

Mar 8 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
karthik.infoguy wrote:
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?

Mar 8 '07 #2

P: n/a
On Mar 8, 9:32 pm, "karthik.infoguy" <karthik.infogu...@gmail.com>
wrote:
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?

Mar 8 '07 #3

P: n/a
On Mar 8, 9:34 pm, Rolf Magnus <ramag...@t-online.dewrote:
karthik.infoguy wrote:
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?
Are you asking about different phases of compilation?

Mar 8 '07 #4

P: n/a
"karthik.infoguy" <ka***************@gmail.comwrote in message
news:11**********************@8g2000cwh.googlegrou ps.com...
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?
Mar 8 '07 #5

P: n/a
karthik.infoguy wrote:
Any one just let me know what are the different segments in a compiler
and what data
are stored in different segments????
I wonder if the OP is talking about this

http://world.std.com/~swmcd/steven/rants/pc.html

Gosh it takes me back, programmers today don't know they're born.

john
Mar 8 '07 #6

P: n/a
On Mar 8, 4:32 am, "karthik.infoguy" <karthik.infogu...@gmail.com>
wrote:
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.

Mar 8 '07 #7

P: n/a
On Mar 8, 12:02 pm, "Jim Langston" <tazmas...@rocketmail.comwrote:
"karthik.infoguy" <karthik.infogu...@gmail.comwrote in message

news:11**********************@8g2000cwh.googlegrou ps.com...
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.
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.



>
Just what is your question?

Mar 8 '07 #8

P: n/a
karthik.infoguy wrote:
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
Mar 9 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.