From 35fee729f248d6a0bbbd9ec121c1838bfe241c81 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 6 Jun 1994 18:42:38 +0000 Subject: [PATCH] * libaout.h (struct aout_link_hash_entry): New field written. * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written. (aout_link_write_symbols): Use written, not root.written. (aout_link_write_other_symbol): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * libecoff.h (struct ecoff_link_hash_entry): New field written. * ecoff.c (ecoff_link_hash_newfunc): Initialize written. (ecoff_link_write_external): use written, not root.written. * genlink.h (struct generic_link_hash_entry): New field written. * linker.c (_bfd_link_hash_newfunc): Don't initialize written. (generic_link_hash_newfunc): Initialize written. (_bfd_generic_link_output_symbols): Use written, not root.written. (_bfd_generic_link_write_global_symbol): Likewise. (_bfd_generic_reloc_link_order): Likewise. --- bfd/ChangeLog | 15 +++++++++++++++ bfd/aoutx.h | 17 ++++++++++------- bfd/linker.c | 10 +++++----- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f5eb440b40f..2086cf02e19 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,20 @@ Mon Jun 6 10:57:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + * libaout.h (struct aout_link_hash_entry): New field written. + * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written. + (aout_link_write_symbols): Use written, not root.written. + (aout_link_write_other_symbol): Likewise. + * sunos.c (sunos_scan_dynamic_symbol): Likewise. + * libecoff.h (struct ecoff_link_hash_entry): New field written. + * ecoff.c (ecoff_link_hash_newfunc): Initialize written. + (ecoff_link_write_external): use written, not root.written. + * genlink.h (struct generic_link_hash_entry): New field written. + * linker.c (_bfd_link_hash_newfunc): Don't initialize written. + (generic_link_hash_newfunc): Initialize written. + (_bfd_generic_link_output_symbols): Use written, not root.written. + (_bfd_generic_link_write_global_symbol): Likewise. + (_bfd_generic_reloc_link_order): Likewise. + * libecoff.h (ecoff_data_type): Add linker field. * ecoff.c (ecoff_write_object_contents): Check new tdata linker field, rather than outsymbols being non-NULL, to decide whether to diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 36008293bb8..2af2d196233 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -2854,8 +2854,11 @@ NAME(aout,link_hash_newfunc) (entry, table, string) _bfd_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); if (ret) - /* Set local fields. */ - ret->indx = -1; + { + /* Set local fields. */ + ret->written = false; + ret->indx = -1; + } return (struct bfd_hash_entry *) ret; } @@ -3726,7 +3729,7 @@ aout_link_write_symbols (finfo, input_bfd, symbol_map) /* If the symbol has already been written out, skip it. */ if (h != (struct aout_link_hash_entry *) NULL && h->root.type != bfd_link_hash_warning - && h->root.written) + && h->written) { if ((type & N_TYPE) == N_INDR) skip_indirect = true; @@ -3756,7 +3759,7 @@ aout_link_write_symbols (finfo, input_bfd, symbol_map) if (skip) { if (h != (struct aout_link_hash_entry *) NULL) - h->root.written = true; + h->written = true; continue; } @@ -3855,7 +3858,7 @@ aout_link_write_symbols (finfo, input_bfd, symbol_map) it is a local symbol see if we should discard it. */ if (h != (struct aout_link_hash_entry *) NULL) { - h->root.written = true; + h->written = true; h->indx = obj_aout_external_sym_count (output_bfd); } else @@ -3965,10 +3968,10 @@ aout_link_write_other_symbol (h, data) } } - if (h->root.written) + if (h->written) return true; - h->root.written = true; + h->written = true; if (finfo->info->strip == strip_all || (finfo->info->strip == strip_some diff --git a/bfd/linker.c b/bfd/linker.c index 2c6754b5962..7d5e4edfacf 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -469,7 +469,6 @@ _bfd_link_hash_newfunc (entry, table, string) { /* Initialize the local fields. */ ret->type = bfd_link_hash_new; - ret->written = false; ret->next = NULL; } @@ -583,6 +582,7 @@ generic_link_hash_newfunc (entry, table, string) if (ret) { /* Set local fields. */ + ret->written = false; ret->sym = NULL; } @@ -1930,7 +1930,7 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) if (! generic_add_output_symbol (output_bfd, psymalloc, sym)) return false; if (h != (struct generic_link_hash_entry *) NULL) - h->root.written = true; + h->written = true; } } @@ -1949,10 +1949,10 @@ _bfd_generic_link_write_global_symbol (h, data) (struct generic_write_global_symbol_info *) data; asymbol *sym; - if (h->root.written) + if (h->written) return true; - h->root.written = true; + h->written = true; if (wginfo->info->strip == strip_all || (wginfo->info->strip == strip_some @@ -2061,7 +2061,7 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) link_order->u.reloc.p->u.name, false, false, true); if (h == (struct generic_link_hash_entry *) NULL - || ! h->root.written) + || ! h->written) { if (! ((*info->callbacks->unattached_reloc) (info, link_order->u.reloc.p->u.name, -- 2.30.2