]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/elf32-i370.c
* elf-bfd.h (struct elf_backend_data): Add rela_normal.
[thirdparty/binutils-gdb.git] / bfd / elf32-i370.c
index 07d5f9d593244d7e02d53230f878f962529ededf..fc82b47a080ef20c0faf93d717737a36eb91941b 100644 (file)
@@ -1277,6 +1277,9 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   bfd_vma *local_got_offsets;
   boolean ret                            = true;
 
+  if (info->relocateable)
+    return true;
+
 #ifdef DEBUG
   fprintf (stderr, "i370_elf_relocate_section called for %s section %s, %ld relocations%s\n",
           bfd_archive_filename (input_bfd),
@@ -1320,34 +1323,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
       howto = i370_elf_howto_table[(int)r_type];
       r_symndx = ELF32_R_SYM (rel->r_info);
 
-      if (info->relocateable)
-       {
-         /* This is a relocateable link.  We don't have to change
-            anything, unless the reloc is against a section symbol,
-            in which case we have to adjust according to where the
-            section symbol winds up in the output section.  */
-         if (r_symndx < symtab_hdr->sh_info)
-           {
-             sym = local_syms + r_symndx;
-             if ((unsigned)ELF_ST_TYPE (sym->st_info) == STT_SECTION)
-               {
-                 sec = local_sections[r_symndx];
-                 addend = rel->r_addend += sec->output_offset + sym->st_value;
-               }
-           }
-
-#ifdef DEBUG
-         fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n",
-                  howto->name,
-                  (int)r_type,
-                  r_symndx,
-                  (long)offset,
-                  (long)addend);
-#endif
-         continue;
-       }
-
-      /* This is a final link.  */
       if (r_symndx < symtab_hdr->sh_info)
        {
          sym = local_syms + r_symndx;
@@ -1661,6 +1636,7 @@ i370_elf_post_process_headers (abfd, link_info)
 
 #define elf_backend_plt_not_loaded 1
 #define elf_backend_got_symbol_offset 4
+#define elf_backend_rela_normal 1
 
 #define bfd_elf32_bfd_reloc_type_lookup                i370_elf_reloc_type_lookup
 #define bfd_elf32_bfd_set_private_flags                i370_elf_set_private_flags