diff options
Diffstat (limited to 'bfd/cofflink.c')
-rw-r--r-- | bfd/cofflink.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 00a5289..1eac3c5 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1,5 +1,5 @@ /* COFF specific linker code. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -119,13 +119,13 @@ _bfd_coff_link_hash_table_create (abfd) struct coff_link_hash_table *ret; bfd_size_type amt = sizeof (struct coff_link_hash_table); - ret = (struct coff_link_hash_table *) bfd_alloc (abfd, amt); + ret = (struct coff_link_hash_table *) bfd_malloc (amt); if (ret == NULL) return NULL; if (! _bfd_coff_link_hash_table_init (ret, abfd, _bfd_coff_link_hash_newfunc)) { - bfd_release (abfd, ret); + free (ret); return (struct bfd_link_hash_table *) NULL; } return &ret->root; @@ -1005,7 +1005,8 @@ _bfd_coff_final_link (abfd, info) if (info->task_link) { finfo.failed = false; - coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_task_globals, + coff_link_hash_traverse (coff_hash_table (info), + _bfd_coff_write_task_globals, (PTR) &finfo); if (finfo.failed) goto error_return; @@ -1013,7 +1014,8 @@ _bfd_coff_final_link (abfd, info) /* Write out the global symbols. */ finfo.failed = false; - coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym, + coff_link_hash_traverse (coff_hash_table (info), + _bfd_coff_write_global_sym, (PTR) &finfo); if (finfo.failed) goto error_return; @@ -2497,6 +2499,13 @@ _bfd_coff_write_global_sym (h, data) output_bfd = finfo->output_bfd; + if (h->root.type == bfd_link_hash_warning) + { + h = (struct coff_link_hash_entry *) h->root.u.i.link; + if (h->root.type == bfd_link_hash_new) + return true; + } + if (h->indx >= 0) return true; @@ -2512,6 +2521,7 @@ _bfd_coff_write_global_sym (h, data) { default: case bfd_link_hash_new: + case bfd_link_hash_warning: abort (); return false; @@ -2544,7 +2554,6 @@ _bfd_coff_write_global_sym (h, data) break; case bfd_link_hash_indirect: - case bfd_link_hash_warning: /* Just ignore these. They can't be handled anyhow. */ return true; } @@ -2699,6 +2708,9 @@ _bfd_coff_write_task_globals (h, data) boolean rtnval = true; boolean save_global_to_static; + if (h->root.type == bfd_link_hash_warning) + h = (struct coff_link_hash_entry *) h->root.u.i.link; + if (h->indx < 0) { switch (h->root.type) |