This is the mail archive of the 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]

What does--enable-64-bit-bfd mean anyway? Thinko in bfd-in.h?

    Hi everyone,

  Christian observed an interesting failure mode on the i686-pc-cygwin
(32-bit) target when configured using --enable-64-bit-bfd.  One of the dump
tests fails with this pattern mismatch:

> regexp_diff match failure
> regexp "^Entry 0 00000000 00000000 Export Directory \[\.edata \(or
> where ever we found it\)\]$"
> line   "Entry 0 0000000000000000 00000000 Export Directory [.edata (or
> where ever we found it)]"
> FAIL: Empty export table

  This is very straightforwardly caused by the definition of fprintf_vma
coming from bfd-in.h:

#ifdef BFD64

         [ ... snips ... ]

#ifndef fprintf_vma
#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
         [ ... snips ... ]

#else /* not BFD64  */

         [ ... snips ... ]

#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)

         [ ... snips ... ]

#endif /* not BFD64  */

  This looks like a thinko to me.  Surely the size of a VMA and thus the size
used to print it out in the dump fields should depend on the object file
format in question, or perhaps the target, but certainly not on host
characteristics?  I see this definition:

#if BFD_ARCH_SIZE >= 64
#define BFD64

... which I think means "Turn on 64-bit support if the target format implies
we're going to need it"; does that mean it's a mistake to use
--enable-64-bit-bfd for a 32-bit target (or a collection of --enable-targets
that includes any 32-bit targets)?


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