* cache.c (cache_bread): Set bfd_error_file_truncated if EOF
[deliverable/binutils-gdb.git] / bfd / elf-hppa.h
index 271b5781940b70e1fa0d31a7c793e3667fc5aab8..c82264b9feb390d6f572855179d487a5f0634125 100644 (file)
@@ -6,7 +6,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,7 +16,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 #define ELF_HOWTO_TABLE_SIZE       R_PARISC_UNIMPLEMENTED + 1
 
@@ -1017,6 +1018,22 @@ elf_hppa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
   return NULL;
 }
 
+static reloc_howto_type *
+elf_hppa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                           const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_hppa_howto_table) / sizeof (elf_hppa_howto_table[0]);
+       i++)
+    if (elf_hppa_howto_table[i].name != NULL
+       && strcasecmp (elf_hppa_howto_table[i].name, r_name) == 0)
+      return &elf_hppa_howto_table[i];
+
+  return NULL;
+}
+
 /* Return TRUE if SYM represents a local label symbol.  */
 
 static bfd_boolean
@@ -1283,25 +1300,32 @@ elf_hppa_is_dynamic_loader_symbol (const char *name)
 
 /* Record the lowest address for the data and text segments.  */
 static void
-elf_hppa_record_segment_addrs (bfd *abfd ATTRIBUTE_UNUSED,
+elf_hppa_record_segment_addrs (bfd *abfd,
                               asection *section,
                               void *data)
 {
-  struct elf64_hppa_link_hash_table *hppa_info;
-  bfd_vma value;
+  struct elf64_hppa_link_hash_table *hppa_info = data;
 
-  hppa_info = data;
+  if ((section->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+    {
+      bfd_vma value;
+      Elf_Internal_Phdr *p;
 
-  value = section->vma - section->filepos;
+      p = _bfd_elf_find_segment_containing_section (abfd, section->output_section);
+      BFD_ASSERT (p != NULL);
+      value = p->p_vaddr;
 
-  if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
-       == (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
-      && value < hppa_info->text_segment_base)
-    hppa_info->text_segment_base = value;
-  else if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
-           == (SEC_ALLOC | SEC_LOAD))
-          && value < hppa_info->data_segment_base)
-    hppa_info->data_segment_base = value;
+      if (section->flags & SEC_READONLY)
+       {
+         if (value < hppa_info->text_segment_base)
+           hppa_info->text_segment_base = value;
+       }
+      else
+       {
+         if (value < hppa_info->data_segment_base)
+           hppa_info->data_segment_base = value;
+       }
+    }
 }
 
 /* Called after we have seen all the input files/sections, but before
This page took 0.023976 seconds and 4 git commands to generate.