2011-05-20 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / bfd / elf32-arm.c
index 6b69fd633e1467da727f8c3b3c5d5f9c058cbd8e..671a20996ee2ef2287be0dcbf43859a3fd229676 100644 (file)
@@ -4556,6 +4556,7 @@ cortex_a8_erratum_scan (bfd *input_bfd,
                   bfd_vma target;
                   enum elf32_arm_stub_type stub_type = arm_stub_none;
                   struct a8_erratum_reloc key, *found;
+                  bfd_boolean use_plt = FALSE;
 
                   key.from = base_vma + i;
                   found = (struct a8_erratum_reloc *)
@@ -4567,7 +4568,6 @@ cortex_a8_erratum_scan (bfd *input_bfd,
                    {
                      char *error_message = NULL;
                      struct elf_link_hash_entry *entry;
-                     bfd_boolean use_plt = FALSE;
 
                      /* We don't care about the error returned from this
                         function, only if there is glue or not.  */
@@ -4671,6 +4671,12 @@ cortex_a8_erratum_scan (bfd *input_bfd,
                         offset =
                          (bfd_signed_vma) (found->destination - pc_for_insn);
 
+                      /* If the stub will use a Thumb-mode branch to a
+                         PLT target, redirect it to the preceding Thumb
+                         entry point.  */
+                      if (stub_type != arm_stub_a8_veneer_blx && use_plt)
+                        offset -= PLT_THUMB_STUB_SIZE;
+
                       target = pc_for_insn + offset;
 
                       /* The BLX stub is ARM-mode code.  Adjust the offset to
@@ -12019,7 +12025,7 @@ elf32_arm_gc_sweep_hook (bfd *                     abfd,
          struct elf_dyn_relocs *p;
 
          if (h != NULL)
-           pp = &((struct elf32_arm_link_hash_entry *) h)->dyn_relocs;
+           pp = &(eh->dyn_relocs);
          else
            {
              Elf_Internal_Sym *isym;
@@ -12032,7 +12038,7 @@ elf32_arm_gc_sweep_hook (bfd *                     abfd,
              if (pp == NULL)
                return FALSE;
            }
-         for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+         for (; (p = *pp) != NULL; pp = &p->next)
            if (p->sec == sec)
              {
                /* Everything must go for SEC.  */
@@ -15230,8 +15236,9 @@ elf32_arm_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
                           flagword *flagsp, asection **secp, bfd_vma *valp)
 {
   if ((abfd->flags & DYNAMIC) == 0
-      && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
-    elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE;
+      && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC
+         || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
+    elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
 
   if (elf32_arm_hash_table (info)->vxworks_p
       && !elf_vxworks_add_symbol_hook (abfd, info, sym, namep,
This page took 0.025861 seconds and 4 git commands to generate.