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]

Re: PATCH: Add bfd_sprintf_vma/bfd_fprintf_vma


On Thu, Aug 09, 2001 at 09:48:18AM -0700, H . J . Lu wrote:
> On Thu, Aug 09, 2001 at 09:26:58AM -0700, Doug Evans wrote:
> > 
> > I'm not sure I'd bubble bfd_elf_*printf_vma up to the top.
> > Why not leave them be internal  implementation details
> > of bfd_*printf_vma?
> 
> You are right. I checked in the following patch.
> 

I checked in the following patch so that we can build it on BFD32.


H.J.
----
2001-08-09  H.J. Lu  <hjl@gnu.org>

	* elf.c (bfd_elf_sprintf_vma): Check ELFCLASS64 only in BFD64.
	(bfd_elf_fprintf_vma): Likewise.

--- /tmp/elf.c	Thu Aug  9 13:38:25 2001
+++ ./elf.c	Thu Aug  9 13:40:29 2001
@@ -5993,6 +5993,7 @@ bfd_elf_sprintf_vma (abfd, buf, value)
      char *buf;
      bfd_vma value;
 {
+#ifdef BFD64
   Elf_Internal_Ehdr *i_ehdrp;	/* Elf file header, internal form */
 
   i_ehdrp = elf_elfheader (abfd);
@@ -6010,6 +6011,9 @@ bfd_elf_sprintf_vma (abfd, buf, value)
       else
 	sprintf (buf, "%08lx", (unsigned long) (value & 0xffffffff));
     }
+#else
+  sprintf_vma (buf, value);
+#endif
 }
 
 void
@@ -6018,6 +6022,7 @@ bfd_elf_fprintf_vma (abfd, stream, value
      PTR stream;
      bfd_vma value;
 {
+#ifdef BFD64
   Elf_Internal_Ehdr *i_ehdrp;	/* Elf file header, internal form */
 
   i_ehdrp = elf_elfheader (abfd);
@@ -6036,4 +6041,7 @@ bfd_elf_fprintf_vma (abfd, stream, value
 	fprintf ((FILE *) stream, "%08lx",
 		 (unsigned long) (value & 0xffffffff));
     }
+#else
+  fprintf_vma ((FILE *) stream, value);
+#endif
 }


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