This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: XCOFF/PE hack removal
- From: Tom Rix <trix at redhat dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 22 Jan 2002 08:51:52 -0600
- Subject: Re: XCOFF/PE hack removal
- References: <20020122091547.GO16187@bubble.sa.bigpond.net.au>
To foo or to .foo? That is the question
Speaking for XCOFF, I'm ok with the change.
You should add powerpc64-elf to the list of targets in the comment.
Tom
Alan Modra wrote:
> I'd like to apply the following so that errors reported when linking
> powerpc64-elf objects discern between a function descriptor symbol
> and it's associated function code symbol, which only differs by a
> leading dot. However, this will affect PE and XCOFF error messages,
> so I'd like an OK from the opposition camp first. If not OK, then
> I'll do something target dependent.
>
> ld/ChangeLog
> * ldmisc.c (demangle): Put back dots when string not demangled.
>
> --
> Alan Modra
> IBM OzLabs - Linux Technology Centre
>
> Index: ld/ldmisc.c
> ===================================================================
> RCS file: /cvs/src/src/ld/ldmisc.c,v
> retrieving revision 1.8
> diff -u -p -r1.8 ldmisc.c
> --- ldmisc.c 2001/09/26 01:55:44 1.8
> +++ ldmisc.c 2002/01/22 09:08:55
> @@ -69,6 +69,7 @@ demangle (string)
> const char *string;
> {
> char *res;
> + int dots = 0;
>
> if (output_bfd != NULL
> && bfd_get_symbol_leading_char (output_bfd) == string[0])
> @@ -78,9 +79,13 @@ demangle (string)
> format. Xcoff has a single '.', while the NT PE for PPC has
> '..'. So we remove all of them. */
> while (string[0] == '.')
> - ++string;
> + {
> + ++dots;
> + ++string;
> + }
>
> res = cplus_demangle (string, DMGL_ANSI | DMGL_PARAMS);
> + string -= dots;
> return res ? res : xstrdup (string);
> }
--
Tom Rix
GCC Engineer
trix@redhat.com