public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Inserting code into prologue/epilogue
@ 2010-03-21 15:03 Vaibhav Shrimali
  0 siblings, 0 replies; only message in thread
From: Vaibhav Shrimali @ 2010-03-21 15:03 UTC (permalink / raw)
  To: gcc

/*************************************************************************************************/
x = cfun->machine->force_align_arg_pointer;
x = gen_frame_mem (Pmode, plus_constant (x, -8)) xor hard_frame_pointer_rtx;
insn = emit_insn (gen_push (x));
RTX_FRAME_RELATED_P (insn) = 1;
/*************************************************************************************************/

I am trying to push a copy of return address just below the return
address and xor it with the "frame pointer". I wanted to know if the
above code is correct for pushing the return address and encrypt it
with the frame pointer.
Now, in the epilogue I want to decrypt this copy of return address
with the pushed frame pointer and verify if the two instances
(original and decrypted) of the return address are same. This is the
first time I am working on an approach that requires to make
modifications to the ix86_expand_prologue/epilogue methods of the
compiler. I also wanted to know how to read the value of encrypted
return address in the ix86_expand_epilogue method, since then I need
to decrypt it and compare it with the original return address pushed
on the stack.


-- 
Vaibhav Shrimali
BTech(ICT), DA-IICT
Gandhinagar, INDIA

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-21 10:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-21 15:03 Inserting code into prologue/epilogue Vaibhav Shrimali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).