From 469984d1f66a2e91f530aa266759ae8d8d1abf8b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 6 Jun 1994 17:44:34 +0000 Subject: [PATCH] * libecoff.h (ecoff_data_type): Add linker field. * ecoff.c (ecoff_write_object_contents): Check new tdata linker field, rather than outsymbols being non-NULL, to decide whether to output the symbols and relocs. (ecoff_bfd_final_link): Set new tdata linker field to true. --- bfd/ChangeLog | 6 ++++++ bfd/ecoff.c | 11 ++++++----- bfd/libecoff.h | 5 ++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c5658916ab8..f5eb440b40f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ Mon Jun 6 10:57:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + * libecoff.h (ecoff_data_type): Add linker field. + * ecoff.c (ecoff_write_object_contents): Check new tdata linker + field, rather than outsymbols being non-NULL, to decide whether to + output the symbols and relocs. + (ecoff_bfd_final_link): Set new tdata linker field to true. + * ecoff.c (ecoff_bfd_copy_private_bfd_data): Don't try to copy data to a non-ECOFF file. diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 64661cdd183..2555c0cbd92 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -2918,11 +2918,10 @@ ecoff_write_object_contents (abfd) goto error_return; /* Build the external symbol information. This must be done before - writing out the relocs so that we know the symbol indices. The - condition checks makes sure this object was not created by - ecoff_bfd_final_link, since if it was we do not want to tamper - with the external symbols. */ - if (bfd_get_outsymbols (abfd) != (asymbol **) NULL) + writing out the relocs so that we know the symbol indices. We + don't do this if this BFD was created by the backend linker, + since it will have already handled the symbols and relocs. */ + if (! ecoff_data (abfd)->linker) { symhdr->iextMax = 0; symhdr->issExtMax = 0; @@ -4388,6 +4387,8 @@ ecoff_bfd_final_link (abfd, info) bfd_get_symcount (abfd) = symhdr->iextMax + symhdr->isymMax; + ecoff_data (abfd)->linker = true; + return true; } diff --git a/bfd/libecoff.h b/bfd/libecoff.h index a017d6e210d..0d20c4ba746 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -121,6 +121,9 @@ typedef struct ecoff_tdata linking. */ asection **symndx_to_section; + /* True if this BFD was written by the backend linker. */ + boolean linker; + } ecoff_data_type; /* Each canonical asymbol really looks like this. */ @@ -233,7 +236,7 @@ extern boolean ecoff_get_section_contents PARAMS ((bfd *abfd, file_ptr offset, bfd_size_type count)); -#define ecoff_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data +extern boolean ecoff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); #define ecoff_bfd_copy_private_section_data \ _bfd_generic_bfd_copy_private_section_data -- 2.30.2