[LLVMdev] Randomizing Functions & Global variables

Misha Brukman brukman at cs.uiuc.edu
Fri Jun 3 07:48:24 PDT 2005


On Fri, Jun 03, 2005 at 07:28:48AM -0700, Tanu Sharma wrote:
> Ms Brukman, 

That's _Mr._ Brukman, but please skip the formality and call me Misha.
  
> I actually wanted to randomize the static layout of function code in
> the executable file.

Then what you want to do is to randomize the order of the Functions in
the Module's list of functions.  The assembly writer will output
Functions in the order that it sees them to a .s file, which will appear
in the same order in the executable.

I suggest looking at include/llvm/Module.h which will help with
accessing the FunctionList.

-- 
Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu




More information about the llvm-dev mailing list