]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix building objcopy under mingw64
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Wed, 25 Nov 2015 06:29:00 +0000 (14:29 +0800)
committerThomas Preud'homme <thomas.preudhomme@arm.com>
Wed, 25 Nov 2015 06:30:10 +0000 (14:30 +0800)
2015-11-25  Tejas Belagod  <tejas.belagod@arm.com>

    Backport from mainline:
    2015-11-20  Ronald Hoogenboom  <hoogenboom30@zonnet.nl>

    * objcopy.c (parse_symflags): Use xstrndup in place of strndup.
    (copy_main): Likewise.

binutils/ChangeLog
binutils/objcopy.c

index caff375d7d658d3cc509699b36aa4a3b16ea489c..99b3f084a4ed7d568ffccb9ab5d596aa6ded4baf 100644 (file)
@@ -1,3 +1,11 @@
+2015-11-25  Tejas Belagod  <tejas.belagod@arm.com>
+
+       Backport from mainline:
+       2015-11-20  Ronald Hoogenboom  <hoogenboom30@zonnet.nl>
+
+       * objcopy.c (parse_symflags): Use xstrndup in place of strndup.
+       (copy_main): Likewise.
+
 2015-11-20  Nick Clifton  <nickc@redhat.com>
 
        * po/ca.po: New Catalan translation.
index 0ff85251e59da6045d870ca01981008c8e333bb8..4a9f043d2ecb961160d492c922005bb154bbd88b 100644 (file)
@@ -771,7 +771,7 @@ parse_symflags (const char *s, char **other)
 
 #define PARSE_OTHER(fname,fval)                                                                   \
       else if (len >= (int) sizeof fname && strncasecmp (fname, s, sizeof fname - 1) == 0) \
-       fval = strndup (s + sizeof fname - 1, len - sizeof fname + 1)
+       fval = xstrndup (s + sizeof fname - 1, len - sizeof fname + 1)
       
       if (0) ;
       PARSE_FLAG ("local", BSF_LOCAL);
@@ -4082,10 +4082,10 @@ copy_main (int argc, char *argv[])
              fatal (_("bad format for %s"), "--add-symbol");
            t = strchr (s + 1, ':');
 
-           newsym->symdef = strndup (optarg, s - optarg);
+           newsym->symdef = xstrndup (optarg, s - optarg);
            if (t)
              {
-               newsym->section = strndup (s + 1, t - (s + 1));
+               newsym->section = xstrndup (s + 1, t - (s + 1));
                newsym->symval = strtol (t + 1, NULL, 0);
              }
            else