This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/4424: Can't link in Linux object files on FreeBSD
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: "H.J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 16 Oct 2007 09:40:49 +0930
- Subject: Re: PATCH: PR ld/4424: Can't link in Linux object files on FreeBSD
- References: <20071015171240.GA32237@lucon.org>
On Mon, Oct 15, 2007 at 10:12:40AM -0700, H.J. Lu wrote:
> + obed = xvec_get_elf_backend_data (htab->root.creator);
> if (! dynamic
> && is_elf_hash_table (htab)
> - && htab->root.creator == abfd->xvec
> + && (htab->root.creator == abfd->xvec
> + || ((obed->arch == bed->arch)
> + && obed->always_check_relocs_in_object_file
> + && bed->always_check_relocs_in_object_file))
Instead of adding always_check_relocs_in_object_file, I'd suggest
adding a predicate function, dynamic_relocs_compatible. The default
ELF version would be:
_bfd_elf_dynamic_relocs_compatible (const bfd_target *otarg,
const bfd_target *itarg)
{
return otarg == itarg;
}
The x86 version could check that ibed->dynamic_relocs_compatible
== obed->dynamic_relocs_compatible.
--
Alan Modra
Australia Development Lab, IBM