Share via


/ORDER (Windows CE 5.0)

Send Feedback

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.

/ORDER:@filename

Remarks

Specify the order in filename, which is a text file that lists the COMDATs in the order 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 Compiler-generated Decorated Function 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 programs 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.

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.

See Also

Linker Options | About COFF

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.