* ar.c (print_contents): Cast args of bfd_seek to the right types.

Replace bfd_read call with call to bfd_bread.
	(extract_file): Likewise.

	* objdump.c (dump_section_header): Cast section->filepos to
	unsigned long to suit printf format string.
	* readelf.c (process_section_headers): Similarly for sh_offset.
	(process_unwind): Likewise.
This commit is contained in:
Alan Modra
2001-09-18 10:05:55 +00:00
parent 17c1c87fca
commit e59b4dfbd2
4 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,14 @@
2001-09-18 Alan Modra <amodra@bigpond.net.au>
* ar.c (print_contents): Cast args of bfd_seek to the right types.
Replace bfd_read call with call to bfd_bread.
(extract_file): Likewise.
* objdump.c (dump_section_header): Cast section->filepos to
unsigned long to suit printf format string.
* readelf.c (process_section_headers): Similarly for sh_offset.
(process_unwind): Likewise.
2001-09-14 Nick Clifton <nickc@cambridge.redhat.com> 2001-09-14 Nick Clifton <nickc@cambridge.redhat.com>
* strings.c (encoding, encoding_bytes): New variables. * strings.c (encoding, encoding_bytes): New variables.

View File

@ -1,5 +1,6 @@
/* ar.c - Archive modify and extract. /* ar.c - Archive modify and extract.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GNU Binutils. This file is part of GNU Binutils.
@ -827,7 +828,7 @@ print_contents (abfd)
/* xgettext:c-format */ /* xgettext:c-format */
printf (_("\n<member %s>\n\n"), bfd_get_filename (abfd)); printf (_("\n<member %s>\n\n"), bfd_get_filename (abfd));
bfd_seek (abfd, 0, SEEK_SET); bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
size = buf.st_size; size = buf.st_size;
while (ncopied < size) while (ncopied < size)
@ -838,8 +839,7 @@ print_contents (abfd)
if (tocopy > BUFSIZE) if (tocopy > BUFSIZE)
tocopy = BUFSIZE; tocopy = BUFSIZE;
nread = bfd_read (cbuf, 1, tocopy, abfd); /* oops -- broke nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
abstraction! */
if (nread != tocopy) if (nread != tocopy)
/* xgettext:c-format */ /* xgettext:c-format */
fatal (_("%s is not a valid archive"), fatal (_("%s is not a valid archive"),
@ -883,7 +883,7 @@ extract_file (abfd)
if (verbose) if (verbose)
printf ("x - %s\n", bfd_get_filename (abfd)); printf ("x - %s\n", bfd_get_filename (abfd));
bfd_seek (abfd, 0, SEEK_SET); bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
ostream = NULL; ostream = NULL;
if (size == 0) if (size == 0)
@ -907,7 +907,7 @@ extract_file (abfd)
if (tocopy > BUFSIZE) if (tocopy > BUFSIZE)
tocopy = BUFSIZE; tocopy = BUFSIZE;
nread = bfd_read (cbuf, 1, tocopy, abfd); nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
if (nread != tocopy) if (nread != tocopy)
/* xgettext:c-format */ /* xgettext:c-format */
fatal (_("%s is not a valid archive"), fatal (_("%s is not a valid archive"),

View File

@ -287,7 +287,7 @@ dump_section_header (abfd, section, ignored)
bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section)); bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section));
printf (" "); printf (" ");
bfd_printf_vma (abfd, section->lma); bfd_printf_vma (abfd, section->lma);
printf (" %08lx 2**%u", section->filepos, printf (" %08lx 2**%u", (unsigned long) section->filepos,
bfd_get_section_alignment (abfd, section)); bfd_get_section_alignment (abfd, section));
if (! wide_output) if (! wide_output)
printf ("\n "); printf ("\n ");

View File

@ -3085,7 +3085,7 @@ process_section_headers (file)
{ {
putchar (' '); putchar (' ');
print_vma (section->sh_addr, LONG_HEX); print_vma (section->sh_addr, LONG_HEX);
printf (" %8.8lx", section->sh_offset); printf (" %8.8lx", (unsigned long) section->sh_offset);
printf ("\n "); printf ("\n ");
print_vma (section->sh_size, LONG_HEX); print_vma (section->sh_size, LONG_HEX);
printf (" "); printf (" ");
@ -3650,7 +3650,7 @@ process_unwind (file)
printf ("'%s'", SECTION_NAME (unwsec)); printf ("'%s'", SECTION_NAME (unwsec));
printf (_(" at offset 0x%lx contains %lu entries:\n"), printf (_(" at offset 0x%lx contains %lu entries:\n"),
unwsec->sh_offset, (unsigned long) unwsec->sh_offset,
(unsigned long) (unwsec->sh_size / (3 * addr_size))); (unsigned long) (unwsec->sh_size / (3 * addr_size)));
(void) slurp_ia64_unwind_table (file, & aux, unwsec); (void) slurp_ia64_unwind_table (file, & aux, unwsec);