--- coffcode.h.orig Fri Apr 4 17:41:35 2003 +++ coffcode.h Fri Apr 4 17:43:41 2003 @@ -644,8 +644,10 @@ sec_flags |= SEC_DEBUGGING; #endif } + else if ((styp_flags & STYP_PAD) && (sec_flags & SEC_NEVER_LOAD)) + sec_flags = 0; else if (styp_flags & STYP_PAD) - sec_flags = 0; + sec_flags = SEC_LOAD; else if (strcmp (name, _TEXT) == 0) { if (sec_flags & SEC_NEVER_LOAD) @@ -702,6 +704,9 @@ if (styp_flags & STYP_OTHER_LOAD) sec_flags = (SEC_LOAD | SEC_ALLOC); #endif /* STYP_SDATA */ + + if (styp_flags & (STYP_COPY | STYP_DSECT)) + sec_flags &= ~SEC_ALLOC); #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE) /* As a GNU extension, if the name begins with .gnu.linkonce, we