scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit a99a218615a40203e5a9b10f233deb8e79235a3d
parent 8d23e114fea69c8652fc1482b1d7b4af032f223a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 18 Jan 2025 23:42:56 +0100

libmach/coff32: Add write right to text sections

Coff does not have the concept of read and write rights,
and assuming that text sections would be not writable was
a too strong assumption. It is better to assume that they
can be modified and some systmes will disallow that but it
would not have effect in the binary format.

Diffstat:
Msrc/libmach/coff32/coff32getsec.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libmach/coff32/coff32getsec.c b/src/libmach/coff32/coff32getsec.c @@ -43,7 +43,7 @@ coff32getsec(Obj *obj, int *idx, Section *sec) break; case STYP_TEXT: type = 'T'; - sflags = SALLOC | SRELOC | SLOAD | SEXEC | SREAD; + sflags = SALLOC | SRELOC | SLOAD | SEXEC | SREAD | SWRITE; break; case STYP_DATA: type = 'D'; @@ -55,7 +55,7 @@ coff32getsec(Obj *obj, int *idx, Section *sec) break; case STYP_TEXT | STYP_DATA: type = 'D'; - sflags = SEXEC | SALLOC | SRELOC | SLOAD | SREAD; + sflags = SEXEC | SALLOC | SRELOC | SLOAD | SREAD | SWRITE; break; case STYP_LIT: case STYP_RDATA: