This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Re: Partial symbol export vs --export-dynamic
On Mon, Jun 18, 2001 at 05:07:26PM +0100, Nick Clifton wrote:
> HI H.J.
>
> > It turned out it was quite easy to do. Here is a patch. I just
> > expanded the symbol versioning to executables. You can use
> >
> > # gcc -Wl,-export-dynamic,--version-script,version.map ...
> >
> > You can use the version-script to control what you want to export. It
> > supports regular expression, C++ symbol, Java, ... among other
> > things.
>
> Well that looks very neat. Please could you update the documentation
> to mention this new behavior.
>
How about this patch?
H.J.
----
2001-06-18 H.J. Lu <hjl@gnu.org>
* ld.texinfo (-E, --export-dynamic): Mention --version-script.
(--version-script): Mention the language support.
Index: ld.texinfo
===================================================================
RCS file: /work/cvs/gnu/binutils/ld/ld.texinfo,v
retrieving revision 1.20
diff -u -p -r1.20 ld.texinfo
--- ld.texinfo 2001/05/23 18:36:06 1.20
+++ ld.texinfo 2001/06/18 18:51:54
@@ -444,6 +444,10 @@ back to the symbols defined by the progr
dynamic object, then you will probably need to use this option when
linking the program itself.
+You can also use the version script to control what symbols should
+be added to the dynamic symbol table if the output format supports it.
+See the description of @samp{--version-script} in @ref{VERSION}.
+
@cindex big-endian objects
@cindex endianness
@kindex -EB
@@ -3536,6 +3540,17 @@ If you wish to bind a reference to a spe
within the shared library, you can use the aliases of convenience
(i.e. @samp{old_foo}), or you can use the @samp{.symver} directive to
specifically bind to an external version of the function in question.
+
+You can also specify the language in the version script:
+
+@smallexample
+VERSION extern "lang" @{ version-script-commands @}
+@end smallexample
+
+The supported @samp{lang}s are @samp{C}, @samp{C++}, and @samp{Java}.
+The linker will iterate over the list of symbols at the link time and
+demangle them according to @samp{lang} before matching them to the
+patterns specified in @samp{version-script-commands}.
@node Expressions
@section Expressions in Linker Scripts