2004-04-05 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / bfd / elf64-hppa.c
index 36c27c4b6f88dd707f261119b8cef0c5285957f9..76dcc18b24362eaca542704ce26147386a6975fc 100644 (file)
@@ -1,5 +1,6 @@
 /* Support for HPPA 64-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -173,7 +174,7 @@ static void elf64_hppa_dyn_hash_traverse
           PTR info));
 
 static const char *get_dyn_name
-  PARAMS ((asection *, struct elf_link_hash_entry *,
+  PARAMS ((bfd *, struct elf_link_hash_entry *,
           const Elf_Internal_Rela *, char **, size_t *));
 
 /* This must follow the definitions of the various derived linker
@@ -446,13 +447,14 @@ elf64_hppa_section_from_shdr (abfd, hdr, name)
    allocate memory as necessary, possibly reusing PBUF/PLEN.  */
 
 static const char *
-get_dyn_name (sec, h, rel, pbuf, plen)
-     asection *sec;
+get_dyn_name (abfd, h, rel, pbuf, plen)
+     bfd *abfd;
      struct elf_link_hash_entry *h;
      const Elf_Internal_Rela *rel;
      char **pbuf;
      size_t *plen;
 {
+  asection *sec = abfd->sections;
   size_t nlen, tlen;
   char *buf;
   size_t len;
@@ -858,7 +860,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
        continue;
 
       /* Collect a canonical name for this address.  */
-      addr_name = get_dyn_name (sec, h, rel, &buf, &buf_len);
+      addr_name = get_dyn_name (abfd, h, rel, &buf, &buf_len);
 
       /* Collect the canonical entry data for this address.  */
       dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
@@ -931,7 +933,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
             section symbol for this section ends up in the dynamic
             symbol table.  */
          if (info->shared && dynrel_type == R_PARISC_FPTR64
-             && ! (_bfd_elf64_link_record_local_dynamic_symbol
+             && ! (bfd_elf_link_record_local_dynamic_symbol
                    (info, abfd, sec_symndx)))
            return FALSE;
        }
@@ -1042,7 +1044,7 @@ allocate_global_data_dlt (dyn_h, data)
              bfd *owner;
              owner = (h ? h->root.u.def.section->owner : dyn_h->owner);
 
-             if (! (_bfd_elf64_link_record_local_dynamic_symbol
+             if (! (bfd_elf_link_record_local_dynamic_symbol
                     (x->info, owner, dyn_h->sym_indx)))
                return FALSE;
            }
@@ -1146,7 +1148,7 @@ allocate_global_data_opd (dyn_h, data)
              bfd *owner;
              owner = (h ? h->root.u.def.section->owner : dyn_h->owner);
 
-             if (!_bfd_elf64_link_record_local_dynamic_symbol
+             if (!bfd_elf_link_record_local_dynamic_symbol
                    (x->info, owner, dyn_h->sym_indx))
                return FALSE;
            }
@@ -1172,7 +1174,7 @@ allocate_global_data_opd (dyn_h, data)
              nh->root.u.def.value = h->root.u.def.value;
              nh->root.u.def.section = h->root.u.def.section;
 
-             if (! bfd_elf64_link_record_dynamic_symbol (x->info, nh))
+             if (! bfd_elf_link_record_dynamic_symbol (x->info, nh))
                return FALSE;
 
             }
@@ -1508,7 +1510,7 @@ allocate_dynrel_entries (dyn_h, data)
         the symbol need only be added once.  */
       if (dyn_h->h == 0
          || (dyn_h->h->dynindx == -1 && dyn_h->h->type != STT_PARISC_MILLI))
-       if (!_bfd_elf64_link_record_local_dynamic_symbol
+       if (!bfd_elf_link_record_local_dynamic_symbol
            (x->info, rent->sec->owner, dyn_h->sym_indx))
          return FALSE;
     }
@@ -1831,7 +1833,7 @@ elf64_hppa_size_dynamic_sections (output_bfd, info)
         the PLT, it is how we communicate the __gp value of a load
         module to the dynamic linker.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!add_dynamic_entry (DT_HP_DLD_FLAGS, 0)
          || !add_dynamic_entry (DT_PLTGOT, 0))
@@ -1912,7 +1914,7 @@ elf64_hppa_link_output_symbol_hook (info, name, sym, input_sec, h)
   hppa_info = elf64_hppa_hash_table (info);
   dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table,
                                      name, FALSE, FALSE);
-  if (dyn_h->h != h)
+  if (!dyn_h || dyn_h->h != h)
     return TRUE;
 
   /* Function symbols for which we created .opd entries *may* have been
@@ -1922,7 +1924,7 @@ elf64_hppa_link_output_symbol_hook (info, name, sym, input_sec, h)
      into non-dynamic ones, so we initialize st_shndx to -1 in
      mark_exported_functions and check to see if it was overwritten
      here instead of just checking dyn_h->h->dynindx.  */
-  if (dyn_h && dyn_h->want_opd && dyn_h->st_shndx != -1)
+  if (dyn_h->want_opd && dyn_h->st_shndx != -1)
     {
       /* Restore the saved value and section index.  */
       sym->st_value = dyn_h->st_value;
This page took 0.025025 seconds and 4 git commands to generate.