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]

binutils changes for the bfd/ cleanup


binutils/ChangeLog
	* 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.

Index: binutils/ar.c
===================================================================
RCS file: /cvs/src/src/binutils/ar.c,v
retrieving revision 1.19
diff -u -p -w -r1.19 ar.c
--- ar.c	2001/03/13 06:43:56	1.19
+++ ar.c	2001/09/17 09:28:04
@@ -827,7 +827,7 @@ print_contents (abfd)
     /* xgettext:c-format */
     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;
   while (ncopied < size)
@@ -838,8 +838,7 @@ print_contents (abfd)
       if (tocopy > BUFSIZE)
 	tocopy = BUFSIZE;
 
-      nread = bfd_read (cbuf, 1, tocopy, abfd);	/* oops -- broke
-							   abstraction!  */
+      nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
       if (nread != tocopy)
 	/* xgettext:c-format */
 	fatal (_("%s is not a valid archive"),
@@ -883,7 +882,7 @@ extract_file (abfd)
   if (verbose)
     printf ("x - %s\n", bfd_get_filename (abfd));
 
-  bfd_seek (abfd, 0, SEEK_SET);
+  bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
 
   ostream = NULL;
   if (size == 0)
@@ -907,7 +906,7 @@ extract_file (abfd)
 	if (tocopy > BUFSIZE)
 	  tocopy = BUFSIZE;
 
-	nread = bfd_read (cbuf, 1, tocopy, abfd);
+	nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
 	if (nread != tocopy)
 	  /* xgettext:c-format */
 	  fatal (_("%s is not a valid archive"),
Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.40
diff -u -p -w -r1.40 objdump.c
--- objdump.c	2001/08/10 16:43:18	1.40
+++ objdump.c	2001/09/17 09:28:06
@@ -287,7 +287,7 @@ dump_section_header (abfd, section, igno
   bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section));
   printf ("  ");
   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));
   if (! wide_output)
     printf ("\n                ");
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.119
diff -u -p -w -r1.119 readelf.c
--- readelf.c	2001/09/12 23:53:45	1.119
+++ readelf.c	2001/09/17 09:28:12
@@ -3085,7 +3085,7 @@ process_section_headers (file)
 	{
 	  putchar (' ');
 	  print_vma (section->sh_addr, LONG_HEX);
-	  printf ("  %8.8lx", section->sh_offset);
+	  printf ("  %8.8lx", (unsigned long) section->sh_offset);
 	  printf ("\n       ");
 	  print_vma (section->sh_size, LONG_HEX);
 	  printf ("  ");
@@ -3650,7 +3650,7 @@ process_unwind (file)
 	    printf ("'%s'", SECTION_NAME (unwsec));
 
 	  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)));
 
 	  (void) slurp_ia64_unwind_table (file, & aux, unwsec);


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