Added Self to Write After Approval
[deliverable/binutils-gdb.git] / bfd / elf64-mmix.c
index 0aa627f4a5478e8e910929a44b833d40c4cb8a44..3911976a252ea538b9246ce79f62ed981da7a967 100644 (file)
@@ -1,5 +1,5 @@
 /* MMIX-specific support for 64-bit ELF.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright 2001, 2002 Free Software Foundation, Inc.
    Contributed by Hans-Peter Nilsson <hp@bitrange.com>
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -1015,7 +1015,7 @@ mmix_elf_reloc (abfd, reloc_entry, symbol, data, input_section,
                                   bfd_asymbol_name (symbol),
                                   reloc_target_output_section);
 }
-
+\f
 /* Relocate an MMIX ELF section.  Modified from elf32-fr30.c; look to it
    for guidance if you're thinking of copying this.  */
 
@@ -1091,9 +1091,7 @@ mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section,
        {
          sym = local_syms + r_symndx;
          sec = local_sections [r_symndx];
-         relocation = (sec->output_section->vma
-                       + sec->output_offset
-                       + sym->st_value);
+         relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
 
          name = bfd_elf_string_from_elf_section
            (input_bfd, symtab_hdr->sh_link, sym->st_name);
@@ -1190,7 +1188,7 @@ mmix_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
   return true;
 }
-
+\f
 /* Perform a single relocation.  By default we use the standard BFD
    routines.  A few relocs we have to do ourselves.  */
 
@@ -1349,7 +1347,7 @@ mmix_final_link_relocate (howto, input_section, contents,
 
   return r;
 }
-
+\f
 /* Return the section that should be marked against GC for a given
    relocation.  */
 
@@ -1386,18 +1384,12 @@ mmix_elf_gc_mark_hook (abfd, info, rel, h, sym)
     }
   else
     {
-      if (!(elf_bad_symtab (abfd)
-           && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
-         && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
-               && sym->st_shndx != SHN_COMMON))
-       {
-         return bfd_section_from_elf_index (abfd, sym->st_shndx);
-       }
+      return bfd_section_from_elf_index (abfd, sym->st_shndx);
     }
 
   return NULL;
 }
-
+\f
 /* Sort register relocs to come before expanding relocs.  */
 
 static int
@@ -1493,7 +1485,7 @@ mmix_elf_check_relocs (abfd, info, sec, relocs)
 
   return true;
 }
-
+\f
 /* Change symbols relative to the reg contents section to instead be to
    the register section, and scale them down to correspond to the register
    number.  */
@@ -1675,14 +1667,12 @@ mmix_elf_final_link (abfd, info)
       if (bfd_get_section_flags (abfd, reg_section) & SEC_HAS_CONTENTS)
        _bfd_abort (__FILE__, __LINE__, _("Register section has contents\n"));
 
-      /* FIXME: This does not seem like the proper way to kill a section,
-        but it's the way it's done elsewhere, like elf64-alpha.c.  */
       /* Really remove the section.  */
       for (secpp = &abfd->sections;
           *secpp != reg_section;
           secpp = &(*secpp)->next)
        ;
-      *secpp = (*secpp)->next;
+      bfd_section_list_remove (abfd, secpp);
       --abfd->section_count;
     }
 
@@ -1691,7 +1681,7 @@ mmix_elf_final_link (abfd, info)
 
   return true;
 }
-
+\f
 #define ELF_ARCH               bfd_arch_mmix
 #define ELF_MACHINE_CODE       EM_MMIX
 
This page took 0.024615 seconds and 4 git commands to generate.