> Is it possible to use Valgrind to detect unexpected changes to the GOT
> pointer when PIC is in effect? Or put another way, is it possible to detect
> unexpected changes to EBX/RBX?

There is no builtin feature to do that.  But if you are highly motivated
then here's how.

Add two words to the VEX register state structure for a thread: the
expected GOT value for RBX/EBX, and a pointer to a linked list of previous
pairs of words.  In the VEX code generator, recognize the "set GOT
pointer" idiom "CALL [MOV (%RSP),%RBX; RET]; ADDQ $NNNN,RBX" then cons the
new value of RBX into the front of the list.  Recognize
return-from-subroutine "POP %RBX; ...; RET", then check RBX against the
expected GOT, and cdr the list.



------------------------------------------------------------------------------
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to