Abhinav Srivastava <abhinavs_iitkgp@xxxxxxxxxxx> writes: > In my project, I am trying to develop a shadow stack where I can protect return addresses from getting modified. I want to do this by modifying function prologue and epilogue so that it could save return address on the call to a protected stack. And, verify the control flow during the return. > Is there any gcc patch exist that I can use for this purpose? If I have to create this my own, could you please give me some pointer how to do that? I'm not aware of any patch for that. You would need to modify the function prologue and epilogue code for the target that you care about. That will be in config/CPU where CPU is the one you care about; search for prologue and epilogue in the CPU.c file. This will not be a particularly easy modification to make. Ian