selfrando
selfrando copied to clipboard
Preserve function alignment on Windows
On Win64, the linker aligns functions to 16 bytes. Our randomization currently ignores this, at some (yet unknown) performance cost.
However, if we started adding any padding before the functions, we'd overflow the size of .text
. We have two possible solutions:
- Add additional space in the form of additional padding, like we do on Linux.
- Once we fix issue #23 and can safely discard the existing padding that the linker adds in, we gain some space in
.text
for our own alignment. In most cases, this should give us enough space for our padding.