scc

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

commit da56b0600b1cc39554afe7ee0e6b64c59678ace8
parent 7733e0ee7a75596ddeba68d6296e6ac4d23e18ad
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 23 Oct 2023 12:40:16 +0200

libmach: Fix type reading section number

The number of sections can be specified in the elf header (only 2 bytes)
but it can be stored also in the size of the first section header, and
in that case it is an unsigned value of 8 bytes, while we were using a
signed variable.

Diffstat:
Msrc/libmach/elf64/elf64read.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libmach/elf64/elf64read.c b/src/libmach/elf64/elf64read.c @@ -158,7 +158,7 @@ readphdr(Obj *obj, FILE *fp) static int readshdr(Obj *obj, FILE *fp) { - long long i, nsec; + unsigned long long i, nsec; Elf_Ehdr *hdr; Elf_Shdr *shdr; Elf64 *elf;