bfd/
[binutils-gdb.git] / bfd / elf64-sparc.c
index d25b429337a5a36daa6872db61a44cfae665b7c8..13f6a5501a4125b9232331dc052114c8dee3233a 100644 (file)
@@ -1101,7 +1101,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
   asection *srelgot;
   asection *sreloc;
 
-  if (info->relocateable || !(sec->flags & SEC_ALLOC))
+  if (info->relocatable || !(sec->flags & SEC_ALLOC))
     return TRUE;
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -2022,7 +2022,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
 
-  if (info->relocateable)
+  if (info->relocatable)
     return TRUE;
 
   dynobj = elf_hash_table (info)->dynobj;
@@ -2097,7 +2097,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            ;
-         else if (info->shared
+         else if (!info->executable
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            ;
@@ -2684,7 +2684,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
               overflows.  We don't, but this breaks stabs debugging
               info, whose relocations are only 32-bits wide.  Ignore
               overflows for discarded entries.  */
-           if (r_type == R_SPARC_32
+           if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32)
                && _bfd_elf_section_offset (output_bfd, info, input_section,
                                            rel->r_offset) == (bfd_vma) -1)
              break;