aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-08-03 15:50:51 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-08-03 15:50:51 +0000
commit004fb7809c1678fd59adf414497f6382e9344415 (patch)
tree6e90e8441964d4d5620dd439ad73bf704aa36895 /bfd
parent92fac5ecb0b23133848395b9883f3dede959142e (diff)
downloadgdb-004fb7809c1678fd59adf414497f6382e9344415.zip
gdb-004fb7809c1678fd59adf414497f6382e9344415.tar.gz
gdb-004fb7809c1678fd59adf414497f6382e9344415.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf-ifunc.c7
2 files changed, 11 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 74c6032..4107449 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2009-08-03 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (struct plt_entry): Revise comments.
diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c
index b9b50c3..0de236f 100644
--- a/bfd/elf-ifunc.c
+++ b/bfd/elf-ifunc.c
@@ -185,6 +185,8 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
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 (struct bfd_link_info *info,
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 (struct bfd_link_info *info,
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)