This is the mail archive of the binutils@sourceware.org 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: Size of long in x64 Windows based binutils?


Thanks Nick for answering,
The problem is while it's easy to compile binutils for Interix, the
utilities cannot do anything useful. So there is a configuration problem
somewhere. I basically used the mingw x64 port and thought maybe some
structures that use DWORD were promoted to LP64 longs (long long in 64bit),
which is wrong - they must be 32bit. I don't know if the mingw x64 port use
LP64 but I doubt it since Windows use the LLP64 data model. I found at least
one structure that is conflicting:
include/coff/internal.h(101)
typedef struct _IMAGE_DATA_DIRECTORY 
{
  bfd_vma VirtualAddress;
  long    Size;
}  IMAGE_DATA_DIRECTORY;
Both members are DWORD in the NT headers. Since my bfd_vma and long have a
size of 8, the structure is twice as big as it should be! Can't tell the
impact of this though. It's also tedious to compare the structures because
some seems to be renamed in binutils. I guess it means one need to
completely understand the binutils implementation to actually be able to
correct this (aargh). 

> PE data structures are all defined in terms of a fixed number of bytes.
> (See include/coff/external.h).
OK, they use char- fine!

cheers
Jerker




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