Mail Archives: djgpp/2004/08/11/12:00:54
On 11 Aug 2004 11:47:04 +0300 in comp.os.msdos.djgpp, Esa A E Peuha
<esa DOT peuha AT helsinki DOT fi> wrote:
>Brian Inglis <Brian DOT Inglis AT SystematicSw DOT Invalid> writes:
>
>> Looks like you're correct about -Cg not being entirely truthful about
>> globals without leading _. The revised list of non-Standard globals
>> from a dummy program with no #includes compiled with -ansi -pedantic
>> are:
>>
>> T _close close *
>> D _edata edata
>> B _end end
>> B _environ environ
>> T _etext etext
>> T _sbrk sbrk *
>>
>> where the routines marked * are Unix compatible routines called by the
>> startup/exit code. Can be worked around, as you indicate below?
>
>What version of djgpp are you using? It seems to be older than the
>current CVS, because with it you shouldn't see _etext, _edata and _end
>unless you actually use them in your code. (close and sbrk are bugs,
>but they may be fixed already.)
djdev 2.03 PL 2
>> Eli Z pointed out that it must be available for POSIX compatible code
>> that requires it, but should not be present for ANSI compiles.
>> I would be interested in how you can have it defined, if it is
>> declared, but not defined as a global, and have it not be defined if
>> it is already defined?
>
>The linker can be instructed (by using the PROVIDE construct in the
>linker script) to define symbols only if they are referenced but not
>defined. That's how _etext, _edata and _end are defined.
That's a useful facility that I didn't know was possible.
--
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
Brian DOT Inglis AT CSi DOT com (Brian dot Inglis at SystematicSw dot ab dot ca)
fake address use address above to reply
- Raw text -