/* 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.
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;
/* The Microsoft Visual C compiler does string pooling by
hashing the constants to an internal symbol name, and
- relying on the the linker comdat support to discard
+ relying on the linker comdat support to discard
duplicate names. However, if one string is a literal and
one is a data initializer, one will end up in the .data
section and one will end up in the .rdata section. The
(*_bfd_error_handler)
(_("Warning: type of symbol `%s' changed from %d to %d in %s"),
name, (*sym_hash)->type, sym.n_type,
- bfd_get_filename (abfd));
+ bfd_archive_filename (abfd));
/* We don't want to change from a meaningful
base type to a null one, but if we know
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;
/* 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;
#ifndef COFF_WITH_PE
/* Skip section symbols for sections which are not going to be
- emitted, or which belong to linkonce sections that are going
- to be discarded. */
+ emitted. */
if (!skip
&& isym.n_sclass == C_STAT
&& isym.n_type == T_NULL
&& isym.n_numaux > 0)
{
- if ((*secpp)->output_section == bfd_abs_section_ptr
- || (*secpp)->kept_section)
+ if ((*secpp)->output_section == bfd_abs_section_ptr)
skip = true;
}
#endif
{
((*_bfd_error_handler)
(_("%s: relocs in section `%s', but it has no contents"),
- bfd_get_filename (input_bfd),
+ bfd_archive_filename (input_bfd),
bfd_get_section_name (input_bfd, o)));
bfd_set_error (bfd_error_no_contents);
return false;
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;
{
default:
case bfd_link_hash_new:
+ case bfd_link_hash_warning:
abort ();
return false;
break;
case bfd_link_hash_indirect:
- case bfd_link_hash_warning:
/* Just ignore these. They can't be handled anyhow. */
return true;
}
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)
{
(*_bfd_error_handler)
("%s: illegal symbol index %ld in relocs",
- bfd_get_filename (input_bfd), symndx);
+ bfd_archive_filename (input_bfd), symndx);
return false;
}
else
case bfd_reloc_outofrange:
(*_bfd_error_handler)
(_("%s: bad reloc address 0x%lx in section `%s'"),
- bfd_get_filename (input_bfd),
+ bfd_archive_filename (input_bfd),
(unsigned long) rel->r_vaddr,
bfd_get_section_name (input_bfd, input_section));
return false;