|
From: <sv...@va...> - 2005-06-22 12:11:47
|
Author: tom Date: 2005-06-22 13:11:42 +0100 (Wed, 22 Jun 2005) New Revision: 3996 Log: Declare my_sigreturn as static. This is correct in so much as it isn't used anywhere else, but it does cause gcc to issue a warning because it doesn't realised that the assembly code has defined the function. The reason for changing it to static despite the warning is that when it is declared extern PIE builds break on amd64 because gcc generates code that does a load from the address of the my_sigreturn symbol to get address of the function instead of just computing the address of the symbol. In other words it generates this: mov -212(%rip), %rax to get the address of the function instead of this: lea -212(%rip), %rax Obviously this breaks things because we store the wrong address as the signal restorer when installing the signal handler... Modified: trunk/coregrind/m_signals.c Modified: trunk/coregrind/m_signals.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_signals.c 2005-06-21 23:44:58 UTC (rev 3995) +++ trunk/coregrind/m_signals.c 2005-06-22 12:11:42 UTC (rev 3996) @@ -395,7 +395,7 @@ =20 // We need two levels of macro-expansion here to convert __NR_rt_sigretu= rn // to a number before converting it to a string... sigh. -extern void my_sigreturn(void); +static void my_sigreturn(void); =20 #if defined(VGP_x86_linux) # define _MYSIG(name) \ |