* elf64-alpha.c (elf64_alpha_relocate_section): Soft fail
[deliverable/binutils-gdb.git] / bfd / elf.c
index 8ff3ec8b309c8534dbdea1e307fe676df75f6b3e..f40b5a013c03c0acf472cc10813a3f883d211054 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -571,6 +571,8 @@ _bfd_elf_merge_sections (abfd, info)
      bfd *abfd;
      struct bfd_link_info *info;
 {
+  if (!is_elf_hash_table (info))
+    return false;
   if (elf_hash_table (info)->merge_info)
     _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info);
   return true;
@@ -612,16 +614,16 @@ _bfd_elf_print_private_bfd_data (abfd, farg)
            default: sprintf (buf, "0x%lx", p->p_type); s = buf; break;
            }
          fprintf (f, "%8s off    0x", s);
-         fprintf_vma (f, p->p_offset);
+         bfd_fprintf_vma (abfd, f, p->p_offset);
          fprintf (f, " vaddr 0x");
-         fprintf_vma (f, p->p_vaddr);
+         bfd_fprintf_vma (abfd, f, p->p_vaddr);
          fprintf (f, " paddr 0x");
-         fprintf_vma (f, p->p_paddr);
+         bfd_fprintf_vma (abfd, f, p->p_paddr);
          fprintf (f, " align 2**%u\n", bfd_log2 (p->p_align));
          fprintf (f, "         filesz 0x");
-         fprintf_vma (f, p->p_filesz);
+         bfd_fprintf_vma (abfd, f, p->p_filesz);
          fprintf (f, " memsz 0x");
-         fprintf_vma (f, p->p_memsz);
+         bfd_fprintf_vma (abfd, f, p->p_memsz);
          fprintf (f, " flags %c%c%c",
                   (p->p_flags & PF_R) != 0 ? 'r' : '-',
                   (p->p_flags & PF_W) != 0 ? 'w' : '-',
@@ -830,7 +832,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how)
       break;
     case bfd_print_symbol_more:
       fprintf (file, "elf ");
-      fprintf_vma (file, symbol->value);
+      bfd_fprintf_vma (abfd, file, symbol->value);
       fprintf (file, " %lx", (long) symbol->flags);
       break;
     case bfd_print_symbol_all:
@@ -849,7 +851,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how)
        if (name == NULL)
          {
            name = symbol->name;
-           bfd_print_symbol_vandf ((PTR) file, symbol);
+           bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
          }
 
        fprintf (file, " %s\t", section_name);
@@ -857,10 +859,10 @@ bfd_elf_print_symbol (abfd, filep, symbol, how)
           we've already printed the size; now print the alignment.
           For other symbols, we have no specified alignment, and
           we've printed the address; now print the size.  */
-       fprintf_vma (file,
-                    (bfd_is_com_section (symbol->section)
-                     ? ((elf_symbol_type *) symbol)->internal_elf_sym.st_value
-                     : ((elf_symbol_type *) symbol)->internal_elf_sym.st_size));
+       bfd_fprintf_vma (abfd, file,
+                        (bfd_is_com_section (symbol->section)
+                         ? ((elf_symbol_type *) symbol)->internal_elf_sym.st_value
+                         : ((elf_symbol_type *) symbol)->internal_elf_sym.st_size));
 
        /* If we have version information, print it.  */
        if (elf_tdata (abfd)->dynversym_section != 0
@@ -1047,6 +1049,8 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc)
                                                struct bfd_hash_table *,
                                                const char *));
 {
+  boolean ret;
+
   table->dynamic_sections_created = false;
   table->dynobj = NULL;
   /* The first dynamic symbol is a dummy.  */
@@ -1059,7 +1063,10 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc)
   table->stab_info = NULL;
   table->merge_info = NULL;
   table->dynlocal = NULL;
-  return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
+  ret = _bfd_link_hash_table_init (& table->root, abfd, newfunc);
+  table->root.type = bfd_link_elf_hash_table;
+
+  return ret;
 }
 
 /* Create an ELF linker hash table.  */
@@ -2091,6 +2098,7 @@ elf_map_symbols (abfd)
   if (sect_syms == NULL)
     return false;
   elf_section_syms (abfd) = sect_syms;
+  elf_num_section_syms (abfd) = max_index;
 
   for (idx = 0; idx < symcount; idx++)
     {
@@ -3385,7 +3393,10 @@ prep_headers (abfd)
       i_ehdrp->e_machine = EM_PARISC;
       break;
     case bfd_arch_powerpc:
-      i_ehdrp->e_machine = EM_PPC;
+      if (bed->s->arch_size == 64)
+       i_ehdrp->e_machine = EM_PPC64;
+      else
+       i_ehdrp->e_machine = EM_PPC;
       break;
     case bfd_arch_alpha:
       i_ehdrp->e_machine = EM_ALPHA;
@@ -3440,6 +3451,12 @@ prep_headers (abfd)
       i_ehdrp->e_machine = EM_OPENRISC;
       break;
       /* Also note that EM_M32, AT&T WE32100 is unknown to bfd.  */
+    case bfd_arch_h8300:
+      i_ehdrp->e_machine = EM_H8_300;
+      break;
+    case bfd_arch_h8500:
+      i_ehdrp->e_machine = EM_H8_500;
+      break;
     default:
       i_ehdrp->e_machine = EM_NONE;
     }
@@ -3651,7 +3668,8 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr)
        indx = asym_ptr->section->output_section->index;
       else
        indx = asym_ptr->section->index;
-      if (elf_section_syms (abfd)[indx])
+      if (indx < elf_num_section_syms (abfd)
+         && elf_section_syms (abfd)[indx] != NULL)
        asym_ptr->udata.i = elf_section_syms (abfd)[indx]->udata.i;
     }
 
@@ -6051,3 +6069,10 @@ _bfd_elf_fprintf_vma (abfd, stream, value)
   fprintf_vma ((FILE *) stream, value);
 #endif
 }
+
+enum elf_reloc_type_class
+_bfd_elf_reloc_type_class (type)
+     int type ATTRIBUTE_UNUSED;
+{
+  return reloc_class_normal;
+}
This page took 0.02603 seconds and 4 git commands to generate.