Apply Bruno de Bus's patch to record the ARM mapping symbol state on a per-
[deliverable/binutils-gdb.git] / bfd / elf32-iq2000.c
index ebdd30300ff9f26d9a17f2cc5c99be7c5d679ef4..60dab3483cd89a4734e9eb1c993958451c789de9 100644 (file)
@@ -1,5 +1,5 @@
 /* IQ2000-specific support for 32-bit ELF.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -458,7 +458,7 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
   const Elf_Internal_Rela *rel_end;
   bfd_boolean changed = FALSE;
   
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
   
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -484,14 +484,14 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
          /* This relocation describes the C++ object vtable hierarchy.
             Reconstruct it for later use during GC.  */
        case R_IQ2000_GNU_VTINHERIT:
-         if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+         if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
            return FALSE;
          break;
          
          /* This relocation describes which C++ vtable entries are actually
             used.  Record for later use during GC.  */
        case R_IQ2000_GNU_VTENTRY:
-         if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+         if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
            return FALSE;
          break;
 
@@ -531,7 +531,7 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
    zero.
 
    This function is responsible for adjusting the section contents as
-   necessary, and (if using Rela relocs and generating a relocateable
+   necessary, and (if using Rela relocs and generating a relocatable
    output file) adjusting the reloc addend as necessary.
 
    This function does not have to worry about setting the reloc
@@ -545,7 +545,7 @@ iq2000_elf_check_relocs (abfd, info, sec, relocs)
    The global hash table entry for the global symbols can be found
    via elf_sym_hashes (input_bfd).
 
-   When generating relocateable output, this function must handle
+   When generating relocatable output, this function must handle
    STB_LOCAL/STT_SECTION symbols specially.  The output symbol is
    going to be the section symbol corresponding to the output
    section, which means that the addend must be adjusted
@@ -618,48 +618,15 @@ iq2000_elf_relocate_section (output_bfd, info, input_bfd, input_section,
        }
       else
        {
-         h = sym_hashes [r_symndx];
-         
-         while (h->root.type == bfd_link_hash_indirect
-                || h->root.type == bfd_link_hash_warning)
-           h = (struct elf_link_hash_entry *) h->root.u.i.link;
+         bfd_boolean unresolved_reloc;
+         bfd_boolean warned;
+
+         RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+                                  r_symndx, symtab_hdr, sym_hashes,
+                                  h, sec, relocation,
+                                  unresolved_reloc, warned);
 
          name = h->root.root.string;
-         
-         if (h->root.type == bfd_link_hash_defined
-             || h->root.type == bfd_link_hash_defweak)
-           {
-             sec = h->root.u.def.section;
-             relocation = (h->root.u.def.value
-                           + sec->output_section->vma
-                           + sec->output_offset);
-#ifdef DEBUG
-             fprintf (stderr,
-                      "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
-                      sec->name, name, h->root.u.def.value,
-                      sec->output_section->vma, sec->output_offset, relocation);
-#endif
-           }
-         else if (h->root.type == bfd_link_hash_undefweak)
-           {
-#ifdef DEBUG
-             fprintf (stderr, "undefined: sec: %s, name: %s\n",
-                      sec->name, name);
-#endif
-             relocation = 0;
-           }
-         else
-           {
-             if (! ((*info->callbacks->undefined_symbol)
-                    (info, h->root.root.string, input_bfd,
-                     input_section, rel->r_offset,
-                    (!info->shared || info->no_undefined))))
-               return FALSE;
-#ifdef DEBUG
-             fprintf (stderr, "unknown: name: %s\n", name);
-#endif
-             relocation = 0;
-           }
        }
 
       switch (r_type)
This page took 0.024571 seconds and 4 git commands to generate.