In your EXE Global Embed “Creating the Export file” add a line with just “FIXED” and the Linker will not generate a Relocation section (.reloc) making the EXE smaller. The link will probably run a tiny bit faster. The EXE is loaded first and is never** relocated. Do NOT use for DLLs.
I tried it in DLLTutor and the EXE shrunk by only 1024 bytes. DumpBin verified the .reloc was gone. So I added it to some projects with big (too big) EXEs and see average 4% reduction in size:
Copy/Paste below into Global Embed: Creating the Export File
FIXED ; remove .reloc table … only use on EXE
FIXED is a common feature of Windows Linkers like the VS C++.
When /FIXED is specified, LINK does not generate a relocation section in the program. At run time, if the operating system is unable to load the program at the specified address, it issues an error message and does not load the program.
In An In-Depth Look into the Win32 Portable Executable File Format, Part 2
See section on “Base Relocations”
In Visual C++ 6.0, the linker omits relocations for EXEs when doing a release build. This is because EXEs are the first thing brought into an address space, and therefore are essentially guaranteed to load at the preferred load address. DLLs aren’t so lucky, so base relocations should always be left in, unless you have a reason to omit them with the /FIXED switch. In Visual Studio .NET, the linker omits base relocations for debug and release mode EXE files.
This article was from 2002. I am sure this has changed due to ASLR. I found it reassuring that FIXED used to be the norm for EXEs.
** ASLR can relocate EXEs but will NOT if FIXED is used. If you’ve figured out how to enable DYNAMICBASE you probably know this. ASLR = “Address Space Layout Randomization” a new security feature added in Vista.