diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/ld.texinfo | 17 | ||||
-rw-r--r-- | ld/lexsup.c | 16 |
3 files changed, 31 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 7102bca..508b605 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2000-07-05 Kenneth Block <krblock@computer.org> + + * ld/lexsup.c: Add optional style to demangle switch + * ld/ld.texinfo: Document optional style to demangle switch. + 2000-07-20 Hans-Peter Nilsson <hp@axis.com> * Makefile.am (ALL_EMULATIONS): Add ecrisaout.o, ecriself.o, diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 2bc54e4..6ca9432 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -852,17 +852,19 @@ space between @var{symbol}, the equals sign (``@key{=}''), and @var{expression}. @cindex demangling, from command line -@kindex --demangle +@kindex --demangle[=@var{style}] @kindex --no-demangle -@item --demangle +@item --demangle[=@var{style}] @itemx --no-demangle These options control whether to demangle symbol names in error messages and other output. When the linker is told to demangle, it tries to present symbol names in a readable fashion: it strips leading underscores if they are used by the object file format, and converts C++ -mangled symbol names into user readable names. The linker will demangle -by default unless the environment variable @samp{COLLECT_NO_DEMANGLE} is -set. These options may be used to override the default. +mangled symbol names into user readable names. Different compilers have +different mangling styles. The optional demangling style argument can be used +to choose an appropriate demangling style for your compiler. The linker will +demangle by default unless the environment variable @samp{COLLECT_NO_DEMANGLE} +is set. These options may be used to override the default. @cindex dynamic linker, from command line @kindex --dynamic-linker @var{file} @@ -1072,6 +1074,11 @@ specifies the first set of directories to search. The either by specifying a list of names separated by colons, or by appearing multiple times. +This option should be used with caution as it overrides the search path +that may have been hard compiled into a shared library. In such a case it +is possible to use unintentionally a different search path than the +runtime linker would do. + The linker uses the following search paths to locate required shared libraries. @enumerate diff --git a/ld/lexsup.c b/ld/lexsup.c index e2cd2d1..079cc06 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ldfile.h" #include "ldver.h" #include "ldemul.h" +#include "demangle.h" #ifndef PATH_SEPARATOR #if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN32__)) @@ -272,8 +273,8 @@ static const struct ld_option ld_options[] = '\0', NULL, N_("Output cross reference table"), TWO_DASHES }, { {"defsym", required_argument, NULL, OPTION_DEFSYM}, '\0', N_("SYMBOL=EXPRESSION"), N_("Define a symbol"), TWO_DASHES }, - { {"demangle", no_argument, NULL, OPTION_DEMANGLE}, - '\0', NULL, N_("Demangle symbol names"), TWO_DASHES }, + { {"demangle", optional_argument, NULL, OPTION_DEMANGLE}, + '\0', N_("[=STYLE]"), N_("Demangle symbol names [using STYLE]"), TWO_DASHES }, { {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER}, '\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES }, { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS}, @@ -594,6 +595,17 @@ parse_args (argc, argv) break; case OPTION_DEMANGLE: demangling = true; + if (optarg != NULL) + { + enum demangling_styles style; + + style = cplus_demangle_name_to_style (optarg); + if (style == unknown_demangling) + einfo (_("%F%P: unknown demangling style `%s'"), + optarg); + + cplus_demangle_set_style (style); + } break; case OPTION_DYNAMIC_LINKER: command_line.interpreter = optarg; |