This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Handle > 2GB objects in strings, speed it up
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [PATCH] Handle > 2GB objects in strings, speed it up
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 26 Oct 2001 10:11:01 +0100
- Cc: binutils at sources dot redhat dot com
- References: <20011025201803.D846@sunsite.ms.mff.cuni.cz>
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