TLS callbacks: one entry only

https://github.com/upx/upx/issues/186  [partial, incomplete]
(Laszlo hints there is more, but meanwhile this does fix some.)
	modified:   pefile.cpp
This commit is contained in:
John Reiser 2018-04-06 13:42:55 -07:00
parent 8a793d5942
commit b711d2f750

View File

@ -1412,6 +1412,7 @@ void PeFile::processTls2(Reloc *rel,const Interval *iv,unsigned newaddr,
{
//set handler offset
*(LEXX*)(otls + sotls - 2 * cb_size) = tls_handler_offset + imagebase;
*(LEXX*)(otls + sotls - 1 * cb_size) = 0; // end of one-item list
//add relocation for TLS handler offset
rel->add(newaddr + sotls - 2 * cb_size, reloc_type);
}