aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@tuliptree.org>2004-06-30 20:23:23 +0000
committerJim Wilson <wilson@tuliptree.org>2004-06-30 20:23:23 +0000
commit21a8f7fa66f0a6487f82b170d45cd55d9235f81a (patch)
treebee49153992d3c4a2010628d94b8ce00993c3886
parent1a6923e0319d4ede81d2d821d8a84bb97113b071 (diff)
downloadgdb-21a8f7fa66f0a6487f82b170d45cd55d9235f81a.zip
gdb-21a8f7fa66f0a6487f82b170d45cd55d9235f81a.tar.gz
gdb-21a8f7fa66f0a6487f82b170d45cd55d9235f81a.tar.bz2
Fix @pltoff linker segfault for non-shared link.
* elfxx-ia64.c (elfNN_ia64_check_relocs): New local pltoff. Initialize to NULL. Call get_pltoff if NULL and NEED_PLTOFF is true.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-ia64.c17
2 files changed, 19 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 464821d..11bed97 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-30 James E Wilson <wilson@specifixinc.com>
+
+ * elfxx-ia64.c (elfNN_ia64_check_relocs): New local pltoff. Initialize
+ to NULL. Call get_pltoff if NULL and NEED_PLTOFF is true.
+
2004-06-30 H.J. Lu <hongjiu.lu@intel.com>
PR 233
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index d8c4b57..37b0d24 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -2248,7 +2248,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
const Elf_Internal_Rela *relend;
Elf_Internal_Shdr *symtab_hdr;
const Elf_Internal_Rela *rel;
- asection *got, *fptr, *srel;
+ asection *got, *fptr, *srel, *pltoff;
if (info->relocatable)
return TRUE;
@@ -2256,7 +2256,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
ia64_info = elfNN_ia64_hash_table (info);
- got = fptr = srel = NULL;
+ got = fptr = srel = pltoff = NULL;
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; ++rel)
@@ -2507,7 +2507,18 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
if (need_entry & NEED_FULL_PLT)
dyn_i->want_plt2 = 1;
if (need_entry & NEED_PLTOFF)
- dyn_i->want_pltoff = 1;
+ {
+ /* This is needed here, in case @pltoff is used in a non-shared
+ link. */
+ if (!pltoff)
+ {
+ pltoff = get_pltoff (abfd, info, ia64_info);
+ if (!pltoff)
+ return FALSE;
+ }
+
+ dyn_i->want_pltoff = 1;
+ }
if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC))
{
if (!srel)