Re: c program binary/image in memory
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 19 Jan 2006 23:15:58 GMT
jacob navia <jacob@xxxxxxxxxxxxxxxx> writes:
> Flash Gordon a écrit :
>> jacob navia wrote:
>>>>> C is a low level systems language, and as such, it is important to
>>>>> be clear of the usage and the works of this mysterious tool called
>>>>> THE LINKER.
>> If it is important to know, then how come I have *never* needed to
>> know when writing applications in C for Linux? To be honest, I don't
>> even know what the sections are named on Linux, SCO, AIX or Windows
>> yet I quite happily write C code that runs on all of them.
>
> Sure, why not?
>
> But when ASKED (as the original poster asked) why not learn?
Because it has nothing to do with the C programming language. Take
another look at the name of this newsgroup.
If you want to talk about linkers and bss and data segments, nobody
will stop you. If you wan't to talk about bicycles and hang gliders,
nobody will stop you. Just find an appropriate place to do it.
> I think knowing the concepts behind those section is important
> specially if you not only want to use the compiler as a black
> box, but also UNDERSTAND what is going on. But as I said before
> this is a matter of personal opinion.
Nobody is necessarily saying that it's not important to know this
stuff (though you can do a lot of C programming without knowing any of
it). The issue is topicality, not importance.
[...]
>> It doesn't always work like that. I've worked on systems where you
>> have one section which contains variable of both static and
>> automatic duration (the stack is places in the same
>> section). Compiler and linker between them generate a linked list of
>> initialisations that need to be done, and the application started
>> code runs along the linked list reading address, size and initial
>> value information and initialising things appropriately. That
>> doesn't sound anything like the data/bss section system you
>> described.
>
> No, it is just that instead of the operating system+linker doing that,
> the program itself does it, before starting main().
>
> You will agree with me howevere, that after that phase of the program is
> done, the data section is there and there is a sequential series
> of memory locations containing the representation of 488776 ok?
No, I do not agree that there necessarily has to be something called a
"data section", or even something comparable with a different name.
There will likely be an object in memory somewhere. Its location
relative to any other object in memory is system-specific.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- c program binary/image in memory
- From: tele-commuter
- Re: c program binary/image in memory
- From: jacob navia
- Re: c program binary/image in memory
- From: Flash Gordon
- Re: c program binary/image in memory
- From: jacob navia
- Re: c program binary/image in memory
- From: Richard Bos
- Re: c program binary/image in memory
- From: jacob navia
- Re: c program binary/image in memory
- From: Flash Gordon
- Re: c program binary/image in memory
- From: jacob navia
- c program binary/image in memory
- Prev by Date: Re: using "!!" in "c"
- Next by Date: Re: using "!!" in "c"
- Previous by thread: Re: c program binary/image in memory
- Next by thread: Re: c program binary/image in memory
- Index(es):
Relevant Pages
|