[LLVMdev] Stack roots and function parameters

Talin viridia at gmail.com
Mon Sep 20 15:16:58 PDT 2010


So I've managed to get my stack crawler working and passing its unit tests -
this is the one I've been working on as an alternative to shadow-stack: it
uses only static constant data structures (no global variables or
thread-local data), which means that it's fully compatible with a
multi-threaded environment.

One question that has arisen, however, is what to do about function
parameters that may be stack roots. You can't call llvm.gcroot() on a
function parameter. The only thing I can think of is to copy any function
parameter that is a pointer, or which contains a pointer, into a local
variable. This seems complicated and inefficient to me (for one thing, it
means that every stack frame just got 8 bytes bigger due to the need to
store the 'this' pointer locally)  - is there a better way?

-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100920/b683beff/attachment.html>


More information about the llvm-dev mailing list