* elf-hppa.h (elf_hppa_relocate_section): If relocatable, return
[binutils-gdb.git] / bfd / elf32-s390.c
index cdbdcba03d4d9fdfc2ab33df03017090b7fe66ca..8067018dd890b1d7f3b7eeadb5b8d3beb3a7530b 100644 (file)
@@ -45,7 +45,7 @@ static boolean elf_s390_check_relocs
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
           const Elf_Internal_Rela *));
 static asection *elf_s390_gc_mark_hook
-  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+  PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
           struct elf_link_hash_entry *, Elf_Internal_Sym *));
 static boolean elf_s390_gc_sweep_hook
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
@@ -71,8 +71,6 @@ static boolean elf_s390_finish_dynamic_sections
 static boolean elf_s390_object_p PARAMS ((bfd *));
 static boolean elf_s390_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *));
 
-#define USE_RELA 1             /* We want RELA relocations, not REL.  */
-
 #include "elf/s390.h"
 
 /* The relocation "howto" table.  */
@@ -903,8 +901,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
    relocation.  */
 
 static asection *
-elf_s390_gc_mark_hook (abfd, info, rel, h, sym)
-     bfd *abfd;
+elf_s390_gc_mark_hook (sec, info, rel, h, sym)
+     asection *sec;
      struct bfd_link_info *info ATTRIBUTE_UNUSED;
      Elf_Internal_Rela *rel;
      struct elf_link_hash_entry *h;
@@ -934,9 +932,7 @@ elf_s390_gc_mark_hook (abfd, info, rel, h, sym)
        }
     }
   else
-    {
-      return bfd_section_from_elf_index (abfd, sym->st_shndx);
-    }
+    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
 
   return NULL;
 }
@@ -1973,9 +1969,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
        }
 
+      /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+        because such sections are not SEC_ALLOC and thus ld.so will
+        not process them.  */
       if (unresolved_reloc
-         && !(info->shared
-              && (input_section->flags & SEC_DEBUGGING) != 0
+         && !((input_section->flags & SEC_DEBUGGING) != 0
               && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
        (*_bfd_error_handler)
          (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),