aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2007-04-27 20:10:47 +0000
committerBob Wilson <bob.wilson@acm.org>2007-04-27 20:10:47 +0000
commit951474417ee6263bc2c11bba2cd753bd4380a50b (patch)
treeabab1bfbe094871c7bddf104621b83e26a43ad50 /bfd
parentbcc2cc8eff34eec7072665903fa6f6f6df6f0401 (diff)
downloadgdb-951474417ee6263bc2c11bba2cd753bd4380a50b.zip
gdb-951474417ee6263bc2c11bba2cd753bd4380a50b.tar.gz
gdb-951474417ee6263bc2c11bba2cd753bd4380a50b.tar.bz2
* elf32-xtensa.c (elf_xtensa_make_sym_local): Restore deleted function.
(elf_xtensa_hide_symbol, elf_backend_hide_symbol): Likewise. (elf_xtensa_allocate_dynrelocs): Use elf_xtensa_make_sym_local.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-xtensa.c60
2 files changed, 46 insertions, 20 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 55849ac..fb5af0b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
2007-04-27 Bob Wilson <bob.wilson@acm.org>
+ * elf32-xtensa.c (elf_xtensa_make_sym_local): Restore deleted function.
+ (elf_xtensa_hide_symbol, elf_backend_hide_symbol): Likewise.
+ (elf_xtensa_allocate_dynrelocs): Use elf_xtensa_make_sym_local.
+
+2007-04-27 Bob Wilson <bob.wilson@acm.org>
+
* elf32-xtensa.c (xtensa_read_table_entries): Step through table
contents and relocs in parallel.
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 3b52299..2f83256 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -957,6 +957,44 @@ elf_xtensa_check_relocs (bfd *abfd,
}
+static void
+elf_xtensa_make_sym_local (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
+{
+ if (info->shared)
+ {
+ if (h->plt.refcount > 0)
+ {
+ /* For shared objects, there's no need for PLT entries for local
+ symbols (use RELATIVE relocs instead of JMP_SLOT relocs). */
+ if (h->got.refcount < 0)
+ h->got.refcount = 0;
+ h->got.refcount += h->plt.refcount;
+ h->plt.refcount = 0;
+ }
+ }
+ else
+ {
+ /* Don't need any dynamic relocations at all. */
+ h->plt.refcount = 0;
+ h->got.refcount = 0;
+ }
+}
+
+
+static void
+elf_xtensa_hide_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ bfd_boolean force_local)
+{
+ /* For a shared link, move the plt refcount to the got refcount to leave
+ space for RELATIVE relocs. */
+ elf_xtensa_make_sym_local (info, h);
+
+ _bfd_elf_link_hash_hide_symbol (info, h, force_local);
+}
+
+
/* Return the section that should be marked against GC for a given
relocation. */
@@ -1204,26 +1242,7 @@ elf_xtensa_allocate_dynrelocs (struct elf_link_hash_entry *h, void *arg)
is_dynamic = elf_xtensa_dynamic_symbol_p (h, info);
if (! is_dynamic)
- {
- if (info->shared)
- {
- /* For shared objects, there's no need for PLT entries for local
- symbols (use RELATIVE relocs instead of JMP_SLOT relocs). */
- if (h->plt.refcount > 0)
- {
- if (h->got.refcount < 0)
- h->got.refcount = 0;
- h->got.refcount += h->plt.refcount;
- h->plt.refcount = 0;
- }
- }
- else
- {
- /* Don't need any dynamic relocations at all. */
- h->plt.refcount = 0;
- h->got.refcount = 0;
- }
- }
+ elf_xtensa_make_sym_local (info, h);
if (h->plt.refcount > 0)
htab->srelplt->size += (h->plt.refcount * sizeof (Elf32_External_Rela));
@@ -9880,6 +9899,7 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] =
#define elf_backend_gc_sweep_hook elf_xtensa_gc_sweep_hook
#define elf_backend_grok_prstatus elf_xtensa_grok_prstatus
#define elf_backend_grok_psinfo elf_xtensa_grok_psinfo
+#define elf_backend_hide_symbol elf_xtensa_hide_symbol
#define elf_backend_object_p elf_xtensa_object_p
#define elf_backend_reloc_type_class elf_xtensa_reloc_type_class
#define elf_backend_relocate_section elf_xtensa_relocate_section