Patches for egcs-971016 on AIX
David Edelsohn
dje@watson.ibm.com
Wed Oct 22 11:43:00 GMT 1997
>>>>> 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
More information about the Gcc
mailing list