* 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 <local_got>): 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.
This commit is contained in:
Alan Modra
2003-02-04 12:49:57 +00:00
parent 68bfbfcc5a
commit 5cab59f622
4 changed files with 80 additions and 45 deletions

View File

@@ -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;
}