Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.87 KB

filealign.md

File metadata and controls

45 lines (28 loc) · 1.87 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: /FILEALIGN (Align sections in files)
/FILEALIGN (Align sections in files)
10/23/2017
/filealign
linker align sections
/FILEALIGN linker option
-FILEALIGN linker option
FILEALIGN linker option
c1017a35-8d71-4ad9-934b-a3e3ea037fa0

/FILEALIGN (Align sections in files)

The /FILEALIGN linker option lets you specify the alignment of sections written to your output file as a multiple of an specified size.

Syntax

/FILEALIGN:size

Parameters

size
The section alignment size in bytes, which must be a power of two.

Remarks

The /FILEALIGN option causes the linker to align each section in the output file on a boundary that is a multiple of the size value. By default, the linker does not use a fixed alignment size.

The /FILEALIGN option can be used to make disk utilization more efficient, or to make page loads from disk faster. A smaller section size may be useful for apps that run on smaller devices, or to keep downloads smaller. Section alignment on disk does not affect alignment in memory.

Use DUMPBIN to see information about sections in your output file.

To set this linker option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > Linker > Command Line property page.

  3. Enter the option name /FILEALIGN: and the size in the Additional Options box.

To set this linker option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A.

See also

MSVC linker reference
MSVC Linker Options