K
Keith Thompson
jacob navia said:Flash Gordon a écrit :
No, I do not agree.
C is a low level systems language,
Agreed, mostly.
and as such, it is important to
be clear of the usage and the works of this mysterious tool called
THE LINKER.
That doesn't follow.
When we talk about the compiler, for example, we discuss the fact that
it has to recognize and process C source code in accordance with the
grammar and other requirements of the C language standard. We don't
talk about whether the parser is table-driven or uses recursive
descent, what the symbol table looks like, and so forth. Such details
might be interesting, but they really have nothing to do with the C
programming language, which is what we discuss here in comp.lang.c.
(There is a comp.compilers newsgroup where such discussions would be
perfectly topical; there are also newsgroups for gcc and lcc.)
Your own discussion of how the linker works is equally off-topic here.
Much of what you describe is likely to be very different on different
systems. You should at least have acknowledged that.
I'm sure you have a copy of the C standard. Whatever it says about
linking is what's topical here. Anything it doesn't mention can
potentially vary from one system to another, and is more appropriate
for a system-specific newsgroup.
This part of the system is as important as the compiler actually,
but will never explained and never mentioned anywhere. This is not
correct. C programs DO have the distinction between uninitialized
data areas and initialized ones, and that is even specified in the
standard. (The uninitialized ones should be set to zero).
No, the C standard talks about initialized and uninitialized
*objects*. There is no mention of "areas". Uninitialized global and
static objects are initalized to 0 *converted to the appropriate
type*. Though a typical implementation might group these all into a
single area and initialize the area to all-bits-zero, that won't work
if all-bits-zero doesn't happen to be a valid representation a null
pointer or a floating-point 0.0.
There *is* always a section of the program that is reserved for
the machine instructions the circuit understands. There is almost always
a section for the initialized data, and the uninitialized data.
What is a "section"? Please answer based on references to the C
standard, not on your knowledge of MS Windows on x86-based systems.
I think explaining this pertains to the C language, actually I think it
is an essential part that will often be neglected, treating the
compilation system as a magic black box that must be used
without any further understanding.
No, this does not pertain to the C language. On systems where it's
valid, it could pertain to *any* compiled language.
Think about this. Everything you mentioned could apply to programs
written in C, C++, Fortran, Pascal, or Ada on a win32 system. None of
necessarily applies to programs written in C, C++, Fortran, Pascal, or
Ada on an IBM AS/400 system. What does that tell you about where it
might be topical?