tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Here's a bug that needs to be fixed


From: Ben Hutchinson
Subject: [Tinycc-devel] Here's a bug that needs to be fixed
Date: Tue, 28 Jun 2016 23:52:47 -0700

Not sure if this is fixed yet in the latest version of TCC (I haven't used TCC since I discovered the bug), but the last version of TCC that I used had this bug. When it writes an EXE file, it leaves 3 of the PE header fields blank. While the resulting EXE file does seem to run properly, the EXE file itself does not meet the official specifications, and therefore is technically an invalid EXE file. The PE header of the EXE file has these 3 fields left being set at 0
SizeOfCode
SizeOfInitializedData
SizeOfUninitializedData

So here's how those 3 header fields are supposed to be filled out:

SizeOfCode should equal the number of bytes of compiled machine code in the EXE file. This should be the size of the .text section of the EXE file. This should never be 0.

SizeOfInitialized data should (if there is a .data section in the EXE file) should equal the number of
bytes of initialized data. This should only be 0 if there is no .data section.

SizeOfUninitializedData data should (if there is a .bss section in the EXE file) should equal the number of bytes of uninitialized data. This should only be 0 if there is no .bss section.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]