* aout-adobe.c: Don't compare against "true" or "false.
[deliverable/binutils-gdb.git] / bfd / elf32-i370.c
index 5ac43dda75639d85781b83f5c98226c0c6a65113..e0ec33c2b8de3ac90bd2deb53554f6024cbe13cd 100644 (file)
@@ -1,5 +1,5 @@
 /* i370-specific support for 32-bit ELF
-   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001
+   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Hacked by Linas Vepstas for i370 linas@linas.org
@@ -319,7 +319,7 @@ static boolean i370_elf_create_dynamic_sections PARAMS ((bfd *,
 
 static boolean i370_elf_section_from_shdr PARAMS ((bfd *,
                                                   Elf32_Internal_Shdr *,
-                                                  char *));
+                                                  const char *));
 static boolean i370_elf_fake_sections PARAMS ((bfd *,
                                               Elf32_Internal_Shdr *,
                                               asection *));
@@ -429,7 +429,7 @@ static boolean
 i370_elf_section_from_shdr (abfd, hdr, name)
      bfd *abfd;
      Elf32_Internal_Shdr *hdr;
-     char *name;
+     const char *name;
 {
   asection *newsect;
   flagword flags;
@@ -736,6 +736,9 @@ i370_elf_adjust_dynindx (h, cparg)
           h->dynindx, *cp);
 #endif
 
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
   if (h->dynindx != -1)
     h->dynindx += *cp;
 
@@ -1274,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),
@@ -1317,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;
@@ -1436,7 +1414,7 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
              && r_symndx != 0)
            {
              Elf_Internal_Rela outrel;
-             boolean skip;
+             int skip;
 
 #ifdef DEBUG
              fprintf (stderr,
@@ -1468,13 +1446,14 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                  BFD_ASSERT (sreloc != NULL);
                }
 
-             skip = false;
+             skip = 0;
 
              outrel.r_offset =
                _bfd_elf_section_offset (output_bfd, info, input_section,
                                         rel->r_offset);
-             if (outrel.r_offset == (bfd_vma) -1)
-               skip = true;
+             if (outrel.r_offset == (bfd_vma) -1
+                 || outrel.r_offset == (bfd_vma) -2)
+               skip = (int) outrel.r_offset;
              outrel.r_offset += (input_section->output_section->vma
                                  + input_section->output_offset);
 
@@ -1549,7 +1528,7 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
              /* This reloc will be computed at runtime, so there's no
                  need to do anything now, unless this is a RELATIVE
                  reloc in an unallocated section.  */
-             if (skip
+             if (skip == -1
                  || (input_section->flags & SEC_ALLOC) != 0
                  || ELF32_R_TYPE (outrel.r_info) != R_I370_RELATIVE)
                continue;
@@ -1657,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
This page took 0.028603 seconds and 4 git commands to generate.