For every candidate function (i.e., not marketd as safe by MEDS, nice stack frame allocation/dealloc)
Generate assembly SPRI files for every candidate function in statically-linked program
Generate binary SPRI files for every candidate function in statically-linked program
Produce coverage information for all candidate functions
Use instruction execution information provided by Grace + instructions info per function provided by MEDS/ELF (for a fn, metric is: #instructions-visited/#instructions-in-function). A better metric here could be: #instructions-stack-reference/#instruction-stack-references-in-function (TBD).
Run BED (Behavioral Equivalence Detector)
Use GrammatTech's replayer tool
Produce final set of spri rules by merging all functions that pass BED
Literally a merge of all the files
Validate binary with final merged set of rules
Use BED again
Deploy binary
If the validation fails, we leave the original binary alone, i.e., PEASOUP runs the stratafied binary but w/o any P1 transform rules
Otherwise, PEASOUP automatically picks up the P1 transform rules
NB: to do later: if validation fails we need to iterate and remove rules until we get a set of rules that pass BED. One way of doing this is to use coverage information to guide this search, i.e., start by removing the least covered functions first.
Notes
-----------------------------
P1 only attempts to transform functions that are "nice" (stack frame alloc/dealloc, not memory safe)