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: libgcc problems with shared libraries


>>>>> H J Lu writes:

HJ> It should not be a problem. The dynamic linker and linker should
HJ> make sure only one copy of set_terminate () is used in any case.
HJ> That is what happens on ELF systems.

HJ> If AIX doesn't support that, you may run into more trouble like
HJ> this. It looks like AIX treats set_terminate () like -Bsymbolic on
HJ> ELF or library-scope symbol in glibc 2.1. It is very similar to the
HJ> register_frame discussion we had eariler. That is how shared library
HJ> works on ELF.

HJ> BTW, does AIX need an exported symbol list for building shared library?
HJ> If not, why aren't symbols included from -lgcc exported? If yes, can
HJ> gcc add functions in libgcc.a which use local static variables to the
HJ> exported list.

	AIX normally wants export lists.  AIX is heading in the direction
of autoexport and now -bexpall, -G, -bsymbolic, SVR4-like options in AIX
4.2.  libgcc.a is not built shared, so I do not understand your proposal.

	This is exactly the register_frame() problem all over again.  AIX
really uses export lists to avoid all the problems as Kenner described.
GCC collect2 undoes much of the benefit to hide the details from users.

	The problem is that collect2 is trying to make AIX look like all
other shared library systems because people want it to behave like
SVR4/ELF and do not want to think about export lists.  Unfortunately,
collect2 is not performing the function as intelligently as AIX ld
-bexpall option which avoids known special AIX symbols like _savefXX and
_restfXX.  collect2 is exporting all global symbols by default without
regard to special ones.

	I was hoping that Andrey would address this in his collect2
patches that I am reviewing, but he initially said that those special
symbols were not being exported.  Now he has posted a bug report that
exactly is due to those symbols incorrectly being exported.  This is not a
GCC code generation, prologue, or epilogue problem -- this is a collect2
export problem.

	Many of these problems are being addressed by AIX ld.  If GNU ld
could catch up, we wouldn't have to push so much of the solution into
collect2 and could use the correct linker options that provide the same
support.  Unfortunately, I have not been able to get AIX ld documentation
released to Cygnus so that they can update GNU ld.  The problem is that it
is easier for a university to ask for and receive the documentation from
its sales rep and branch office than it is for me at IBM Research to
make the material public.

David
===============================================================================
David Edelsohn                                      T.J. Watson Research Center
dje@watson.ibm.com                                  P.O. Box 218
+1 914 945 4364 (TL 862)                            Yorktown Heights, NY 10598


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