public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Tejas Belagod" <tejas.belagod@foss.arm.com>
To: "'Tristan Gingold'" <gingold@adacore.com>
Cc: <binutils@sourceware.org>
Subject: RE: [PATCH] 'add symbol' feature in objcopy
Date: Mon, 23 Nov 2015 14:53:00 -0000	[thread overview]
Message-ID: <002601d125fe$abfa17f0$03ee47d0$@foss.arm.com> (raw)
In-Reply-To: <394E2D21-65A6-4760-BDAE-852D5EFBBF5A@adacore.com>

[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]



> -----Original Message-----
> From: Tristan Gingold [mailto:gingold@adacore.com]
> Sent: 20 November 2015 15:38
> To: Tejas Belagod
> Cc: binutils@sourceware.org
> Subject: Re: [PATCH] 'add symbol' feature in objcopy
> 
> 
> > On 20 Nov 2015, at 16:29, Tejas Belagod <tejas.belagod@foss.arm.com>
> wrote:
> >
> > Hi Tristian,
> >
> > Is this patch OK to backport to 2.26?
> 
> Sure.
> 
> Tristan.
> >

Thanks. Here is the backport built and tested arm-none-eabi for mingw and
linux.

I don't have commit rights to binutils. Please could someone who does,
commit this?

binutils/ChangeLog

2015-11-23  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.

Thanks,
Tejas.


> > Thanks,
> > Tejas.
> >
> >> -----Original Message-----
> >> From: Tejas Belagod [mailto:tejas.belagod@foss.arm.com]
> >> Sent: 20 November 2015 14:44
> >> To: 'Nick Clifton'; 'Ronald Hoogenboom'
> >> Cc: binutils@sourceware.org
> >> Subject: RE: [PATCH] 'add symbol' feature in objcopy
> >>
> >> Nick,
> >>
> >> Is this OK to backport to 2.26?
> >>
> >> Thanks,
> >> Tejas.
> >>
> >>>
> >>> -----Original Message-----
> >>> From: binutils-owner@sourceware.org [mailto:binutils-
> >>> owner@sourceware.org] On Behalf Of Nick Clifton
> >>> Sent: 20 November 2015 14:10
> >>> To: Ronald Hoogenboom; fracting@gmail.com
> >>> Cc: binutils@sourceware.org
> >>> Subject: Re: [PATCH] 'add symbol' feature in objcopy
> >>>
> >>> Hi Ronald,
> >>>
> >>>> Apparently, the strndup function is not 'portable' enough for mingw-
> w64.
> >>>> There seems to be a xstrndup function in libiberty that could be used
> >>>> instead. I'm sorry I don't have all the possible compilers handy to
> >>>> verify all possible targets, but this should do.
> >>>
> >>> Thanks - I have gone ahead and checked this patch in along with the
> >>> following copyright notice.
> >>>
> >>> Cheers
> >>>   Nick
> >>>
> >>> binutils/ChangeLog
> >>> 2015-11-20  Ronald Hoogenboom  <hoogenboom30@zonnet.nl>
> >>>
> >>>        * objcopy.c (parse_symflags): Use xstrndup in place of strndup.
> >>>        (copy_main): Likewise.
> >>>
> >>>
> >
> >


[-- Attachment #2: objcopy-226.txt --]
[-- Type: text/plain, Size: 1005 bytes --]

diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 0ff8525..4a9f043 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -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

  reply	other threads:[~2015-11-23 14:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13 18:04 Ronald Hoogenboom
2015-11-03 13:04 ` Qian Hong
2015-11-03 22:08   ` Ronald Hoogenboom
2015-11-03 22:22     ` Qian Hong
2015-11-20 14:10     ` Nick Clifton
     [not found]       ` <DB3PR08MB0124FB69478D89165CD05F8CEA1A0@DB3PR08MB0124.eurprd08.prod.outlook.com>
2015-11-20 14:44         ` Tejas Belagod
2015-11-20 15:29         ` Tejas Belagod
2015-11-20 15:37           ` Tristan Gingold
2015-11-23 14:53             ` Tejas Belagod [this message]
2015-11-24  9:53               ` Tejas Belagod
2015-11-24 10:13                 ` Tristan Gingold
     [not found]         ` <000b01d123a1$9ff4ea70$dfdebf50$@foss.arm.com>
2015-11-20 15:30           ` Nick Clifton
2015-11-20 19:25       ` Ronald Hoogenboom
2015-11-04  4:07 ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002601d125fe$abfa17f0$03ee47d0$@foss.arm.com' \
    --to=tejas.belagod@foss.arm.com \
    --cc=binutils@sourceware.org \
    --cc=gingold@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).