This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Patches for egcs-971016 on AIX
- To: Andrey Slepuhin <pooh at msu dot ru>
- Subject: Re: Patches for egcs-971016 on AIX
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Wed, 22 Oct 97 11:42:48 -0400
- Cc: egcs at cygnus dot com
>>>>> Andrey Slepuhin writes:
>> The whole idea of exports in AIX
>> is to give users finer control and prevent unnecessary namespace polution.
Andrey> Well, but I believe that compiler does not make unnecessary globals
Andrey> (at least it shouldn't :-))
The compiler does not create unnecessary globals; however, a
programmer might create a global variable or function used throughout
multiple files in a library for internal communication, but does not
want that symbols exported possibly poluting a program's namespace or
allowing a program to access "global" variables internal to a library.
Given that people do not expect this level of control on most other
systems, they probably avoid this in other ways.
If you simply want to export all global symbols -- including those
with prefixed underscores -- you should be able to do all that within
collect2. Where scan_prog_file() scans the object files for constructors
and destructors, you simply can change the default case statement for the
switch on is_ctor_dtor() to add any global symbol to the "exports" list if
which_pass == PASS_OBJ. Just make sure that the symbols are limited to
the global symbols you want. And this change should be #ifdef'ed by one
of the XCOFF macros.
David