aboutsummaryrefslogtreecommitdiff
path: root/include/coff
diff options
context:
space:
mode:
Diffstat (limited to 'include/coff')
-rw-r--r--include/coff/pe.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/coff/pe.h b/include/coff/pe.h
index f51ceed..5239916 100644
--- a/include/coff/pe.h
+++ b/include/coff/pe.h
@@ -104,7 +104,10 @@
/* Encode alignment power into IMAGE_SCN_ALIGN bits of s_flags. */
#define COFF_ENCODE_ALIGNMENT(SECTION, ALIGNMENT_POWER) \
- ((SECTION).s_flags |= IMAGE_SCN_ALIGN_POWER_CONST ((ALIGNMENT_POWER)))
+ ((SECTION).s_flags |= IMAGE_SCN_ALIGN_POWER_CONST ((ALIGNMENT_POWER) <= 13 \
+ ? (ALIGNMENT_POWER) : 13))
+#define COFF_DECODE_ALIGNMENT(X) \
+ IMAGE_SCN_ALIGN_POWER_NUM ((X) & IMAGE_SCN_ALIGN_POWER_BIT_MASK)
#define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000 /* Section contains extended relocations. */
#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 /* Section is not cachable. */