This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Patch: unbreak the build
- From: Tom Tromey <tromey at redhat dot com>
- To: Binutils Development <binutils at sourceware dot org>
- Date: Wed, 01 Jul 2009 16:29:21 -0600
- Subject: Patch: unbreak the build
- Reply-to: Tom Tromey <tromey at redhat dot com>
Today I tried a --enable-64-bit-bfd --with-mmap build on
x86 F9, using the F9 system gcc.
I saw two compilation failures.
First, bfd_free_window passed a bfd_size_type to a %lx printf format.
Since this is apparently only for debugging, I simply added a cast.
Second, aoutx.h declares amt but does not use it in the USE_MMAP case.
I fixed this by moving amt to a new, more local, block.
Ok?
Tom
2009-07-01 Tom Tromey <tromey@redhat.com>
* aoutx.h (aout_get_external_symbols): Declare 'amt' locally.
* bfdwin.c (bfd_free_window): Cast to unsigned long.
Index: aoutx.h
===================================================================
RCS file: /cvs/src/src/bfd/aoutx.h,v
retrieving revision 1.74
diff -u -r1.74 aoutx.h
--- aoutx.h 3 Feb 2009 18:16:02 -0000 1.74
+++ aoutx.h 1 Jul 2009 21:44:03 -0000
@@ -1,6 +1,6 @@
/* BFD semi-generic back-end for a.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -1294,7 +1294,6 @@
{
bfd_size_type count;
struct external_nlist *syms;
- bfd_size_type amt;
count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE;
if (count == 0)
@@ -1314,13 +1313,16 @@
if (syms == NULL)
return FALSE;
- amt = exec_hdr (abfd)->a_syms;
- if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
- || bfd_bread (syms, amt, abfd) != amt)
- {
- free (syms);
- return FALSE;
- }
+ {
+ bfd_size_type amt;
+ amt = exec_hdr (abfd)->a_syms;
+ if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
+ || bfd_bread (syms, amt, abfd) != amt)
+ {
+ free (syms);
+ return FALSE;
+ }
+ }
#endif
obj_aout_external_syms (abfd) = syms;
Index: bfdwin.c
===================================================================
RCS file: /cvs/src/src/bfd/bfdwin.c,v
retrieving revision 1.11
diff -u -r1.11 bfdwin.c
--- bfdwin.c 20 Nov 2008 09:49:00 -0000 1.11
+++ bfdwin.c 1 Jul 2009 21:44:03 -0000
@@ -1,5 +1,5 @@
/* Support for memory-mapped windows into a BFD.
- Copyright 1995, 1996, 2001, 2002, 2003, 2005, 2007, 2008
+ Copyright 1995, 1996, 2001, 2002, 2003, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -78,7 +78,7 @@
i->refcount--;
if (debug_windows)
fprintf (stderr, "freeing window @%p<%p,%lx,%p>\n",
- windowp, windowp->data, windowp->size, windowp->i);
+ windowp, windowp->data, (unsigned long) windowp->size, windowp->i);
if (i->refcount != 0)
return;