From 5cab59f6227cb9ef3e5ed2a5bf9df5d3836645b2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 4 Feb 2003 12:49:57 +0000 Subject: * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare. (struct elf_link_hash_entry): Add "glist" and "plist" fields to "got" union, and declare as gotplt_union. Use gotplt_uinion for "plt" field. (struct elf_link_hash_table): Make "init_refcount" a gotplt_union. Add "init_offset" field. (struct elf_obj_tdata ): Add "struct got_entry **" to union. (elf_local_got_ents): Declare. * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got" and "plt". (_bfd_elf_link_hash_hide_symbol): Use "init_offset". (_bfd_elf_link_hash_table_init): Set "init_offset". * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount from init_offset. (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset. * elf.c (bfd_elf_local_sym_name): Split out from.. (group_signature): ..here. * elf-bfd.h (bfd_elf_local_sym_name): Declare. --- bfd/elflink.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bfd/elflink.h') diff --git a/bfd/elflink.h b/bfd/elflink.h index aa359a1..a70f873 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2902,7 +2902,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, /* Any syms created from now on start with -1 in got.refcount/offset and plt.refcount/offset. */ - elf_hash_table (info)->init_refcount = -1; + elf_hash_table (info)->init_refcount = elf_hash_table (info)->init_offset; /* The backend may have to create some sections regardless of whether we're dynamic or not. */ @@ -3909,10 +3909,13 @@ elf_adjust_dynamic_symbol (h, data) bfd *dynobj; struct elf_backend_data *bed; + if (! is_elf_hash_table (eif->info)) + return FALSE; + if (h->root.type == bfd_link_hash_warning) { - h->plt.offset = (bfd_vma) -1; - h->got.offset = (bfd_vma) -1; + h->plt = elf_hash_table (eif->info)->init_offset; + h->got = elf_hash_table (eif->info)->init_offset; /* When warning symbols are created, they **replace** the "real" entry in the hash table, thus we never get to see the real @@ -3924,9 +3927,6 @@ elf_adjust_dynamic_symbol (h, data) if (h->root.type == bfd_link_hash_indirect) return TRUE; - if (! is_elf_hash_table (eif->info)) - return FALSE; - /* Fix the symbol flags. */ if (! elf_fix_symbol_flags (h, eif)) return FALSE; @@ -3944,7 +3944,7 @@ elf_adjust_dynamic_symbol (h, data) || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0 && (h->weakdef == NULL || h->weakdef->dynindx == -1)))) { - h->plt.offset = (bfd_vma) -1; + h->plt = elf_hash_table (eif->info)->init_offset; return TRUE; } -- cgit v1.1