From 7c3b2fb9cc25623efb0a945bef48596689f81281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Moln=C3=A1r?= Date: Wed, 8 Sep 2010 15:06:56 +0200 Subject: [PATCH] relocation entry for TLS callbacks is only needed when we do have TLS callbacks --- src/p_w32pe.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_w32pe.cpp b/src/p_w32pe.cpp index 26055bba..f3ad5edf 100644 --- a/src/p_w32pe.cpp +++ b/src/p_w32pe.cpp @@ -1180,9 +1180,12 @@ void PackW32Pe::pack(OutputFile *fo) //ic = s1addr + s1size - sotls - soloadconf; //ATTENTION: moved upwards to TLS callback handling - Stefan Widmann //get address of TLS callback handler - tls_handler_offset = linker->getSymbolOffset("PETLSC2"); - //add relocation entry for TLS callback handler - rel.add(tls_handler_offset + 4, 3); + if (use_tls_callbacks) + { + tls_handler_offset = linker->getSymbolOffset("PETLSC2"); + //add relocation entry for TLS callback handler + rel.add(tls_handler_offset + 4, 3); + } processTls(&rel,&tlsiv,ic); ODADDR(PEDIR_TLS) = sotls ? ic : 0;