Sun Studio 12: C User's Guide

B.2.88 -xF[=v[,v...]]

Enables optimal reordering of functions and variables by the linker.

This option instructs the compiler to place functions and/or data variables into separate section fragments, which enables the linker, using directions in a mapfile specified by the linker’s -M option, to reorder these sections to optimize program performance. Generally, this optimization is only effective when page fault time constitutes a significant fraction of program run time.

Reording of variables can help solve the following problems which negatively impact run-time performance:

Reordering variables and functions for optimal performance requires the following operations:

  1. Compiling and linking with -xF.

  2. Following the instructions in the "Program Performance Analysis" Tools manual regarding how to generate a mapfile for functions or following the instructions in the "Linker and Libraries Guide" regarding how to generate a mapfile for data.

  3. Relinking with the new mapfile by using the linker’s -M option.

  4. Re-executing under the Analyzer to verify improvement.

B.2.88.1 Values

v can be one or more of the following:

Table B–23 The -xF Values




[Do not] fragment functions into separate sections. 


[Do not] fragment global data (variables with external linkage) into separate sections. 


[Do not] fragment local data (variables with internal linkage) into separate sections. 


Fragment functions, global data, and local data. 


Fragment nothing. 

If you do not specify -xF, the default is -xF=%none. If you specify -xF without any arguments, the default is -xF=%none,func.

Using -xF=lcldata inhibits some address calculation optimizations, so you should only use this flag when it is experimentally justified.

analyzer(1), debugger(1), ld(1) man pages.