* coffcode.h (sec_to_styp_flags): Remove read/write flags from noload section
header. Do not add STYP_NOLOAD since it does not appear to be a valid PE flag.
This commit is contained in:
parent
6bd00c5db5
commit
3b137b9a08
|
@ -1,3 +1,9 @@
|
||||||
|
2005-06-09 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* coffcode.h (sec_to_styp_flags): Remove read/write flags from noload
|
||||||
|
section header. Do not add STYP_NOLOAD since it does not appear to be
|
||||||
|
a valid PE flag.
|
||||||
|
|
||||||
2005-06-09 H.J. Lu <hongjiu.lu@intel.com>
|
2005-06-09 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR 1000
|
PR 1000
|
||||||
|
|
|
@ -531,7 +531,7 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
|
||||||
/* FIXME: There is no gas syntax to specify the debug section flag. */
|
/* FIXME: There is no gas syntax to specify the debug section flag. */
|
||||||
if (strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0
|
if (strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0
|
||||||
|| strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0)
|
|| strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0)
|
||||||
sec_flags = SEC_READONLY | SEC_DEBUGGING;
|
sec_flags = SEC_DEBUGGING;
|
||||||
|
|
||||||
/* skip LOAD */
|
/* skip LOAD */
|
||||||
/* READONLY later */
|
/* READONLY later */
|
||||||
|
@ -545,10 +545,6 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
|
||||||
/* skip ROM */
|
/* skip ROM */
|
||||||
/* skip constRUCTOR */
|
/* skip constRUCTOR */
|
||||||
/* skip CONTENTS */
|
/* skip CONTENTS */
|
||||||
#ifdef STYP_NOLOAD
|
|
||||||
if ((sec_flags & (SEC_NEVER_LOAD | SEC_COFF_SHARED_LIBRARY)) != 0)
|
|
||||||
styp_flags |= STYP_NOLOAD;
|
|
||||||
#endif
|
|
||||||
if ((sec_flags & SEC_IS_COMMON) != 0)
|
if ((sec_flags & SEC_IS_COMMON) != 0)
|
||||||
styp_flags |= IMAGE_SCN_LNK_COMDAT;
|
styp_flags |= IMAGE_SCN_LNK_COMDAT;
|
||||||
if ((sec_flags & SEC_DEBUGGING) != 0)
|
if ((sec_flags & SEC_DEBUGGING) != 0)
|
||||||
|
@ -564,10 +560,11 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
|
||||||
/* skip LINK_DUPLICATES */
|
/* skip LINK_DUPLICATES */
|
||||||
/* skip LINKER_CREATED */
|
/* skip LINKER_CREATED */
|
||||||
|
|
||||||
|
if (sec_flags & SEC_ALLOC)
|
||||||
|
{
|
||||||
/* For now, the read/write bits are mapped onto SEC_READONLY, even
|
/* For now, the read/write bits are mapped onto SEC_READONLY, even
|
||||||
though the semantics don't quite match. The bits from the input
|
though the semantics don't quite match. The bits from the input
|
||||||
are retained in pei_section_data(abfd, section)->pe_flags. */
|
are retained in pei_section_data(abfd, section)->pe_flags. */
|
||||||
|
|
||||||
styp_flags |= IMAGE_SCN_MEM_READ; /* Always readable. */
|
styp_flags |= IMAGE_SCN_MEM_READ; /* Always readable. */
|
||||||
if ((sec_flags & SEC_READONLY) == 0)
|
if ((sec_flags & SEC_READONLY) == 0)
|
||||||
styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write. */
|
styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write. */
|
||||||
|
@ -575,6 +572,7 @@ sec_to_styp_flags (const char *sec_name, flagword sec_flags)
|
||||||
styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE. */
|
styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE. */
|
||||||
if (sec_flags & SEC_COFF_SHARED)
|
if (sec_flags & SEC_COFF_SHARED)
|
||||||
styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful. */
|
styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful. */
|
||||||
|
}
|
||||||
|
|
||||||
return styp_flags;
|
return styp_flags;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue