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]
Other format: [Raw text]

Re: [PATCH] Fix objdump output formatting


Alan Modra wrote:
> On Mon, May 20, 2002 at 04:49:15AM +0200, Thiemo Seufer wrote:
> > If I understood the code correctly, all non-ELF targets determine their
> > address size at compile time via BFD64, while ELF targets do this via
> > their backend data.
> 
> Uh, OK.  I didn't look far enough.
> 
> > 	/binutils/ChangeLog
> > 	* objdump.c (dump_headers): Fix output formatting for ELF32
> > 	architectures in a BFD64 enabled toolchain.
> 
> OK then, except that bfd_get_arch_size will call bfd_set_error on
> non-ELF targets.  I think calling bfd_set_error is wrong.  A patch to
> remove the bfd_set_error call is pre-approved.

I checked in this patch.


Thiemo


2002-05-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/binutils/ChangeLog
	* objdump.c (dump_headers): Fix output formatting for ELF32
	architectures in a BFD64 enabled toolchain.

	/bfd/ChangeLog
	* bfd/bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
	non-ELF targets.


diff -BurpNX /bigdisk/src/dontdiff source-orig/binutils/objdump.c source/binutils/objdump.c
--- source-orig/binutils/objdump.c	Sat Feb  2 12:53:28 2002
+++ source/binutils/objdump.c	Mon May 20 03:19:03 2002
@@ -361,7 +361,11 @@ dump_headers (abfd)
 #ifndef BFD64
   printf (_("Idx Name          Size      VMA       LMA       File off  Algn"));
 #else
-  printf (_("Idx Name          Size      VMA               LMA               File off  Algn"));
+  /* With BFD64, non-ELF returns -1 and wants always 64 bit addresses.  */
+  if (bfd_get_arch_size (abfd) == 32)
+    printf (_("Idx Name          Size      VMA       LMA       File off  Algn"));
+  else
+    printf (_("Idx Name          Size      VMA               LMA               File off  Algn"));
 #endif
 
   if (wide_output)

diff -BurpNX /bigdisk/src/binutils-exclude source-orig/bfd/bfd.c source/bfd/bfd.c
--- source-orig/bfd/bfd.c	Wed Apr 10 18:40:44 2002
+++ source/bfd/bfd.c	Tue May 21 17:55:29 2002
@@ -749,7 +749,6 @@ bfd_get_arch_size (abfd)
   if (abfd->xvec->flavour == bfd_target_elf_flavour)
     return (get_elf_backend_data (abfd))->s->arch_size;
 
-  bfd_set_error (bfd_error_wrong_format);
   return -1;
 }
 


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