* linker.c (_bfd_generic_link_output_symbols,
_bfd_generic_link_write_global_symbol): Don't require that all references to a common symbol be themselves common symbols.
This commit is contained in:
parent
250e36fe2d
commit
5072b8e530
2 changed files with 19 additions and 7 deletions
|
@ -1,5 +1,9 @@
|
|||
Thu Feb 3 16:49:35 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||
|
||||
* linker.c (_bfd_generic_link_output_symbols,
|
||||
_bfd_generic_link_write_global_symbol): Don't require that all
|
||||
references to a common symbol be themselves common symbols.
|
||||
|
||||
* aoutx.h (aout_reloc_index_to_section): Handle N_UNDF.
|
||||
|
||||
Wed Feb 2 20:37:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||
|
|
22
bfd/linker.c
22
bfd/linker.c
|
@ -1656,13 +1656,17 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc)
|
|||
case bfd_link_hash_common:
|
||||
sym->value = h->root.u.c.size;
|
||||
sym->flags |= BSF_GLOBAL;
|
||||
if (! bfd_is_com_section (sym->section))
|
||||
{
|
||||
BFD_ASSERT (sym->section == &bfd_und_section);
|
||||
sym->section = &bfd_com_section;
|
||||
}
|
||||
/* We do not set the section of the symbol to
|
||||
c.section. c.section is saved so that we know
|
||||
where to allocate the symbol if we define it. In
|
||||
this case the type is still bfd_link_hash_common,
|
||||
so we did not define it, so we do not want to use
|
||||
that section. */
|
||||
BFD_ASSERT (bfd_is_com_section (sym->section));
|
||||
h->root.u.c.section. That value was saved so
|
||||
that we would know where to allocate the symbol
|
||||
if it was defined. In this case the type is
|
||||
still bfd_link_hash_common, so we did not define
|
||||
it, so we do not want to use that section. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1794,8 +1798,12 @@ _bfd_generic_link_write_global_symbol (h, data)
|
|||
break;
|
||||
case bfd_link_hash_common:
|
||||
sym->value = h->root.u.c.size;
|
||||
if (! bfd_is_com_section (sym->section))
|
||||
{
|
||||
BFD_ASSERT (sym->section == &bfd_und_section);
|
||||
sym->section = &bfd_com_section;
|
||||
}
|
||||
/* Do not set the section; see _bfd_generic_link_output_symbols. */
|
||||
BFD_ASSERT (bfd_is_com_section (sym->section));
|
||||
break;
|
||||
case bfd_link_hash_indirect:
|
||||
case bfd_link_hash_warning:
|
||||
|
|
Loading…
Reference in a new issue