[PATCH 10/17] bfd / PE/COFF / arm: permit SEC_READONLY
Jan Beulich
jbeulich@suse.com
Mon Aug 4 09:22:09 GMT 2025
Without this, even the default .text section would end up with the
IMAGE_SCN_MEM_WRITE flag, which is clearly wrong. (Afaict the flag,
oddly enough, doesn't affect the final linked binary, so there likely
are more anomalies.)
This is just so the target won't need excluding in a forthcoming new
testcase, which uses the .rva directive.
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -2562,7 +2562,8 @@ coff_arm_final_link_postscript (bfd * ab
#ifndef EXTRA_S_FLAGS
#ifdef COFF_WITH_PE
-#define EXTRA_S_FLAGS (SEC_CODE | SEC_LINK_ONCE | SEC_LINK_DUPLICATES)
+#define EXTRA_S_FLAGS (SEC_CODE | SEC_LINK_ONCE | SEC_LINK_DUPLICATES \
+ | SEC_READONLY)
#else
#define EXTRA_S_FLAGS SEC_CODE
#endif
More information about the Binutils
mailing list