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...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3996 a5019735-40e9-0310-863c-91ae7b9d1cf9
1 file changed