Fix the build

This commit is contained in:
Justine Tunney 2023-08-11 09:49:39 -07:00
parent 0105e3e2b6
commit 2cbd09b4d4
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 9 additions and 11 deletions

View file

@ -19,7 +19,7 @@ MAKEFLAGS += --no-builtin-rules
MAKE_ZIPCOPY = $(COMPILE) -AZIPCOPY -wT$@ $(ZIPCOPY) $< $@
MAKE_PECHECK = $(COMPILE) -APECHECK -wT$@ $(PECHECK) $@
ifneq ($(ARCH), aarch64)
MAKE_OBJCOPY = $(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ && $(MAKE_ZIPCOPY) && $(MAKE_PECHECK)
MAKE_OBJCOPY = $(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ && $(MAKE_ZIPCOPY)
else
MAKE_OBJCOPY = $(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S $< $@ && $(MAKE_ZIPCOPY)
endif

View file

@ -747,11 +747,11 @@ static int ValidatePeImage(char *img, size_t imgsize, //
if (pe->OptionalHeader.SizeOfHeaders >= pe->OptionalHeader.SizeOfImage)
Die(path, "PE SizeOfHeaders < SizeOfImage must be the case");
if (pe->OptionalHeader.SizeOfStackCommit >> 32)
Die(path, "PE SizeOfStackReserve can't exceed 4GB");
Die(path, "PE SizeOfStackCommit can't exceed 4GB");
if (pe->OptionalHeader.SizeOfStackReserve >> 32)
Die(path, "PE SizeOfStackReserve can't exceed 4GB");
if (pe->OptionalHeader.SizeOfHeapCommit >> 32)
Die(path, "PE SizeOfHeapReserve can't exceed 4GB");
Die(path, "PE SizeOfHeapCommit can't exceed 4GB");
if (pe->OptionalHeader.SizeOfHeapReserve >> 32)
Die(path, "PE SizeOfHeapReserve can't exceed 4GB");
@ -779,7 +779,7 @@ static int ValidatePeImage(char *img, size_t imgsize, //
kNtPeSectionCntUninitializedData) {
if (sections[i].SizeOfRawData)
Die(path, "PE SizeOfRawData should be zero for pure BSS section");
if (sections[i].SizeOfRawData)
if (sections[i].PointerToRawData)
Die(path, "PE PointerToRawData should be zero for pure BSS section");
}
if (!i) {

View file

@ -18,7 +18,6 @@
*/
#include "libc/calls/calls.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/kprintf.h"
#include "libc/limits.h"
#include "libc/nt/struct/imageimportbyname.internal.h"
#include "libc/nt/struct/imageimportdescriptor.internal.h"
@ -199,11 +198,11 @@ static void CheckPe(const char *path, char *map, size_t size) {
if (pe->OptionalHeader.SizeOfHeaders >= pe->OptionalHeader.SizeOfImage)
Die(path, "PE SizeOfHeaders < SizeOfImage must be the case");
if (pe->OptionalHeader.SizeOfStackCommit >> 32)
Die(path, "PE SizeOfStackReserve can't exceed 4GB");
Die(path, "PE SizeOfStackCommit can't exceed 4GB");
if (pe->OptionalHeader.SizeOfStackReserve >> 32)
Die(path, "PE SizeOfStackReserve can't exceed 4GB");
if (pe->OptionalHeader.SizeOfHeapCommit >> 32)
Die(path, "PE SizeOfHeapReserve can't exceed 4GB");
Die(path, "PE SizeOfHeapCommit can't exceed 4GB");
if (pe->OptionalHeader.SizeOfHeapReserve >> 32)
Die(path, "PE SizeOfHeapReserve can't exceed 4GB");
@ -231,7 +230,7 @@ static void CheckPe(const char *path, char *map, size_t size) {
kNtPeSectionCntUninitializedData) {
if (sections[i].SizeOfRawData)
Die(path, "PE SizeOfRawData should be zero for pure BSS section");
if (sections[i].SizeOfRawData)
if (sections[i].PointerToRawData)
Die(path, "PE PointerToRawData should be zero for pure BSS section");
}
if (!i) {
@ -298,7 +297,6 @@ static void CheckPe(const char *path, char *map, size_t size) {
Die(exe->path, "PE ImportAddressTable RVA didn't resolve to a section");
for (int j = 0;; ++j, ++ilt, ++iat) {
if (*ilt != *iat) {
kprintf("i=%d j=%d ilt=%#x iat=%#x\n", i, j, *ilt, *iat);
Die(exe->path, "PE ImportLookupTable and ImportAddressTable should "
"have identical content");
}

View file

@ -483,8 +483,8 @@ void HandleClient(void) {
goto TerminateJob;
}
if (received > 0) {
WARNF("%s client sent %d bytes unexpected bytes so killing job",
exename, received);
WARNF("%s client sent %d unexpected bytes so killing job", exename,
received);
goto TerminateJob;
}
if (received != MBEDTLS_ERR_SSL_WANT_READ) {