(In addition to Mason's answer, which is correct).
I launched PE Viewer / Editor and can confirm no export. So now the question is: why is TLS allocated in the application without threads, and what should I do about it? Removing it from the PE table works fine, except for an application error on shutdown.
System.pas contains 2 threads, InOutRes (for I / O errors) and RaiseListPtr. I do not need these two to be threadvars in my application, but they seem invisible to the whole system. It looks like a tough nut.
As a workaround, I prematurely terminate my own process using
TerminateProcess( GetCurrentProcess, 0 )
to prevent any errors when shutting down properly (deep inside the more elegant ExitProcess from Delphi _Halt0). In the postbuild phase, I remove TLS from PE and package using kkrunchy. Up to 8192 bytes, and no problem. Presently. The code is ethical, it seems to me that I should be put in jail. :)
source share