This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: Make xdata symbol name unique


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]