summaryrefslogtreecommitdiff
path: root/ld/ld.texinfo
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-07-20 19:25:42 +0000
committerMike Frysinger <vapier@gentoo.org>2010-07-20 19:25:42 +0000
commit93304b1fe865343eed40219bf37c32191c9e205b (patch)
tree9a990f1c6ca9e4d211d1a6415e7b6b6974550c2d /ld/ld.texinfo
parentfe58de404e6f2d451880714526c8ca3b8d733187 (diff)
downloadbinutils-redhat-93304b1fe865343eed40219bf37c32191c9e205b.tar.gz
ld: improve linker script section
The example version script in the manual currently suggests: extern "C++" { "int f(int, double)"; } But a C++ function like that doesn't encode the return type into the mangled name, so when the linker demangles things, it ends up with "f(int, double)" and so it never matches. The example also lacks a trailing semicolon after the brace, so the linker always complains about a syntax error in the file. While the language section documents the possibilities, it isn't clear as to which is the default language. So explicitly state that the C language is the default. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'ld/ld.texinfo')
-rw-r--r--ld/ld.texinfo7
1 files changed, 4 insertions, 3 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 808f2952db..8928350ea4 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -4910,8 +4910,8 @@ VERS_2.0 @{
bar1; bar2;
extern "C++" @{
ns::*;
- "int f(int, double)";
- @}
+ "f(int, double)";
+ @};
@} VERS_1.2;
@end smallexample
@@ -5036,7 +5036,8 @@ VERSION extern "lang" @{ version-script-commands @}
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}.
+patterns specified in @samp{version-script-commands}. The default
+@samp{lang} is @samp{C}.
Demangled names may contains spaces and other special characters. As
described above, you can use a glob pattern to match demangled names,