Hacker News new | ask | show | jobs
by landave 3062 days ago
So I just tried to compile 7-Zip with VS2017 and /DYNAMICBASE. The main binary 7z.dll is 1,569,792 bytes in total, 9344 bytes (0.595%) of which are used by the relocation table. Enabling stack canaries (/GS) gives me a 1,578,496 byte binary (including the relocation table), so another 8704 bytes more.
1 comments

It would be interesting to have a comparison based on locally built binaries both with and without these features enabled.

Performing the tests on packing the actual 7-Zip source code (as shipped without extras) would be a valid reference suite.

I assume you mean a performance comparison? The runtime performance cost of ASLR on Windows is zero once a binary has been loaded, since the code is relocated at load time.

Stack canaries might cause a slight performance hit, but it is usually below one percent, since it creates only a small cost per function call for a fraction of all functions.

People not caring about load time costs are probably one of the reasons the guy still uses VC6, which starts up practically instantly.
It isn't even per function call in all implementations.