diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-09-06 20:40:37 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-09-06 20:40:37 +0000 |
commit | 6ceff8e7d2bcd87fc647a9cc8c37b51f56865eac (patch) | |
tree | b2d88a6d3035714e7dbaf7d159f3fa54a8b4f68e /bfd/coffcode.h | |
parent | 16654bbe99ac3467ed1cf622ea3b8ac282c38bcf (diff) | |
download | gdb-6ceff8e7d2bcd87fc647a9cc8c37b51f56865eac.zip gdb-6ceff8e7d2bcd87fc647a9cc8c37b51f56865eac.tar.gz gdb-6ceff8e7d2bcd87fc647a9cc8c37b51f56865eac.tar.bz2 |
Minor tweaks to make COFF code support both new and old style linker.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r-- | bfd/coffcode.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h index f1729dd..4c3850d 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1741,11 +1741,6 @@ coff_write_object_contents (abfd) */ 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; if (abfd->flags & EXEC_P) @@ -1757,8 +1752,6 @@ coff_write_object_contents (abfd) internal_f.f_flags |= F_RELFLG; if (!haslinno) internal_f.f_flags |= F_LNNO; - if (obj_raw_syment_count (abfd) == 0) - internal_f.f_flags |= F_LSYMS; if (abfd->flags & EXEC_P) internal_f.f_flags |= F_EXEC; @@ -1866,6 +1859,18 @@ coff_write_object_contents (abfd) if (! coff_write_relocs (abfd)) 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) { internal_a.tsize = bfd_get_section_size_before_reloc (text_sec); |