From: wilson Date: Wed, 30 Jun 2004 20:23:23 +0000 (+0000) Subject: Fix @pltoff linker segfault for non-shared link. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=80ef99f47fd0809cab0c58e4c37b9ea659b11160;p=pf3gnuchains%2Fpf3gnuchains3x.git 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 464821dfec..11bed97504 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2004-06-30 James E Wilson + + * 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 PR 233 diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index d8c4b5761b..37b0d24ade 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)