*** coffcode.h.orig	Sat Jan 13 14:42:22 2001
--- coffcode.h	Tue Apr 17 13:10:12 2001
*************** coff_add_missing_symbols (abfd)
*** 3215,3220 ****
--- 3215,3224 ----
  
  #endif /* 0 */
  
+ #if defined (__MSDOS__)
+ #define COFF_PAD_SECTION_HEADERS
+ #endif
+ 
  /* SUPPRESS 558 */
  /* SUPPRESS 529 */
  static boolean
*************** coff_write_object_contents (abfd)
*** 3596,3601 ****
--- 3600,3618 ----
      }
  #endif
  
+ #ifdef COFF_PAD_SECTION_HEADERS
+   if ((abfd->flags & EXEC_P) != 0)
+     {
+       file_ptr cur_ptr = scn_base
+                          + abfd->section_count * bfd_coff_scnhsz (abfd);
+       long fill_size = (abfd->sections->filepos - cur_ptr);
+       bfd_byte *b = bfd_zmalloc (fill_size);
+       if (b)
+         bfd_write ((PTR)b, 1, fill_size, abfd);
+       free (b);
+     }
+ #endif
+ 
    /* OK, now set up the filehdr...  */
  
    /* Don't include the internal abs section in the section count */
