* dbxread.c: Formatting.
[deliverable/binutils-gdb.git] / bfd / elf32-arm.c
index 6764e67b17edcc5aa40a7010c5b9dc7afe49ee81..b8abd5844c92cc7fa5a41f6ac4b0b2ee14e3ed70 100644 (file)
@@ -4752,6 +4752,9 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
         run time.  */
       if ((info->shared || globals->root.is_relocatable_executable)
          && (input_section->flags & SEC_ALLOC)
+         && !(elf32_arm_hash_table (info)->vxworks_p
+              && strcmp (input_section->output_section->name,
+                         ".tls_vars") == 0)
          && ((r_type != R_ARM_REL32 && r_type != R_ARM_REL32_NOI)
              || !SYMBOL_CALLS_LOCAL (info, h))
          && (h == NULL
@@ -6902,6 +6905,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
   /* Some tags have 0 = don't care, 1 = strong requirement,
      2 = weak requirement.  */
   static const int order_312[3] = {3, 1, 2};
+  /* For use with Tag_VFP_arch.  */
+  static const int order_01243[5] = {0, 1, 2, 4, 3};
   int i;
 
   if (!elf_known_obj_attributes_proc (obfd)[0].i)
@@ -6956,7 +6961,6 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
        case Tag_CPU_arch:
        case Tag_ARM_ISA_use:
        case Tag_THUMB_ISA_use:
-       case Tag_VFP_arch:
        case Tag_WMMX_arch:
        case Tag_NEON_arch:
          /* ??? Do NEON and WMMX conflict?  */
@@ -6984,6 +6988,11 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
          if (in_attr[i].i)
            out_attr[i].i = in_attr[i].i;
          break;
+       case Tag_VFP_arch:
+         if (in_attr[i].i > 4 || out_attr[i].i > 4
+             || order_01243[in_attr[i].i] > order_01243[out_attr[i].i])
+           out_attr[i].i = in_attr[i].i;
+         break;
        case Tag_PCS_config:
          if (out_attr[i].i == 0)
            out_attr[i].i = in_attr[i].i;
@@ -8037,7 +8046,9 @@ elf32_arm_gc_mark_extra_sections(struct bfd_link_info *info,
              Elf_Internal_Shdr *hdr;
 
              hdr = &elf_section_data (o)->this_hdr;
-             if (hdr->sh_type == SHT_ARM_EXIDX && hdr->sh_link
+             if (hdr->sh_type == SHT_ARM_EXIDX
+                 && hdr->sh_link
+                 && hdr->sh_link < elf_numsections (sub)
                  && !o->gc_mark
                  && elf_shdrp[hdr->sh_link]->bfd_section->gc_mark)
                {
@@ -8569,6 +8580,19 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
            }
        }
 
+      if (elf32_arm_hash_table (info)->vxworks_p)
+       {
+         struct elf32_arm_relocs_copied **pp;
+
+         for (pp = &eh->relocs_copied; (p = *pp) != NULL; )
+           {
+             if (strcmp (p->section->output_section->name, ".tls_vars") == 0)
+               *pp = p->next;
+             else
+               pp = &p->next;
+           }
+       }
+
       /* Also discard relocs on undefined weak syms with non-default
          visibility.  */
       if (eh->relocs_copied != NULL
@@ -8720,6 +8744,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
       bfd_size_type locsymcount;
       Elf_Internal_Shdr *symtab_hdr;
       asection *srel;
+      bfd_boolean is_vxworks = elf32_arm_hash_table (info)->vxworks_p;
 
       if (! is_arm_elf (ibfd))
        continue;
@@ -8738,6 +8763,13 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
                     linker script /DISCARD/, so we'll be discarding
                     the relocs too.  */
                }
+             else if (is_vxworks
+                      && strcmp (p->section->output_section->name,
+                                 ".tls_vars") == 0)
+               {
+                 /* Relocations in vxworks .tls_vars sections are
+                    handled specially by the loader.  */
+               }
              else if (p->count != 0)
                {
                  srel = elf_section_data (p->section)->sreloc;
@@ -10541,8 +10573,8 @@ elf32_arm_symbian_link_hash_table_create (bfd *abfd)
        = (struct elf32_arm_link_hash_table *)ret;
       /* There is no PLT header for Symbian OS.  */
       htab->plt_header_size = 0;
-      /* The PLT entries are each three instructions.  */
-      htab->plt_entry_size = 4 * NUM_ELEM (elf32_arm_symbian_plt_entry);
+      /* The PLT entries are each one instruction and one word.  */
+      htab->plt_entry_size = 4 * ARRAY_SIZE (elf32_arm_symbian_plt_entry);
       htab->symbian_p = 1;
       /* Symbian uses armv5t or above, so use_blx is always true.  */
       htab->use_blx = 1;
@@ -10618,6 +10650,17 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd,
   return elf32_arm_modify_segment_map (abfd, info);
 }
 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+elf32_arm_symbian_plt_sym_val (bfd_vma i, const asection *plt,
+                              const arelent *rel ATTRIBUTE_UNUSED)
+{
+  return plt->vma + 4 * ARRAY_SIZE (elf32_arm_symbian_plt_entry) * i;
+}
+
+
 #undef elf32_bed
 #define elf32_bed elf32_arm_symbian_bed
 
@@ -10654,6 +10697,9 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd,
 #undef elf_backend_want_got_plt
 #define elf_backend_want_got_plt 0
 
+#undef elf_backend_plt_sym_val
+#define elf_backend_plt_sym_val                elf32_arm_symbian_plt_sym_val
+
 #undef elf_backend_may_use_rel_p
 #define elf_backend_may_use_rel_p      1
 #undef elf_backend_may_use_rela_p
This page took 0.03108 seconds and 4 git commands to generate.