Home | Overview | How Do I | Linker Options
/ORDER:@filename
This option tells LINK to optimize your program by placing certain COMDATs into the image in a predetermined order. LINK places the functions in the specified order within each section in the image.
Specify the order in filename, which is a text file that lists the COMDATs in the order you want to link them. Each line in filename contains the name of one COMDAT. An object contains COMDATs if it has been compiled with the /Gy option. Function names are case sensitive.
LINK uses decorated forms of identifiers. The compiler decorates an identifier when it creates the .OBJ file. If the name of the COMDAT is specified to the linker in its undecorated form (as it appears in the source code), LINK attempts to match the name. If it cannot find a unique match, LINK issues an error message. Use the DUMPBIN tool to get the decorated form of an identifier when you need to specify it to the linker. For more information on decorated names, see Decorated Names.
Note Do not specify the decorated form of C identifiers that are declared __cdecl or __stdcall.
If more than one /ORDER specification is used, the last one specified takes effect.
Ordering allows you to optimize your program’s paging behavior through swap tuning by grouping a function with the functions it calls. You can also group frequently called functions together. These techniques increase the probability that a called function is in memory when it is needed and will not have to be paged from disk.
The /ORDER option disables incremental linking.
Note LINK cannot order static functions because static function names are not public symbol names. When /ORDER is specified, linker warning LNK4037 is generated for each symbol, in the order file, that is either static or not found.