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/gas]: Check basename declaration for IVMS cross assembler



On Sep 3, 2009, at 2:11 PM, Alan Modra wrote:


On Thu, Sep 03, 2009 at 10:47:28AM +0200, Tristan Gingold wrote:
when configured for itanium VMS, tc-ia64.c calls basename().  But
libiberty.h requires to check for its
declaration.  This patch add the check in gas configure.in

Instead, please use lbasename in tc-ia64.c.

Ah, thanks. Is this patch OK ? (I have also remarked that the buffer wasn't freed).

Tristan.

gas/
2009-09-03  Tristan Gingold  <gingold@adacore.com>

	* config/tc-ia64.c (ia64_vms_note): Use lbasename instead of basename.
	Call xstrdup on the result and free the buffer after use.

Index: config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.208
diff -c -r1.208 tc-ia64.c
*** config/tc-ia64.c	29 Aug 2009 22:10:59 -0000	1.208
--- config/tc-ia64.c	3 Sep 2009 12:55:20 -0000
***************
*** 11667,11673 ****
    subsegT subseg = now_subseg;
    Elf_Internal_Note i_note;
    asection *secp = NULL;
!   char *basec, *bname;
    char buf [256];
    symbolS *sym;

--- 11667,11673 ----
    subsegT subseg = now_subseg;
    Elf_Internal_Note i_note;
    asection *secp = NULL;
!   char *bname;
    char buf [256];
    symbolS *sym;

***************
*** 11679,11686 ****
  			 SEC_HAS_CONTENTS | SEC_READONLY);
!   basec = xstrdup (out_file_name);
!   bname = basename (basec);
    if ((p = strrchr (bname, '.')))
      *p = '\0';

--- 11679,11685 ----
  			 SEC_HAS_CONTENTS | SEC_READONLY);

    /* Module header note.  */
!   bname = xstrdup (lbasename (out_file_name));
    if ((p = strrchr (bname, '.')))
      *p = '\0';

***************
*** 11709,11714 ****
--- 11708,11714 ----

    p = frag_more (strlen (bname) + 1);
    strcpy (p, bname);
+   free (bname);

    p = frag_more (5);
    strcpy (p, "V1.0");


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