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 0/3] binutils: read from stdin if input file is -


> On 20Feb 2018, at 15:31, Nick Clifton <nickc@redhat.com> wrote:
> 
> Hi Ahmad,
> 
>> Changes behavior of dlltool, nlmconv, nm, objcopy, objdump and size
>> to allow niftiness like:
>> 
>>    printf "\xCC" | objdump -D -bbinary -mi386 -
>> 
>> Affects the layout of struct bfd as well. Is this ok?
> 
> Yes, but I would like to request a couple of additions:
> 
>  * Please add a patch to the binutils/NEWS file to mention
>    this new behaviour.
> 
>  * Please update the binutils/doc/binutils.texi file to
>    document the new behaviour.
Will do.

> 
>  * It would be really nice if you could create a new test
>    (or two) in the binutils testsuite to verify that the
>    new behaviour works.  I am not sure how difficult this
>    will be however.
Will see what I can do.

> 
> One other thing.  In patch 1:
> 
> +      XDELETEVEC ((char *) abfd->temp_filename);
> 
> I think it would be nicer to just use free() here, rather
> than XDELETEVEC, since make_temp_name does just return a malloc'ed
> buffer.
As make_temp_name uses XNEWVEC I thought it'd be safer to use its XDELETEVEC counterpart (which is, for now!, #defined as free),
but I can change it.

> Speaking of which:
> 
> +          nbfd->temp_filename = make_temp_file (NULL);
> 
> You need to check to see if make_temp_file() returned NULL here...
make_temp_file aborts the process (via xmalloc) if it fails to allocate, so NULL check is superfluous.

Cheers
Ahmad

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