commit 93f4c2a86916c26e3118da10bf10699f58f875ad
parent f94b31189514cc79c1d5f0f75dca4df50236958b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 19 Jan 2025 14:09:49 +0100
libmach/elf64: Adjust elf alloc semantic
Elf defines alloc like data that uses memory at the execution time,
but coff defines alloc like data that uses disk space. As we also
have the concept of load, I think the coff semantic makes more sense
and it is better to use alloc for disk space allocated, and load for
execution memory allocated.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libmach/elf64/elf64getsec.c b/src/libmach/elf64/elf64getsec.c
@@ -39,9 +39,9 @@ elf64getsec(Obj *obj, int *idx, Section *sec)
if (flags & SHF_EXECINSTR)
sflags |= SEXEC;
if (flags & SHF_ALLOC)
- sflags |= SALLOC|SREAD;
+ sflags |= SLOAD|SREAD;
if (type != SHT_NOBITS)
- sflags |= SLOAD;
+ sflags |= SALLOC;
if (stype == 'T' || stype == 'D')
sflags |= SRELOC;