daily update
[deliverable/binutils-gdb.git] / bfd / elf64-x86-64.c
index 9be552d41813488e0cd8f18f51b0510ed90a0cca..4bbbb0871ead7bdd9677af621757aceebf3e96ad 100644 (file)
@@ -666,13 +666,7 @@ elf64_x86_64_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;
@@ -1229,9 +1223,7 @@ elf64_x86_64_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, rela);
        }
       else
        {
@@ -1442,7 +1434,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_X86_64_64:
          /* FIXME: The ABI says the linker should make sure the value is
             the same when it's zeroextended to 64 bit.  */
-         if (info->shared && (input_section->flags & SEC_ALLOC) != 0)
+         if (info->shared
+             && r_symndx != 0
+             && (input_section->flags & SEC_ALLOC) != 0)
            {
              Elf_Internal_Rela outrel;
              boolean skip, relocate;
@@ -1473,21 +1467,11 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
 
              skip = false;
 
-             if (elf_section_data (input_section)->stab_info == NULL)
-               outrel.r_offset = rela->r_offset;
-             else
-               {
-                 bfd_vma off;
-
-                 off = (_bfd_stab_section_offset
-                        (output_bfd, &elf_hash_table (info)->stab_info,
-                         input_section,
-                         &elf_section_data (input_section)->stab_info,
-                         rela->r_offset));
-                 if (off == (bfd_vma) -1)
-                   skip = true;
-                 outrel.r_offset = off;
-               }
+             outrel.r_offset =
+               _bfd_elf_section_offset (output_bfd, info, input_section,
+                                        rela->r_offset);
+             if (outrel.r_offset == (bfd_vma) -1)
+               skip = true;
 
              outrel.r_offset += (input_section->output_section->vma
                                  + input_section->output_offset);
This page took 0.036342 seconds and 4 git commands to generate.