Open pinskia opened 2 weeks ago
Actualy it is documented: https://clang.llvm.org/docs/AttributeReference.html#randomize-layout-no-randomize-layout
But it does not document how : "The randomization is deterministic based for a given seed, so the entire program should be compiled with the same seed, but keep the seed safe otherwise. " works.
Is it based on the struct name? Or something else? Or the order which the struct is defined? Or is the seed the same for each struct? It is not obvious?
Does clang record the seed and then error out if there are 2 TUs with the same seed? Seems like if this is a security feature then it should warn at least?
Does clang warn about when using randomize_layout with pointers? seems like without this is a security issue waiting to happen.
There is no documentation for the randomize_layout attribute in the clang documentation.