aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 4f615dd..29b83ff 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -399,9 +399,21 @@ DEFUN(styp_to_sec_flags, (styp_flags),
}
#endif /* STYP_NOLOAD */
- if ((styp_flags & STYP_TEXT) || (styp_flags & STYP_DATA))
+ /* For 386 COFF, at least, an unloadable text or data section is
+ actually a shared library section. */
+ if (styp_flags & STYP_TEXT)
{
- sec_flags |= SEC_LOAD | SEC_ALLOC;
+ if (sec_flags & SEC_NEVER_LOAD)
+ sec_flags |= SEC_CODE | SEC_SHARED_LIBRARY;
+ else
+ sec_flags |= SEC_CODE | SEC_LOAD | SEC_ALLOC;
+ }
+ else if (styp_flags & STYP_DATA)
+ {
+ if (sec_flags & SEC_NEVER_LOAD)
+ sec_flags |= SEC_DATA | SEC_SHARED_LIBRARY;
+ else
+ sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC;
}
else if (styp_flags & STYP_BSS)
{