When TCC outputs an EXE file, while that file does run (luckily) the EXE
file is missing the SizeOfCode and SizeOfData fields in the PE header.
Actually, they aren't missing, but they are left at the value 0 (zero),
which is incorrect. This means that technically the EXE file is an invalid
EXE file. SizeOfCode should be the size (in bytes) of the .text section of
the EXE file, rounded up to the nearest multiple of 4096. Likewise,
SizeOfData should be the size (in bytes) of the .data section, rounded up
to the nearest multiple of 4096. While this corrupt EXE file does run,
there's no guarenty that in future versions of Windows that it will still
be able to run. Microsoft might start more strictly enforcing the PE header
standard, and then all EXE files output by TCC will no longer be able to
run.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to