diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-10-25 18:31:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-10-25 18:31:27 +0000 |
commit | 9c234e298d49ce82ef36cc17602cb556c7f7eebe (patch) | |
tree | 47a8a1c3296cc155d6aadd596266d5907322ccb5 /bfd/xcofflink.c | |
parent | afe07862713ef8193a4d7e1110d5e187c0d2f1ad (diff) | |
download | gdb-9c234e298d49ce82ef36cc17602cb556c7f7eebe.zip gdb-9c234e298d49ce82ef36cc17602cb556c7f7eebe.tar.gz gdb-9c234e298d49ce82ef36cc17602cb556c7f7eebe.tar.bz2 |
set l_stoff to 0 if there are no strings
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r-- | bfd/xcofflink.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 47ab49f..3e07d05 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -1989,6 +1989,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, size_t impsize, impcount; struct xcoff_import_file *fl; struct internal_ldhdr *ldhdr; + bfd_size_type stoff; register char *out; asection *sec; bfd *sub; @@ -2072,12 +2073,16 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, + ldhdr->l_nsyms * LDSYMSZ + ldhdr->l_nreloc * LDRELSZ); ldhdr->l_stlen = ldinfo.string_size; - ldhdr->l_stoff = ldhdr->l_impoff + impsize; + stoff = ldhdr->l_impoff + impsize; + if (ldinfo.string_size == 0) + ldhdr->l_stoff = 0; + else + ldhdr->l_stoff = stoff; /* We now know the final size of the .loader section. Allocate space for it. */ lsec = xcoff_hash_table (info)->loader_section; - lsec->_raw_size = ldhdr->l_stoff + ldhdr->l_stlen; + lsec->_raw_size = stoff + ldhdr->l_stlen; lsec->contents = (bfd_byte *) bfd_zalloc (output_bfd, lsec->_raw_size); if (lsec->contents == NULL) { @@ -2110,8 +2115,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, ; } - BFD_ASSERT ((bfd_size_type) ((bfd_byte *) out - lsec->contents) - == ldhdr->l_stoff); + BFD_ASSERT ((bfd_size_type) ((bfd_byte *) out - lsec->contents) == stoff); /* Set up the symbol string table. */ if (ldinfo.string_size > 0) |