- /* Save now the stub to be used later. */
- bfd_coff_go32stub (abfd) = (PTR) bfd_alloc (abfd, (bfd_size_type) STUBSIZE);
-
- /* Since this function returns no status, I do not set here
- any bfd_error_...
- That means, before the use of bfd_coff_go32stub (), this value
- should be checked if it is != NULL. */
- if (bfd_coff_go32stub (abfd) == NULL)
- return;
- memcpy (bfd_coff_go32stub (abfd), filehdr_src->stub, STUBSIZE);
+ /* Save now the stub to be used later. Put the stub data to FILEHDR_DST
+ first as coff_data (abfd) still does not exist. It may not even be ever
+ created as we are just checking the file format of ABFD. */
+ memcpy (filehdr_dst->go32stub, filehdr_src->stub, GO32_STUBSIZE);
+ filehdr_dst->f_flags |= F_GO32STUB;