ChangeLog rotatation and copyright year update
[deliverable/binutils-gdb.git] / bfd / elf32-hppa.c
index b7d951b3c5695808e754f263c9941f57c563d3bf..af512a7aa6d59e0615d8fde59d68dee29f06fb64 100644 (file)
@@ -1,7 +1,5 @@
 /* BFD back-end for HP PA-RISC ELF files.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1990-2015 Free Software Foundation, Inc.
 
    Original code by
        Center for Software Science
@@ -10,7 +8,7 @@
    Largely rewritten by Alan Modra <alan@linuxcare.com.au>
    Naming cleanup by Carlos O'Donell <carlos@systemhalted.org>
    TLS support written by Randolph Chung <tausq@debian.org>
+
    This file is part of BFD, the Binary File Descriptor library.
 
    This program is free software; you can redistribute it and/or modify
    Structure/Variable                  Prefix
    elf_link_hash_table                 "etab"
    elf_link_hash_entry                 "eh"
-   
+
    elf32_hppa_link_hash_table          "htab"
    elf32_hppa_link_hash_entry          "hh"
 
    bfd_hash_table                      "btab"
    bfd_hash_entry                      "bh"
-   
+
    bfd_hash_table containing stubs     "bstab"
    elf32_hppa_stub_hash_entry          "hsh"
 
    elf32_hppa_dyn_reloc_entry          "hdh"
-   
+
    Always remember to use GNU Coding Style. */
-                                         
+
 #define PLT_ENTRY_SIZE 8
 #define GOT_ENTRY_SIZE 4
 #define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1"
@@ -155,8 +153,8 @@ static const bfd_byte plt_stub[] =
 };
 
 /* Section name for stubs is the associated section name plus this
-   string.  PR 13049: Use a name that is not a valid C identifier.  */
-#define STUB_SUFFIX ".__stub"
+   string.  */
+#define STUB_SUFFIX ".stub"
 
 /* We don't need to copy certain PC- or GP-relative dynamic relocs
    into a shared object's dynamic section.  All the relocs of the
@@ -409,6 +407,18 @@ hppa_link_hash_newfunc (struct bfd_hash_entry *entry,
   return entry;
 }
 
+/* Free the derived linker hash table.  */
+
+static void
+elf32_hppa_link_hash_table_free (bfd *obfd)
+{
+  struct elf32_hppa_link_hash_table *htab
+    = (struct elf32_hppa_link_hash_table *) obfd->link.hash;
+
+  bfd_hash_table_free (&htab->bstab);
+  _bfd_elf_link_hash_table_free (obfd);
+}
+
 /* Create the derived linker hash table.  The PA ELF port uses the derived
    hash table to keep information specific to the PA ELF linker (without
    using static variables).  */
@@ -419,7 +429,7 @@ elf32_hppa_link_hash_table_create (bfd *abfd)
   struct elf32_hppa_link_hash_table *htab;
   bfd_size_type amt = sizeof (*htab);
 
-  htab = bfd_malloc (amt);
+  htab = bfd_zmalloc (amt);
   if (htab == NULL)
     return NULL;
 
@@ -434,43 +444,17 @@ elf32_hppa_link_hash_table_create (bfd *abfd)
   /* Init the stub hash table too.  */
   if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
                            sizeof (struct elf32_hppa_stub_hash_entry)))
-    return NULL;
+    {
+      _bfd_elf_link_hash_table_free (abfd);
+      return NULL;
+    }
+  htab->etab.root.hash_table_free = elf32_hppa_link_hash_table_free;
 
-  htab->stub_bfd = NULL;
-  htab->add_stub_section = NULL;
-  htab->layout_sections_again = NULL;
-  htab->stub_group = NULL;
-  htab->sgot = NULL;
-  htab->srelgot = NULL;
-  htab->splt = NULL;
-  htab->srelplt = NULL;
-  htab->sdynbss = NULL;
-  htab->srelbss = NULL;
   htab->text_segment_base = (bfd_vma) -1;
   htab->data_segment_base = (bfd_vma) -1;
-  htab->multi_subspace = 0;
-  htab->has_12bit_branch = 0;
-  htab->has_17bit_branch = 0;
-  htab->has_22bit_branch = 0;
-  htab->need_plt_stub = 0;
-  htab->sym_cache.abfd = NULL;
-  htab->tls_ldm_got.refcount = 0;
-
   return &htab->etab.root;
 }
 
-/* Free the derived linker hash table.  */
-
-static void
-elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *btab)
-{
-  struct elf32_hppa_link_hash_table *htab
-    = (struct elf32_hppa_link_hash_table *) btab;
-
-  bfd_hash_table_free (&htab->bstab);
-  _bfd_generic_link_hash_table_free (btab);
-}
-
 /* Build a name for an entry in the stub hash table.  */
 
 static char *
@@ -1005,14 +989,14 @@ elf32_hppa_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   if (! _bfd_elf_create_dynamic_sections (abfd, info))
     return FALSE;
 
-  htab->splt = bfd_get_section_by_name (abfd, ".plt");
-  htab->srelplt = bfd_get_section_by_name (abfd, ".rela.plt");
+  htab->splt = bfd_get_linker_section (abfd, ".plt");
+  htab->srelplt = bfd_get_linker_section (abfd, ".rela.plt");
 
-  htab->sgot = bfd_get_section_by_name (abfd, ".got");
-  htab->srelgot = bfd_get_section_by_name (abfd, ".rela.got");
+  htab->sgot = bfd_get_linker_section (abfd, ".got");
+  htab->srelgot = bfd_get_linker_section (abfd, ".rela.got");
 
-  htab->sdynbss = bfd_get_section_by_name (abfd, ".dynbss");
-  htab->srelbss = bfd_get_section_by_name (abfd, ".rela.bss");
+  htab->sdynbss = bfd_get_linker_section (abfd, ".dynbss");
+  htab->srelbss = bfd_get_linker_section (abfd, ".rela.bss");
 
   /* hppa-linux needs _GLOBAL_OFFSET_TABLE_ to be visible from the main
      application, because __canonicalize_funcptr_for_compare needs it.  */
@@ -1110,7 +1094,7 @@ hppa32_elf_local_refcounts (bfd *abfd)
 {
   Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   bfd_signed_vma *local_refcounts;
-                  
+
   local_refcounts = elf_local_got_refcounts (abfd);
   if (local_refcounts == NULL)
     {
@@ -1187,6 +1171,10 @@ elf32_hppa_check_relocs (bfd *abfd,
          while (hh->eh.root.type == bfd_link_hash_indirect
                 || hh->eh.root.type == bfd_link_hash_warning)
            hh = hppa_elf_hash_entry (hh->eh.root.u.i.link);
+
+         /* PR15323, ref flags aren't set for references in the same
+            object.  */
+         hh->eh.root.non_ir_ref = 1;
        }
 
       r_type = ELF32_R_TYPE (rela->r_info);
@@ -1378,7 +1366,7 @@ elf32_hppa_check_relocs (bfd *abfd,
              else
                {
                  bfd_signed_vma *local_got_refcounts;
-                 
+
                  /* This is a global offset table entry for a local symbol.  */
                  local_got_refcounts = hppa32_elf_local_refcounts (abfd);
                  if (local_got_refcounts == NULL)
@@ -1724,10 +1712,10 @@ elf32_hppa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 
       case 396:                /* Linux/hppa */
        /* pr_cursig */
-       elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+       elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
 
        /* pr_pid */
-       elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+       elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
 
        /* pr_reg */
        offset = 72;
@@ -1750,9 +1738,9 @@ elf32_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
        return FALSE;
 
       case 124:                /* Linux/hppa elf_prpsinfo.  */
-       elf_tdata (abfd)->core_program
+       elf_tdata (abfd)->core->program
          = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
-       elf_tdata (abfd)->core_command
+       elf_tdata (abfd)->core->command
          = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
     }
 
@@ -1760,7 +1748,7 @@ elf32_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
      onto the end of the args in some (at least one anyway)
      implementations, so strip it off if it exists.  */
   {
-    char *command = elf_tdata (abfd)->core_command;
+    char *command = elf_tdata (abfd)->core->command;
     int n = strlen (command);
 
     if (0 < n && command[n - 1] == ' ')
@@ -1787,12 +1775,18 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
          _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
                                  eh->dynstr_index);
        }
+
+      /* PR 16082: Remove version information from hidden symbol.  */
+      eh->verinfo.verdef = NULL;
+      eh->verinfo.vertree = NULL;
     }
 
-  if (! hppa_elf_hash_entry (eh)->plabel)
+  /* STT_GNU_IFUNC symbol must go through PLT.  */
+  if (! hppa_elf_hash_entry (eh)->plabel
+      && eh->type != STT_GNU_IFUNC)
     {
       eh->needs_plt = 0;
-      eh->plt = elf_hash_table (info)->init_plt_refcount;
+      eh->plt = elf_hash_table (info)->init_plt_offset;
     }
 }
 
@@ -1814,6 +1808,13 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
   if (eh->type == STT_FUNC
       || eh->needs_plt)
     {
+      /* If the symbol is used by a plabel, we must allocate a PLT slot.
+        The refcounts are not reliable when it has been hidden since
+        hide_symbol can be called before the plabel flag is set.  */
+      if (hppa_elf_hash_entry (eh)->plabel
+         && eh->plt.refcount <= 0)
+       eh->plt.refcount = 1;
+
       if (eh->plt.refcount <= 0
          || (eh->def_regular
              && eh->root.type != bfd_link_hash_defweak
@@ -1889,13 +1890,6 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
        }
     }
 
-  if (eh->size == 0)
-    {
-      (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),
-                            eh->root.root.string);
-      return TRUE;
-    }
-
   /* We must allocate the symbol in our .dynbss section, which will
      become part of the .bss section of the executable.  There will be
      an entry for this symbol in the .dynsym section.  The dynamic
@@ -1913,7 +1907,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* We must generate a COPY reloc to tell the dynamic linker to
      copy the initial value out of the dynamic object and into the
      runtime process image.  */
-  if ((eh->root.u.def.section->flags & SEC_ALLOC) != 0)
+  if ((eh->root.u.def.section->flags & SEC_ALLOC) != 0 && eh->size != 0)
     {
       htab->srelbss->size += sizeof (Elf32_External_Rela);
       eh->needs_copy = 1;
@@ -1921,7 +1915,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   sec = htab->sdynbss;
 
-  return _bfd_elf_adjust_dynamic_copy (eh, sec);
+  return _bfd_elf_adjust_dynamic_copy (info, eh, sec);
 }
 
 /* Allocate space in the .plt for entries that won't have relocations.
@@ -1963,7 +1957,7 @@ allocate_plt_static (struct elf_link_hash_entry *eh, void *inf)
             means that the plt entry is only used by a plabel.
             We'll be using a normal plt entry for this symbol, so
             clear the plabel indicator.  */
-         
+
          hh->plabel = 0;
        }
       else if (hh->plabel)
@@ -2011,7 +2005,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *eh, void *inf)
     return FALSE;
 
   hh = hppa_elf_hash_entry (eh);
-  
+
   if (htab->etab.dynamic_sections_created
       && eh->plt.offset != (bfd_vma) -1
       && !hh->plabel
@@ -2112,7 +2106,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *eh, void *inf)
       /* For the non-shared case, discard space for relocs against
         symbols which turn out to need copy relocs or are not
         dynamic.  */
-      
+
       if (!eh->non_got_ref
          && ((ELIMINATE_COPY_RELOCS
               && eh->def_dynamic
@@ -2223,7 +2217,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
       /* Set the contents of the .interp section to the interpreter.  */
       if (info->executable)
        {
-         sec = bfd_get_section_by_name (dynobj, ".interp");
+         sec = bfd_get_linker_section (dynobj, ".interp");
          if (sec == NULL)
            abort ();
          sec->size = sizeof ELF_DYNAMIC_INTERPRETER;
@@ -2238,7 +2232,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
 
   /* Set up .got and .plt offsets for local syms, and space for local
      dynamic relocs.  */
-  for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+  for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
     {
       bfd_signed_vma *local_got;
       bfd_signed_vma *end_local_got;
@@ -2299,7 +2293,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
                sec->size += 2 * GOT_ENTRY_SIZE;
              else if ((*local_tls_type & GOT_TLS_GD) == GOT_TLS_GD)
                sec->size += GOT_ENTRY_SIZE;
-             if (info->shared) 
+             if (info->shared)
                {
                  srel->size += sizeof (Elf32_External_Rela);
                  if ((*local_tls_type & (GOT_TLS_GD | GOT_TLS_IE)) == (GOT_TLS_GD | GOT_TLS_IE))
@@ -2340,10 +2334,10 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
            }
        }
     }
-  
+
   if (htab->tls_ldm_got.refcount > 0)
     {
-      /* Allocate 2 got entries and 1 dynamic reloc for 
+      /* Allocate 2 got entries and 1 dynamic reloc for
          R_PARISC_TLS_DTPMOD32 relocs.  */
       htab->tls_ldm_got.offset = htab->sgot->size;
       htab->sgot->size += (GOT_ENTRY_SIZE * 2);
@@ -2382,7 +2376,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
              bfd_size_type mask;
 
              if (gotalign > pltalign)
-               bfd_set_section_alignment (dynobj, sec, gotalign);
+               (void) bfd_set_section_alignment (dynobj, sec, gotalign);
              mask = ((bfd_size_type) 1 << gotalign) - 1;
              sec->size = (sec->size + sizeof (plt_stub) + mask) & ~mask;
            }
@@ -2513,7 +2507,7 @@ elf32_hppa_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
   /* Count the number of input BFDs and find the top input section id.  */
   for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
        input_bfd != NULL;
-       input_bfd = input_bfd->link_next)
+       input_bfd = input_bfd->link.next)
     {
       bfd_count += 1;
       for (section = input_bfd->sections;
@@ -2704,7 +2698,7 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info)
      export stubs.  */
   for (bfd_indx = 0;
        input_bfd != NULL;
-       input_bfd = input_bfd->link_next, bfd_indx++)
+       input_bfd = input_bfd->link.next, bfd_indx++)
     {
       Elf_Internal_Shdr *symtab_hdr;
 
@@ -2878,7 +2872,7 @@ elf32_hppa_size_stubs
 
       for (input_bfd = info->input_bfds, bfd_indx = 0;
           input_bfd != NULL;
-          input_bfd = input_bfd->link_next, bfd_indx++)
+          input_bfd = input_bfd->link.next, bfd_indx++)
        {
          Elf_Internal_Shdr *symtab_hdr;
          asection *section;
@@ -3218,7 +3212,7 @@ elf32_hppa_build_stubs (struct bfd_link_info *info)
 }
 
 /* Return the base vma address which should be subtracted from the real
-   address when resolving a dtpoff relocation.  
+   address when resolving a dtpoff relocation.
    This is PT_TLS segment p_vaddr.  */
 
 static bfd_vma
@@ -3240,9 +3234,9 @@ tpoff (struct bfd_link_info *info, bfd_vma address)
   /* If tls_sec is NULL, we should have signalled an error already.  */
   if (htab->tls_sec == NULL)
     return 0;
-  /* hppa TLS ABI is variant I and static TLS block start just after 
+  /* hppa TLS ABI is variant I and static TLS block start just after
      tcbhead structure which has 2 pointer fields.  */
-  return (address - htab->tls_sec->vma 
+  return (address - htab->tls_sec->vma
          + align_power ((bfd_vma) 8, htab->tls_sec->alignment_power));
 }
 
@@ -3321,7 +3315,7 @@ final_link_relocate (asection *input_section,
   bfd_signed_vma addend = rela->r_addend;
   bfd_vma location;
   struct elf32_hppa_stub_hash_entry *hsh = NULL;
-  int val;  
+  int val;
 
   if (r_type == R_PARISC_NONE)
     return bfd_reloc_ok;
@@ -3340,10 +3334,16 @@ final_link_relocate (asection *input_section,
       switch (r_type)
        {
          case R_PARISC_DLTIND21L:
+         case R_PARISC_TLS_GD21L:
+         case R_PARISC_TLS_LDM21L:
+         case R_PARISC_TLS_IE21L:
            r_type = R_PARISC_DPREL21L;
            break;
 
          case R_PARISC_DLTIND14R:
+         case R_PARISC_TLS_GD14R:
+         case R_PARISC_TLS_LDM14R:
+         case R_PARISC_TLS_IE14R:
            r_type = R_PARISC_DPREL14R;
            break;
 
@@ -3409,53 +3409,48 @@ final_link_relocate (asection *input_section,
     case R_PARISC_DPREL21L:
     case R_PARISC_DPREL14R:
     case R_PARISC_DPREL14F:
-    case R_PARISC_TLS_GD21L:
-    case R_PARISC_TLS_LDM21L:
-    case R_PARISC_TLS_IE21L:
       /* Convert instructions that use the linkage table pointer (r19) to
         instructions that use the global data pointer (dp).  This is the
         most efficient way of using PIC code in an incomplete executable,
         but the user must follow the standard runtime conventions for
         accessing data for this to work.  */
-      if (orig_r_type == R_PARISC_DLTIND21L
-         || (!info->shared
-             && (r_type == R_PARISC_TLS_GD21L
-                 || r_type == R_PARISC_TLS_LDM21L
-                 || r_type == R_PARISC_TLS_IE21L)))
+      if (orig_r_type != r_type)
        {
-         /* Convert addil instructions if the original reloc was a
-            DLTIND21L.  GCC sometimes uses a register other than r19 for
-            the operation, so we must convert any addil instruction
-            that uses this relocation.  */
-         if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
-           insn = ADDIL_DP;
-         else
-           /* We must have a ldil instruction.  It's too hard to find
-              and convert the associated add instruction, so issue an
-              error.  */
-           (*_bfd_error_handler)
-             (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
-              input_bfd,
-              input_section,
-              (long) offset,
-              howto->name,
-              insn);
-       }
-      else if (orig_r_type == R_PARISC_DLTIND14F)
-       {
-         /* This must be a format 1 load/store.  Change the base
-            register to dp.  */
-         insn = (insn & 0xfc1ffff) | (27 << 21);
+         if (r_type == R_PARISC_DPREL21L)
+           {
+             /* GCC sometimes uses a register other than r19 for the
+                operation, so we must convert any addil instruction
+                that uses this relocation.  */
+             if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
+               insn = ADDIL_DP;
+             else
+               /* We must have a ldil instruction.  It's too hard to find
+                  and convert the associated add instruction, so issue an
+                  error.  */
+               (*_bfd_error_handler)
+                 (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
+                  input_bfd,
+                  input_section,
+                  (long) offset,
+                  howto->name,
+                  insn);
+           }
+         else if (r_type == R_PARISC_DPREL14F)
+           {
+             /* This must be a format 1 load/store.  Change the base
+                register to dp.  */
+             insn = (insn & 0xfc1ffff) | (27 << 21);
+           }
        }
 
-    /* For all the DP relative relocations, we need to examine the symbol's
-       section.  If it has no section or if it's a code section, then
-       "data pointer relative" makes no sense.  In that case we don't
-       adjust the "value", and for 21 bit addil instructions, we change the
-       source addend register from %dp to %r0.  This situation commonly
-       arises for undefined weak symbols and when a variable's "constness"
-       is declared differently from the way the variable is defined.  For
-       instance: "extern int foo" with foo defined as "const int foo".  */
+      /* For all the DP relative relocations, we need to examine the symbol's
+        section.  If it has no section or if it's a code section, then
+        "data pointer relative" makes no sense.  In that case we don't
+        adjust the "value", and for 21 bit addil instructions, we change the
+        source addend register from %dp to %r0.  This situation commonly
+        arises for undefined weak symbols and when a variable's "constness"
+        is declared differently from the way the variable is defined.  For
+        instance: "extern int foo" with foo defined as "const int foo".  */
       if (sym_sec == NULL || (sym_sec->flags & SEC_CODE) != 0)
        {
          if ((insn & ((0x3f << 26) | (0x1f << 21)))
@@ -3472,6 +3467,9 @@ final_link_relocate (asection *input_section,
     case R_PARISC_DLTIND21L:
     case R_PARISC_DLTIND14R:
     case R_PARISC_DLTIND14F:
+    case R_PARISC_TLS_GD21L:
+    case R_PARISC_TLS_LDM21L:
+    case R_PARISC_TLS_IE21L:
     case R_PARISC_TLS_GD14R:
     case R_PARISC_TLS_LDM14R:
     case R_PARISC_TLS_IE14R:
@@ -3700,13 +3698,14 @@ elf32_hppa_relocate_section (bfd *output_bfd,
       else
        {
          struct elf_link_hash_entry *eh;
-         bfd_boolean unresolved_reloc;
+         bfd_boolean unresolved_reloc, ignored;
          struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
          RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela,
                                   r_symndx, symtab_hdr, sym_hashes,
                                   eh, sym_sec, relocation,
-                                  unresolved_reloc, warned_undef);
+                                  unresolved_reloc, warned_undef,
+                                  ignored);
 
          if (!info->relocatable
              && relocation == 0
@@ -3728,10 +3727,10 @@ elf32_hppa_relocate_section (bfd *output_bfd,
          hh = hppa_elf_hash_entry (eh);
        }
 
-      if (sym_sec != NULL && elf_discarded_section (sym_sec))
+      if (sym_sec != NULL && discarded_section (sym_sec))
        RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
-                                        rela, relend,
-                                        elf_hppa_howto_table + r_type,
+                                        rela, 1, relend,
+                                        elf_hppa_howto_table + r_type, 0,
                                         contents);
 
       if (info->relocatable)
@@ -3996,7 +3995,7 @@ elf32_hppa_relocate_section (bfd *output_bfd,
                      || outrel.r_offset == (bfd_vma) -2);
              outrel.r_offset += (input_section->output_offset
                                  + input_section->output_section->vma);
-                     
+
              if (skip)
                {
                  memset (&outrel, 0, sizeof (outrel));
@@ -4058,12 +4057,12 @@ elf32_hppa_relocate_section (bfd *output_bfd,
              bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
            }
          break;
-         
+
        case R_PARISC_TLS_LDM21L:
        case R_PARISC_TLS_LDM14R:
          {
            bfd_vma off;
-       
+
            off = htab->tls_ldm_got.offset;
            if (off & 1)
              off &= ~1;
@@ -4072,12 +4071,12 @@ elf32_hppa_relocate_section (bfd *output_bfd,
                Elf_Internal_Rela outrel;
                bfd_byte *loc;
 
-               outrel.r_offset = (off 
+               outrel.r_offset = (off
                                   + htab->sgot->output_section->vma
                                   + htab->sgot->output_offset);
                outrel.r_addend = 0;
                outrel.r_info = ELF32_R_INFO (0, R_PARISC_TLS_DTPMOD32);
-               loc = htab->srelgot->contents; 
+               loc = htab->srelgot->contents;
                loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
 
                bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
@@ -4149,7 +4148,7 @@ elf32_hppa_relocate_section (bfd *output_bfd,
                        || hh->eh.root.type != bfd_link_hash_undefweak))
                  {
                    need_relocs = TRUE;
-                   loc = htab->srelgot->contents; 
+                   loc = htab->srelgot->contents;
                    /* FIXME (CAO): Should this be reloc_count++ ? */
                    loc += htab->srelgot->reloc_count * sizeof (Elf32_External_Rela);
                  }
@@ -4436,9 +4435,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
     }
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
-  if (eh_name (eh)[0] == '_'
-      && (strcmp (eh_name (eh), "_DYNAMIC") == 0
-         || eh == htab->etab.hgot))
+  if (eh == htab->etab.hdynamic || eh == htab->etab.hgot)
     {
       sym->st_shndx = SHN_ABS;
     }
@@ -4450,7 +4447,9 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
+elf32_hppa_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+                            const asection *rel_sec ATTRIBUTE_UNUSED,
+                            const Elf_Internal_Rela *rela)
 {
   /* Handle TLS relocs first; we don't want them to be marked
      relative by the "if (ELF32_R_SYM (rela->r_info) == STN_UNDEF)"
@@ -4500,7 +4499,7 @@ elf32_hppa_finish_dynamic_sections (bfd *output_bfd,
   if (sgot != NULL && bfd_is_abs_section (sgot->output_section))
     return FALSE;
 
-  sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+  sdyn = bfd_get_linker_section (dynobj, ".dynamic");
 
   if (htab->etab.dynamic_sections_created)
     {
@@ -4630,7 +4629,6 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 /* Stuff for the BFD linker.  */
 #define bfd_elf32_bfd_final_link            elf32_hppa_final_link
 #define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create
-#define bfd_elf32_bfd_link_hash_table_free   elf32_hppa_link_hash_table_free
 #define elf_backend_adjust_dynamic_symbol    elf32_hppa_adjust_dynamic_symbol
 #define elf_backend_copy_indirect_symbol     elf32_hppa_copy_indirect_symbol
 #define elf_backend_check_relocs            elf32_hppa_check_relocs
@@ -4648,7 +4646,6 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 #define elf_backend_grok_psinfo                     elf32_hppa_grok_psinfo
 #define elf_backend_object_p                elf32_hppa_object_p
 #define elf_backend_final_write_processing   elf_hppa_final_write_processing
-#define elf_backend_post_process_headers     _bfd_elf_set_osabi
 #define elf_backend_get_symbol_type         elf32_hppa_elf_get_symbol_type
 #define elf_backend_reloc_type_class        elf32_hppa_reloc_type_class
 #define elf_backend_action_discarded        elf_hppa_action_discarded
@@ -4662,7 +4659,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 #define elf_backend_got_header_size         8
 #define elf_backend_rela_normal                     1
 
-#define TARGET_BIG_SYM         bfd_elf32_hppa_vec
+#define TARGET_BIG_SYM         hppa_elf32_vec
 #define TARGET_BIG_NAME                "elf32-hppa"
 #define ELF_ARCH               bfd_arch_hppa
 #define ELF_TARGET_ID          HPPA32_ELF_DATA
@@ -4674,7 +4671,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 #include "elf32-target.h"
 
 #undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM         bfd_elf32_hppa_linux_vec
+#define TARGET_BIG_SYM         hppa_elf32_linux_vec
 #undef TARGET_BIG_NAME
 #define TARGET_BIG_NAME                "elf32-hppa-linux"
 #undef ELF_OSABI
@@ -4685,7 +4682,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 #include "elf32-target.h"
 
 #undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM         bfd_elf32_hppa_nbsd_vec
+#define TARGET_BIG_SYM         hppa_elf32_nbsd_vec
 #undef TARGET_BIG_NAME
 #define TARGET_BIG_NAME                "elf32-hppa-netbsd"
 #undef ELF_OSABI
This page took 0.040502 seconds and 4 git commands to generate.