Bad linker behaviour

ian@cygnus.com ian@cygnus.com
Wed Oct 8 14:47:00 GMT 1997


In gnu-win32 jont@harlequin.co.uk (Jon Thackray) writes:

>This means that all link failures will report the actual symbol name,
>which may not be so good for C++ but will work better for all other
>users of ld. If ld is invoked standalone, this is definitely the way
>it should behave (I also object to it stripping a leading _ from the
>names it reports, this is making an assumption that the object files
>I've linked have come from a C compiler which is untrue in my case).
>If ld wishes to be more sophisticated in the cases where it is invoked
>from gcc or g++, then it should be given additional command line
>information requesting this behaviour, rather than doing this by
>default.

The normal case of using the linker is for C and C++ programs.  When
linking such programs, the linker should report symbols using names
that are meaningful for C and C++.

I would have no objection in principle to making this depend upon a
command line option.  Unfortunately, compilers traditionally do not
pass any such command line option.  gcc must work with either a native
Unix linker or the GNU linker.  It can not pass a command line option
that will only be understood by the GNU linker.  Therefore, I don't
see any way to make this work correctly based on a command line
option.

My conclusion is the reverse of yours: we should provide a command
line option which turns off the symbol name demangling.

Ian
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list