From 4db41da40118b929a1a130e7090ec829aa862495 Mon Sep 17 00:00:00 2001 From: drow Date: Sat, 3 May 2008 15:36:33 +0000 Subject: [PATCH] * 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. --- bfd/ChangeLog | 7 +++++++ bfd/elf32-arm.c | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f4a679f5df..bc5e1394b4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2008-05-03 Daniel Jacobowitz + + * 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 PR 2995, PR 6473 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index d372975531..b8abd5844c 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -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 -- 2.11.0