[Bug libgcc/60939] AIX: exceptions not caught when calling function via pointer

dje at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 21 05:59:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60939

--- Comment #7 from David Edelsohn <dje at gcc dot gnu.org> ---
I had not noticed the lack of a reference to any symbol in the file, so missing
the static constructor.  -bexpfull probably would work around that problem but
likely cause another.

It's a tension between two different use cases and a fundamental problem with
collect2 and AIX.  If collect2 utilizes -bexpfull for the first pass and all
symbols are exported, then every object file and every member of an archive
will be referenced, and every constructor will be run.  But what if the archive
contains otherwise unneeded object files and constructors?  With the proposed
change, the resulting binary or shared object will, at best, only be bloated
with unnecessary symbols and functions, and, at worst, run unnecessary or
damaging constructors.  It essentially is enabling the equivalent of
--whole-archive for every link.

There have been other bug reports about this and collect2 explicitly tries to
strike a balance.

I think this bug report really requires the user to explicitly reference the
file containing the constructor or manually use the equivalent of
--whole-archive.



More information about the Gcc-bugs mailing list