This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patches for egcs-971016 on AIX


>>>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]