libgcc problems with shared libraries
H.J. Lu
hjl@lucon.org
Thu Jan 15 16:30:00 GMT 1998
>
> >>>>> 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.
>
> Again, it does not matter if ELF systems do not demonstrate the
> problem. You are hiding a problem inside a quirk of one particular system
Well, if AIX doesn't support that, you may run into more trouble like
this. It looks like AIX treats set_terminate () like -Bsymbolic on
ELF or library-scope symbol in glibc 2.1. It is very similar to the
register_frame discussion we had eariler. That is how shared library
works on ELF.
BTW, does AIX need an exported symbol list for building shared library?
If not, why aren't symbols included from -lgcc exported? If yes, can
gcc add functions in libgcc.a which use local static variables to the
exported list.
> instead of thinking about all of the various ports this affects. If you
> only want a compiler for Linux/ELF, fine, because that is what you are
> implying. You essentially are saying it does not affect you so everyone
> else is wrong and you do not care.
>
I have no idea how shared library works on AIX. I guess we can
do
1. gcc is modified to make sure all functions in libgcc.a which use
local static variables exported in shared library on all platforms. Or
2. use shared libgcc or don't add -lgcc to -shared on those
platforms where 1. is not the system default.
--
H.J. Lu (hjl@gnu.org)
More information about the Gcc
mailing list