[patch]: Make xdata symbol name unique
Kai Tietz
ktietz70@googlemail.com
Fri Aug 27 08:51:00 GMT 2010
2010/8/27 Nick Clifton <nickc@redhat.com>:
> Hi Kai,
>
>> * config/obj-coff-seh.c (seh_max_xlbl_name): More
>> unique name generation.
>> (make_seh_text_label): Likewise.
>>
>> Tested for x86_64-w64-mingw32. Ok for apply?
>
> I may be going mad here, but this looks wrong to me:
>
> + as_where (&filename, &lineno);
> + len = strlen (".seh_xlbl_") + strlen (c->func_name) + 9 + strlen
> (filename) + 1 + 9 + 1;
> + ret = (char*) xmalloc (len);
> if (!ret)
> as_fatal (_("Out of memory for xdata lable for %s"), c->func_name);
> - else
> - sprintf (ret, ".seh_xlbl_%s_%x", c->func_name, + c->xlbl_count);
> + sprintf (ret, ".seh_xlbl_%s_%x_%s_%x", c->func_name, + c->xlbl_count,
> filename, lineno);
> + while ((filename = strchr (ret, '\\')) != NULL)
> + *filename = '.';
> + while ((filename = strchr (ret, '/')) != NULL)
> + *filename = '.';
> + while ((filename = strchr (ret, ':')) != NULL)
> + *filename = '.';
>
> Shouldn't the while loops be replacing characters inside the ret buffer and
> not the filename returned by as_where() ?
>
> Cheers
> Nick
>
Well, the while loop is fine as I use here filename as intermediate
pointer. But as Richard is up to provide a complete rewrite of this
file, I withdraw this patch. We are testing his changes at the moment
and I expect that he will sent updated version soon.
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
More information about the Binutils
mailing list