This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Problems with building ia64 big endian code on FreeBSD
- From: Dietmar Hahn <dietmar dot hahn at fujitsu-siemens dot com>
- To: Jim Wilson <wilson at specifixinc dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 15 Jul 2004 08:43:10 +0200
- Subject: Re: Problems with building ia64 big endian code on FreeBSD
- Organization: FSC EP SW ST
- References: <200407091149.24439.dietmar.hahn@fujitsu-siemens.com> <1089516303.31944.4.camel@localhost>
- Reply-to: dietmar dot hahn at fujitsu-siemens dot com
Am Sonntag, 11. Juli 2004 05:25 schrieb Jim Wilson:
> On Fri, 2004-07-09 at 02:49, Dietmar Hahn wrote:
> > With try and error I looked through the sources in the bfd directory and
> > found the function elf64_ia64_install_value() in the file elf64-ia64.c
> > I saw that for bfd_get_64() and bfd_put_64() the functions bfd_getb64()
> > and bfd_putb64() were used. I changed this to bfd_getl64() and
> > bfd_putl64() only for the instruction relocations and after new compiling
> > ld I got the right code.
>
> Here is the patch I came up with. It is pretty big, but it is mostly
> mechanical. I changed bfd_get_64 to bfd_getl64 and bfd_put_64 to
> bfd_putl64 when they were used for the text section, as the text section is
> always little endian. That made the abfd arguments unnecessary for 3
> functions, and fixing this led to cascading changes that made it a big
> patch.
>
> The only bfd_{get,put}_64 calls left are in set_got_entry, set_fptr_entry,
> and set_pltoff_entry. I believe these are all correct, as there are all
> writing data into the GOT, and hence need to depend on the current object
> file's endianness.
>
> Since I don't have access to any big-endian IA-64 system with a working GNU
> ld port, I don't have any good way to test this. The ia64-hpux target is
> the only big-endian IA-64 target we support, and it has no ld port as yet.
>
> This works correctly for your testcase.
>
> For good measure, I tested this with a gcc bootstrap and make check.
> libstdc++ fails to build unfortunately, a result of HJ's recent patch to
> make ld complain about references to symbol is deleted linkonce sections.
> Otherwise everything was fine.
>
Hi,
I checked in your patch in the ld sources of binutils-2.15 and the ld now
generates fine code for all of my test cases.
Many thanks again for the fast und running fix.
Dietmar.