libgcc problems with shared libraries

H.J. Lu hjl@lucon.org
Thu Jan 15 16:30:00 GMT 1998


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

But files in libgcc.a are compiled with -fPIC and gcc passes -lgcc
when -shared is used to build shared library.

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

It is hard to say it is a problem or not. The ELF scheme works
when local static variables are used in functions, which is the
case for libgcc.a. We just need to be careful when dealing with
existing functions in libgcc.a.

> 	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

The GNU ld supports the exported list in the form of the symbol
versioning. We can have

FOO {
  global:
    *;
};

to export all symbols. Or

FOO {
  global:
    a*; foo;
};

to export symbols staring with a and symbol "foo". I am not
sure how hard to expand it to support

global:
    a*; foo;

Also I am not sure if none ELF systems are supported.


H.J.



More information about the Gcc mailing list