This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: import list creation on AIX and GCC 2.95-branch
- To: David Edelsohn <dje at watson dot ibm dot com>
- Subject: Re: import list creation on AIX and GCC 2.95-branch
- From: "Alexander N. Kabaev" <ak03 at gte dot com>
- Date: Tue, 23 Jan 2001 11:58:02 -0500 (EST)
- Cc: gcc-patches at gcc dot gnu dot org, Bernd Schmidt <bernds at redhat dot com>
- Organization: Verizon Laboratories Inc.
Sorry for yeat another follow up, but I thought I should be more verbose
explaining why shared libraries depending on the symbols from the executable
are better than shared libraries with no working exceptions:
> This design fails when one wishes to create a shared library with
> GCC and link or dynamically load the shared library with a non-GCC program
> (e.g., a Java JIT not compiled with GCC).
Explicit linking of the libgcc into the module should help here, although some
small hackery to add something like --disable-import flag to the collect2
invocation might be involved. Or one could simply rename libgcc.a and link it
in under that new name. The point is, there are numerous work-arounds for a
person motivated enough.
> This also fails if the library
> utilizes C++ but the main program is just C, so the libgcc.a C++ symbols
> are not present.
This cannot happen, AFAIK. By default, AIX linker will export all symbols
required by the shared objects being used by the particular application, i.e if
pure C program will be linked against C++ shared module, the linker will notice
that _get_eh_context(sp?) symbol is required and will export it even though
application itself does not use it.