Mail Archives: djgpp-workers/2004/10/28/09:50:07
On Friday 13 August 2004 08:19, DJ Delorie wrote:
> > The point is that 'environ' is not in static storage, it is only
> > in the parameter list of main, under any name you like. Or not.
>
> I think you're missing the point that "environ" *is* defined to be a
> global symbol in the runtime, not just a parameter to main(). It
> happens to be passed to main (at which point it is effectively
> nameless as far as the runtime is concerned), but for historic reasons
> we must provide a global symbol "environ" as well, even without any
> #includes. The only way to do this cleanly is with PROVIDE.
It causes problems and will cause many complaints due to presence
of GCC own djgpp-x.djl. As result _environ stays unresolved if linker
script provided with GCC is being used, which is default for any recent ports
of GCC.
I think, that a better way is to use a separate source file in libc which
contains definition of _environ only. Perhaps it would be best to revert
the change of lib/djgpp.djl and put _environ in a separate fiel.
Andris
- Raw text -