size_t impsize, impcount;
struct xcoff_import_file *fl;
struct internal_ldhdr *ldhdr;
+ bfd_size_type stoff;
register char *out;
asection *sec;
bfd *sub;
+ 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)
{
;
}
- 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)