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: Re ld/dlltool - .def file format error


On Fri, Mar 31, 2006 at 05:47:21PM +1200, Danny Smith wrote:
>2006-03-31  Danny Smith  <dannysmith@users.sourceforge.net>
>
>	* deffilep.y (def_image_name): If LIBRARY or NAME statement
>	specifies an empty string, retain the name specified on command
>	line.
>	* ld.texinfo: Document above. 
>
>
>Index: src/ld/deffilep.y
>===================================================================
>RCS file: /cvs/src/src/ld/deffilep.y,v
>retrieving revision 1.21
>diff -c -3 -p -r1.21 deffilep.y
>*** src/ld/deffilep.y	1 Feb 2006 21:28:29 -0000	1.21
>--- src/ld/deffilep.y	31 Mar 2006 05:18:37 -0000
>*************** def_file_add_directive (def_file *my_def
>*** 648,669 ****
>  static void
>  def_image_name (const char *name, int base, int is_dll)
>  {
>!   const char* image_name = lbasename (name);
>!   if (image_name != name)
>!     einfo ("%s:%d: Warning: path components stripped from %s, '%s'\n",
>! 	  def_filename, linenumber, is_dll ? "LIBRARY" : "NAME", name);
>!   if (def->name)
>!     free (def->name);
>!   /* Append the default suffix, if none specified.  */ 
>!    if (strchr (image_name, '.') == 0)
>!      {
>!         const char * suffix = is_dll ? ".dll" : ".exe";
>! 
>!         def->name = xmalloc (strlen (image_name) + strlen (suffix) +
>1);
>!         sprintf (def->name, "%s%s", image_name, suffix);
>!      }
>    else
>!     def->name = xstrdup (image_name);
>    def->base_address = base;
>    def->is_dll = is_dll;
>  }
>--- 648,679 ----
>  static void
>  def_image_name (const char *name, int base, int is_dll)
>  {
>!   if (*name == 0)
>!     /* A LIBRARY or NAME statement without a name:  Nothing to do.
>!        We retain the output filename specified on command line.  */
>!     ;
>    else

Wouldn't it be clearer to just move this comment above the if test and
change the test to

  if (*name)

?

If you agree, then please check that in.  I agree that this is a nice change.

cgf


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