Minor tweaks to make COFF code support both new and old style linker.
This commit is contained in:
parent
16654bbe99
commit
6ceff8e7d2
2 changed files with 16 additions and 9 deletions
|
@ -31,7 +31,8 @@ Tue Sep 6 14:51:11 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||||
is positive, since it always is. Remove use of pad, which is
|
is positive, since it always is. Remove use of pad, which is
|
||||||
always zero. Check obj_raw_syment_count, not bfd_get_symcount,
|
always zero. Check obj_raw_syment_count, not bfd_get_symcount,
|
||||||
for the number of symbols, but only write them out if
|
for the number of symbols, but only write them out if
|
||||||
bfd_get_symcount is non-zero.
|
bfd_get_symcount is non-zero. Don't check obj_raw_syment_count
|
||||||
|
until after coff_write_symbols is called.
|
||||||
(coff_slurp_symbol_table): Use obj_raw_syment_count, not
|
(coff_slurp_symbol_table): Use obj_raw_syment_count, not
|
||||||
bfd_get_symcount for the number of symbols. Don't set
|
bfd_get_symcount for the number of symbols. Don't set
|
||||||
obj_conv_table_size.
|
obj_conv_table_size.
|
||||||
|
@ -48,7 +49,8 @@ Tue Sep 6 14:51:11 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||||
and obj_conv_table_size here.
|
and obj_conv_table_size here.
|
||||||
(coff_count_linenumbers): Reindent. If bfd_get_symcount is zero,
|
(coff_count_linenumbers): Reindent. If bfd_get_symcount is zero,
|
||||||
add up the line numbers from the sections.
|
add up the line numbers from the sections.
|
||||||
(coff_write_symbols): Don't set bfd_get_symcount.
|
(coff_write_symbols): Set obj_raw_syment_count, not
|
||||||
|
bfd_get_symcount.
|
||||||
(coff_pointerize_aux): Don't pointerize a nonpositive x_endndx
|
(coff_pointerize_aux): Don't pointerize a nonpositive x_endndx
|
||||||
field.
|
field.
|
||||||
(coff_get_normalized_symtab): Use obj_raw_syment_count, not
|
(coff_get_normalized_symtab): Use obj_raw_syment_count, not
|
||||||
|
|
|
@ -1741,11 +1741,6 @@ coff_write_object_contents (abfd)
|
||||||
*/
|
*/
|
||||||
internal_f.f_timdat = 0;
|
internal_f.f_timdat = 0;
|
||||||
|
|
||||||
if (obj_raw_syment_count (abfd) != 0)
|
|
||||||
internal_f.f_symptr = sym_base;
|
|
||||||
else
|
|
||||||
internal_f.f_symptr = 0;
|
|
||||||
|
|
||||||
internal_f.f_flags = 0;
|
internal_f.f_flags = 0;
|
||||||
|
|
||||||
if (abfd->flags & EXEC_P)
|
if (abfd->flags & EXEC_P)
|
||||||
|
@ -1757,8 +1752,6 @@ coff_write_object_contents (abfd)
|
||||||
internal_f.f_flags |= F_RELFLG;
|
internal_f.f_flags |= F_RELFLG;
|
||||||
if (!haslinno)
|
if (!haslinno)
|
||||||
internal_f.f_flags |= F_LNNO;
|
internal_f.f_flags |= F_LNNO;
|
||||||
if (obj_raw_syment_count (abfd) == 0)
|
|
||||||
internal_f.f_flags |= F_LSYMS;
|
|
||||||
if (abfd->flags & EXEC_P)
|
if (abfd->flags & EXEC_P)
|
||||||
internal_f.f_flags |= F_EXEC;
|
internal_f.f_flags |= F_EXEC;
|
||||||
|
|
||||||
|
@ -1866,6 +1859,18 @@ coff_write_object_contents (abfd)
|
||||||
if (! coff_write_relocs (abfd))
|
if (! coff_write_relocs (abfd))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If bfd_get_symcount (abfd) != 0, then we are not using the COFF
|
||||||
|
backend linker, and obj_raw_syment_count is not valid until after
|
||||||
|
coff_write_symbols is called. */
|
||||||
|
if (obj_raw_syment_count (abfd) != 0)
|
||||||
|
internal_f.f_symptr = sym_base;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
internal_f.f_symptr = 0;
|
||||||
|
internal_f.f_flags |= F_LSYMS;
|
||||||
|
}
|
||||||
|
|
||||||
if (text_sec)
|
if (text_sec)
|
||||||
{
|
{
|
||||||
internal_a.tsize = bfd_get_section_size_before_reloc (text_sec);
|
internal_a.tsize = bfd_get_section_size_before_reloc (text_sec);
|
||||||
|
|
Loading…
Reference in a new issue