1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00

Reinstate the ptrace patch to restore the 'gp' register after calling

a function. I made a mistake in assuming that the .cprestore directive
will cause the assembler to automatically restore 'gp' after the 'jalr'.

The .cprestore directive does its magic only after 'jal' and 'bal'
instructions - not the 'jalr'.

Pointed out by: c.jayachandran@gmail.com
This commit is contained in:
Neel Natu 2010-02-04 05:49:59 +00:00
parent 674440a942
commit 2f9f616df9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=203475

View File

@ -56,6 +56,9 @@ LEAF(ptrace)
#endif
la t9, _C_LABEL(__error) # locate address of errno
jalr t9
#ifdef __ABICALLS__
lw gp, 16(sp)
#endif
sw zero, 0(v0)
lw ra, 32(sp)
addu sp, sp, 40