From 8fe2669ccf53f73b20109a14edce14cf70ebfb93 Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Mon, 27 Nov 2000 12:45:17 +0000 Subject: 2000-11-27 Philip Blundell * libcoff-in.h (coff_tdata): Add `strings_written' flag. (obj_coff_strings_written): New accessor macro for above. * libcoff.h: Regenerate. * cofflink.c (_bfd_coff_final_link): Say that we wrote the strings. * coffcode.h (coff_write_object_contents): No need to write out the string table if it's already been done. --- bfd/ChangeLog | 10 ++++++++++ bfd/coffcode.h | 2 +- bfd/cofflink.c | 2 ++ bfd/libcoff-in.h | 3 +++ bfd/libcoff.h | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 99de56774aa..9c7572c6778 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,13 @@ +2000-11-27 Philip Blundell + + * libcoff-in.h (coff_tdata): Add `strings_written' flag. + (obj_coff_strings_written): New accessor macro for above. + * libcoff.h: Regenerate. + * cofflink.c (_bfd_coff_final_link): Say that we wrote the + strings. + * coffcode.h (coff_write_object_contents): No need to write out + the string table if it's already been done. + 2000-11-22 Philip Blundell * cofflink.c (_bfd_coff_generic_relocate_section): Don't object to diff --git a/bfd/coffcode.h b/bfd/coffcode.h index c5025fb52d1..a5721e0d2be 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -3798,7 +3798,7 @@ coff_write_object_contents (abfd) return false; } #ifdef COFF_LONG_SECTION_NAMES - else if (long_section_names) + else if (long_section_names && ! obj_coff_strings_written (abfd)) { /* If we have long section names we have to write out the string table even if there are no symbols. */ diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 05c0689ea94..4e16f6400e5 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -1102,6 +1102,8 @@ _bfd_coff_final_link (abfd, info) if (! _bfd_stringtab_emit (abfd, finfo.strtab)) return false; + + obj_coff_strings_written (abfd) = true; } _bfd_stringtab_free (finfo.strtab); diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h index 3fae93cf866..544e9e12f8d 100644 --- a/bfd/libcoff-in.h +++ b/bfd/libcoff-in.h @@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define obj_coff_strings(bfd) (coff_data (bfd)->strings) #define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings) #define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes) +#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written) #define obj_coff_local_toc_table(bfd) (coff_data(bfd)->local_toc_sym_map) @@ -83,6 +84,8 @@ typedef struct coff_tdata char *strings; /* If this is true, the strings may not be freed. */ boolean keep_strings; + /* If this is true, the strings have been written out already. */ + boolean strings_written; /* is this a PE format coff file */ int pe; diff --git a/bfd/libcoff.h b/bfd/libcoff.h index 9cf52e85471..e66b1cdd17d 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define obj_coff_strings(bfd) (coff_data (bfd)->strings) #define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings) #define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes) +#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written) #define obj_coff_local_toc_table(bfd) (coff_data(bfd)->local_toc_sym_map) @@ -83,6 +84,8 @@ typedef struct coff_tdata char *strings; /* If this is true, the strings may not be freed. */ boolean keep_strings; + /* If this is true, the strings have been written out already. */ + boolean strings_written; /* is this a PE format coff file */ int pe; -- cgit v1.2.1