* config/tc-cris.c (cris_relax_frag): Fix typo in comment.
[deliverable/binutils-gdb.git] / bfd / elf32-cris.c
index 063c7dd0ba0a574048bb256b7a289b5ae6359485..dfbdbe75f683c0569ad38f2a718c6f98fa979f21 100644 (file)
@@ -799,6 +799,9 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   Elf_Internal_Rela *           rel;
   Elf_Internal_Rela *           relend;
 
+  if (info->relocateable)
+    return true;
+
   dynobj = elf_hash_table (info)->dynobj;
   local_got_offsets = elf_local_got_offsets (input_bfd);
   symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
@@ -833,29 +836,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          || r_type == R_CRIS_GNU_VTENTRY)
        continue;
 
-      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 (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
-               {
-                 sec = local_sections [r_symndx];
-                 rel->r_addend += sec->output_offset + sym->st_value;
-               }
-           }
-
-         continue;
-       }
-
       /* This is a final link.  */
+      r_symndx = ELF32_R_SYM (rel->r_info);
       howto  = cris_elf_howto_table + r_type;
       h      = NULL;
       sym    = NULL;
@@ -1040,7 +1022,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                BFD_ASSERT (off != (bfd_vma) -1);
 
                if (!elf_hash_table (info)->dynamic_sections_created
-                   || (! info->shared && h->dynindx == -1)
+                   || (! info->shared
+                       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
                    || (info->shared
                        && (info->symbolic || h->dynindx == -1)
                        && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
@@ -2935,7 +2918,8 @@ elf_cris_discard_excess_program_dynamics (h, inf)
         functions; doing this for all symbols would presumably not
         introduce new problems.  Of course we don't do this if we're
         exporting all dynamic symbols.  */
-      if (! info->export_dynamic)
+      if (! info->export_dynamic
+         && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
        {
          h->root.dynindx = -1;
          _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
@@ -3113,6 +3097,7 @@ elf_cris_reloc_type_class (rela)
    take the easy route.  */
 #define elf_backend_may_use_rel_p 0
 #define elf_backend_may_use_rela_p 1
+#define elf_backend_rela_normal                1
 
 #include "elf32-target.h"
 
This page took 0.035376 seconds and 4 git commands to generate.