This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/10433: Latest ld fails to link ldconfig properly
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sources dot redhat dot com
- Date: Mon, 3 Aug 2009 08:52:05 -0700
- Subject: Re: PATCH: PR ld/10433: Latest ld fails to link ldconfig properly
- References: <20090731040504.GA13104@lucon.org> <20090803143553.GL14121@bubble.grove.modra.org>
On Mon, Aug 3, 2009 at 7:35 AM, Alan Modra<amodra@bigpond.net.au> wrote:
> On Thu, Jul 30, 2009 at 09:05:04PM -0700, H.J. Lu wrote:
>> ? ? ? ?PR ld/10433
>> ? ? ? ?* elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Also set
>> ? ? ? ?plt.offset to -1 when discarding space for dynamic
>> ? ? ? ?relocations.
>>
>> Index: bfd/elf-ifunc.c
>> ===================================================================
>> --- bfd/elf-ifunc.c ? (revision 6507)
>> +++ bfd/elf-ifunc.c ? (working copy)
>> @@ -193,6 +193,7 @@ _bfd_elf_allocate_ifunc_dyn_relocs (stru
>> ? ? ? ? || h->got.refcount > 0)
>> ? ? ? abort ();
>> ? ? ? ?h->got.offset = (bfd_vma) -1;
>> + ? ? ?h->plt.offset = (bfd_vma) -1;
>> ? ? ? ?*head = NULL;
>> ? ? ? ?return TRUE;
>> ? ? ?}
>
> These should probably be
>
> ? ? ?h->got = htab->init_got_offset;
> ? ? ?h->plt = htab->init_plt_offset;
>
> OK with that change.
>
This is what I checked in.
Thanks.
--
H.J.
--
2009-08-03 H.J. Lu <hongjiu.lu@intel.com>
PR ld/10433
* elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Set got
to htab->init_got_offset and plt to htab->init_plt_offset
when discarding space for dynamic relocations.
Index: elf-ifunc.c
===================================================================
--- elf-ifunc.c (revision 6507)
+++ elf-ifunc.c (working copy)
@@ -185,6 +185,8 @@ _bfd_elf_allocate_ifunc_dyn_relocs (stru
return FALSE;
}
+ htab = elf_hash_table (info);
+
/* Return and discard space for dynamic relocations against it if
it is never referenced in a non-shared object. */
if (!h->ref_regular)
@@ -192,7 +194,8 @@ _bfd_elf_allocate_ifunc_dyn_relocs (stru
if (h->plt.refcount > 0
|| h->got.refcount > 0)
abort ();
- h->got.offset = (bfd_vma) -1;
+ h->got = htab->init_got_offset;
+ h->plt = htab->init_plt_offset;
*head = NULL;
return TRUE;
}
@@ -203,8 +206,6 @@ _bfd_elf_allocate_ifunc_dyn_relocs (stru
else
sizeof_reloc = bed->s->sizeof_rel;
- htab = elf_hash_table (info);
-
/* When building a static executable, use .iplt, .igot.plt and
.rel[a].iplt sections for STT_GNU_IFUNC symbols. */
if (htab->splt != NULL)