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: Patch for bfd/cache.c - explicit cast to void*


2009/3/2 Jerker Bäck <jerker.back@telia.com>:
> You are all right, the function do NOT need and should have an
> explicit cast. Sorry for the fuzz, it was my doing all along.
>
> David Korn's code snippet made me react and I can confirm there
> is a bug. I'm having great difficulties with the size of long in BFD.
> Interix have a LP64 long type - the only PE target with this?
>
> It happens in bfd-in.h:
>
> #define BFD_HOST_64_BI @BFD_HOST_64_BIT@
> typedef @bfd_file_ptr@ file_ptr;
>
> where configure assign the following to Interix:
> BFD_HOST_64_BIT = long
>
> which is correct since we have a LP64 long type. This gives
>
> typedef long file_ptr;
>
> which should be fine. But in practice it is not.
> AFAIK, to get a functional 64bit compile of PE based binutils,
> the long type needs to be 32bit (LLP64 model). So, I turned off
> LP64 and switched to LLP64, => wrong type of file_ptr.
>
> In my cvs source I've replaced all types in bfd*.h with types from
> sys/types.h, so I didn't catch the bug there.
>
> I hope to finally find out why a LP64 compile fails, then all
> this will go away.
>
> thanks
> Jerker
>
>
>
>
>

Ok, I see your problem. W could chang all code using 'unsigned long'
to 'unsigned int' (when 32-bits are meant) and to bfd_vma when address
is meant, or introduce in bfd-in.h an new type for a 32-bit
signed/unsigned scalar.

Cheers,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


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