This is the mail archive of the binutils@sourceware.cygnus.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: readelf breakage.


Ian Lance Taylor wrote:

> According to bfd/configure.host, the MS compiler supports the type
> __int64.  Is this true?

Yes.
> 
> What procedure do you use to configure the tools when using the native
> MS compiler?  Is there any way to make that procedure define
> HOST_64BIT_TYPE and HOST_U_64BIT_TYPE correctly in bfd.h?

It's possible, and I've done it, but it's quite messy because
the existence of an alternate name violates a lot of tacit
assumptions (or did last I looked), so it's a lot of ifdefs
to get it to work, for 0 (none, nada) return except to get it
to compile.
> 
>    The readelf command is also useless in this environment, but as
>    long as it builds, it's not worth the brain cycles to try to save
>    the machine cycles.
> 
>    However, with the patch:
>    1999-06-04  Nick Clifton  <nickc@cygnus.com>
> 
>            * readelf.c: Add support for 64bit ELF files.
> 
>    readelf.c no longer builds because the 64-bit stuff doesn't
>    work on the MS compiler.  (I just got around to updating to the
>    latest stuff.)
> 
>    Removing the #define BFD64 cures the problem so it will build.
>    I don't care if it executes.
> 
> In any case, I don't think Nick's patch is correct.  It presumes that
> there is always a 64 bit type, which is not true in all cases.
> 
> Nick, I think we need to make that patch conditional somehow.  For
> example, for most people, it would suffice to make it conditional on
> ``__GNUC__ >= 2''; that would mean that readelf would support 64 bit
> ELF hosts when using gcc or when configured for a 64 bit target.
> However, we might need more conditionals in readelf.c itself.
> 
> You should be able to test the patch by using a native compiler on a
> host for which configure.host does not record a 64 bit type, such as
> SunOS or Irix 5 or HP/UX.

Just the conditional is probably enough; all it took was to
comment out the one line to get it to compile.  (There's still
the open question as to whether it's even worth building
on COFF, SOM, and other non-ELF systems.)

Donn

-- 

===================================================
Donn Terry                  mailto:donn@interix.com
Softway Systems, Inc.        http://www.interix.com
2850 McClelland Dr, Ste. 1800   Ft.Collins CO 80525
Tel: +1-970-204-9900           Fax: +1-970-204-9951
===================================================

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