@@ -149,13 +149,21 @@ DllMain(
149149
150150 "movq %%rdx, %%gs:0" "\n\t"
151151
152- /*
153- * Call TkFinalize
154- */
152+ :
153+ /* No outputs */
154+ :
155+ [registration ] "m" (registration ),
156+ [error ] "i" (TCL_ERROR )
157+ :
158+ "%rax" , "%rdx" , "memory"
159+ );
155160
156- "movq $0x0, 0x0(%%rsp)" "\n\t"
157- "call TkFinalize" "\n\t"
161+ /* Just do a regular C call so we don't need to worry about following
162+ * the calling convention, specially the registers the function may
163+ * clobber: */
164+ TkFinalize (NULL );
158165
166+ __asm__ __volatile__ (
159167 /*
160168 * Come here on a normal exit. Recover the TCLEXCEPTION_REGISTRATION
161169 * and store a TCL_OK status
@@ -189,11 +197,9 @@ DllMain(
189197 :
190198 /* No outputs */
191199 :
192- [registration ] "m" (registration ),
193- [ok ] "i" (TCL_OK ),
194- [error ] "i" (TCL_ERROR )
200+ [ok ] "i" (TCL_OK )
195201 :
196- "%rax" , "%rbx" , "%rcx" , "% rdx" , "%rsi" , "%rdi " , "memory"
202+ "%rax" , "%rdx" , "memory"
197203 );
198204
199205# else
@@ -219,12 +225,18 @@ DllMain(
219225
220226 "movl %%edx, %%fs:0" "\n\t"
221227
222- /*
223- * Call TkFinalize
224- */
228+ :
229+ /* No outputs */
230+ :
231+ [registration ] "m" (registration ),
232+ [error ] "i" (TCL_ERROR )
233+ :
234+ "%eax" , "%ebx" , "%edx" , "memory"
235+ );
236+
237+ TkFinalize (NULL );
225238
226- "movl $0x0, 0x0(%%esp)" "\n\t"
227- "call _TkFinalize" "\n\t"
239+ __asm__ __volatile__ (
228240
229241 /*
230242 * Come here on a normal exit. Recover the TCLEXCEPTION_REGISTRATION
@@ -260,11 +272,9 @@ DllMain(
260272 :
261273 /* No outputs */
262274 :
263- [registration ] "m" (registration ),
264- [ok ] "i" (TCL_OK ),
265- [error ] "i" (TCL_ERROR )
275+ [ok ] "i" (TCL_OK )
266276 :
267- "%eax" , "%ebx" , "%ecx" , "% edx" , "%esi" , "%edi " , "memory"
277+ "%eax" , "%ebx" , "%edx" , "memory"
268278 );
269279
270280# endif
0 commit comments