https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119414
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2025-03-24
--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to James K. Lowden from comment #1)
> (In reply to Iain Sandoe from comment #0)
> > 1. -rdynamic (this might not be supported on all targets).
> >
> > What is this needed for?
> > perhaps the library is using some symbol that the executable is meant to
> > export?
>
> Yes, except I don't know what you mean by "meant to export". The produced
> executable defines (or once did define) symbols used by the library.
>
> A quick test indicates it's no longer needed:
>
> $ ./built-gcobol -### -oo nist/NC/NC102A.o 2>&1 | sed "/'-rdynamic'/d; 1d;
> 4,8d" | sh
OK.. perhaps it's a moot point - but the idea I was trying to communicate was
that an executable could be built with an "exports list" which would mean it
_only_ exported those symbols.
Conversely it could/can be built in a way that by default makes global symbols
visible (which I think is what the default is on both Linux and Darwin - which
is why the current impl. "just works" without the need for -rdynamic).
If we can avoid -rdynamic that would be good - even better if we can be
specific about what we want to export (the only real reason to export
everything is when using plugins - since the plugin API is "everything").
NOTE that the current set of tests works fine on Darwin and Linux with these
options omitted. I can put a patch together to remove them, if you like (we
should ideally only add things which have purpose) .. removing now does not
prevent introduction when needed for a specific platform (with some configure
to constrain to that)