]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
bfd / PE/COFF: permit SEC_READONLY and consolidate
authorJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2025 14:01:16 +0000 (16:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Oct 2025 14:01:16 +0000 (16:01 +0200)
commit6b7bbb694201d7450258080d4fa9b759c27be50e
treecd989fd91f4ff06efa92ddc92a82b8b32aeac6af
parentc0f8a4a25e5de8194ea6cfe49a84ef61bf426676
bfd / PE/COFF: permit SEC_READONLY and consolidate

Without SEC_READONLY, 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.)

However, as suggested by Richard Earnshaw, PE's requirements are really
target independent. Consolidate SEC_CODE, SEC_DATA, SEC_READONLY,
SEC_LINK_ONCE, and SEC_LINK_DUPLICATES into target-independent code. Yet
of course targets not using CREATE_*_COFF_TARGET_VEC() won't benefit.

Note that in coff-arm.c the EXTRA_S_FLAGS conditional was also stale
(leftover from EPOC removal), and hence can go away.
bfd/coff-arm.c
bfd/coff-mcore.c
bfd/coff-sh.c
bfd/coffcode.h