Documentation
Optimizations
Binary Metadata

Binary Metadata Optimizations

This documentation describes how to make your binary sharp by making it less metadatas.

Removing Rich Header

Avaritia remove_rich_header is also available for this optimization.

So-called rich header is an undocumented latent tracking information available only within MSVC linker.

This header contains a set of tool version, product identifier and use count, of the toolchain.

  • Add /EMITTOOLVERSIONINFO:NO to the linker flag.

Remove Profile Guided Optimization (POGO) Metadata

Profile Guided Optimization (PGO), also known as Profile Guided Optimization (POGO) in MSVC, is an advanced optimization technique used during the compilation of programs. This feature is available by default when whole program optimization (either /GL or /LTCG) is enabled.

Profile-guided optimization (PGO) lets you optimize a whole executable file, where the optimizer uses data from test runs of the .exe or .dll file. The data represents the likely performance of the program in a production environment.1

PGO will be stored in the debug directory as an entry and allows the compiler to optimize the performance of an application based on actual usage data collected during the execution of the program.

This is an instrumentation feature and does not required in production and may expose where the function contained in the protected chunks.

  • Add /EMITPOGOPHASEINFO to the linker flag.

For more information about POGO, see The Article by Visual CPP Team (opens in a new tab).

Remove VC Feature Metadata

The VC Feature will be contained in the debug directory as an entry and provides what toolchain information used to build the binary in MSVC.

  • Add /NOVCFEATURE to the linker flag.

Footnotes

  1. https://learn.microsoft.com/en-us/cpp/build/profile-guided-optimizations?view=msvc-170 (opens in a new tab)

© 2024-present SECTOR 501 LLC. All rights reserved.
Buildbff736e