This is the mail archive of the binutils@sources.redhat.com 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]

Re: [PATCH] Handle > 2GB objects in strings, speed it up


Hi Jakub,

> I've fixed my strings patch I posted recently and made it portable
> (I didn't want to use largefile.m4 because I don't think any program in
> binutils but strings need to be LFS in the near future).
> Ok to commit?

The patch looks good to me.  So yes, please do commit it.  There are a
couple of comments I would like to make, however:

> -      stream = fopen (file, "rb");
> +      stream = file_open (file, "rb");
>        /* Not all systems permit "rb", so try "r" if it failed.  */
>        if (stream == NULL)
> -	stream = fopen (file, "r");
> +	stream = file_open (file, "r");

Wouldn't it be a good idea to make use of the FOPEN_RB and FOPEN_RT
macros here ?

> +#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
> +	    if (sizeof (start) > sizeof (long))
> +	      printf ("%7Lo ", (unsigned long long) start);
> +	    else
> +#else
> +# if !BFD_HOST_64BIT_LONG
> +	    if (start != (unsigned long) start)
> +	      printf ("++%7lo ", (unsigned long) start);
> +	    else
> +# endif
> +#endif

Since this section of code is used in several places, wouldn't it be a
good idea to replace it with a macro ?  [Well there are slight
variations, but these could be handled by the macro].

Cheers
        Nick


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