* elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
authorDaniel Jacobowitz <drow@false.org>
Sat, 3 May 2008 15:36:34 +0000 (15:36 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sat, 3 May 2008 15:36:34 +0000 (15:36 +0000)
ARRAY_SIZE.
(elf32_arm_symbian_plt_sym_val): New.
(elf_backend_plt_sym_val): Define.

bfd/ChangeLog
bfd/elf32-arm.c

index f4a679f5df40c74d458d710086f598b31795173c..bc5e1394b436dd905cd695dc910cf068850129e1 100644 (file)
@@ -1,3 +1,10 @@
+2008-05-03  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
+       ARRAY_SIZE.
+       (elf32_arm_symbian_plt_sym_val): New.
+       (elf_backend_plt_sym_val): Define.
+
 2008-05-03  Alan Modra  <amodra@bigpond.net.au>
 
        PR 2995, PR 6473
index d3729755313af4fc56c1a5c69e1cfdec610eecdc..b8abd5844c92cc7fa5a41f6ac4b0b2ee14e3ed70 100644 (file)
@@ -10573,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;
@@ -10650,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
 
@@ -10686,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