Use this panel to control linker optimizations. The linker's optimizer can apply any of its optimizations in either global or non-global optimization mode. You can apply global optimization at the end of the development cycle, after compiling and optimizing all source files individually or in groups.
The following table lists and describes the linker optimization options for HCS08 .
| Option | Description |
|---|---|
| Allocation over segment boundaries (-Alloc) | The linker supports to allocate objects from one ELF section into different segments. The allocation strategy controls where space for the next object is allocated as soon as the first segment is full. In the AllocNext strategy, the linker always takes the next segment as soon as the current segment is full. Holes generated during this process are not used later. With this strategy, the allocation order corresponds to the definition order in the object files. Objects defined first in a source file are allocated before later defined objects. In the AllocFirst strategy, the linker checks for every object, if there is a previously only partially used segment, into which the current object does fit. This strategy does not maintain the definition order. In the AllocChange strategy, the linker checks as soon as a object does no longer fit into the current segment, if there is a previously only partially used segment, into which the current object does fit. This strategy does not maintain the definition order, but it does however use fewer different ranges than the AllocFirst case. |
| Allocate non referenced overlap variables (-CAllocUnusedOverlap) | When Smart Linking is switched off, defined but unreferenced overlapped variables are not allocated by default. Such variables do not belong to a specific function, therefore they cannot be allocated overlapped with other variables. This option only changes the behavior of variables in the special _OVERLAP segment. This segment is used only to allocate parameters and local variables for processors which do not have a stack. Not allocating an unreferenced overlap variable is similar to not allocating a variable on the stack for other processors. If you use this stack analogy, then allocating such variables this way corresponds to allocating unreferenced stack variables in global memory. This option allows allocation of all defined objects. Using this option is not recommended. |
| Enable automatic const placement (-ConstDist) | With this option the linker constant optimizer is enabled. Instead of performing usual linking actions, the linker generates a data distribution file which contains optimized distribution for constant objects. |
| Specify constant distribution segment name (-ConstDistSeg) | When this option is enabled, it's possible to specify the name of the constant distribution segment. |
| Allocate non specified const segments in RAM (-CRam) | This option allocates constant data segments not explicitly allocated in a READ_ONLY segment in the default READ_WRITE segment. This was the default for old versions of the linker, so this option provides a compatible behavior with old linker versions. |
| Enable automatic data placement (-DataDist) | With this option the linker data optimizer is enabled. Instead of performing usual linking actions, the linker generates a data distribution file which contains optimized distribution. |
| Specify data distribution file name (-DataDistFile) | When this option is enabled, it's possible to specify the name of the data distribution file. There, all distributed data and how the compiler has to reallocate them are listed. |
| Generate data optimizer information file (-DataDistInfo) | When this option is enabled, the data optimizer generates a data distribution information file giving information on object to segment mapping |
| Specify data distribution segment name (-DataDistSeg) | When this option is enabled, it's possible to specify the name of the data distribution segment. |
| Enable distribution optimization (-Dist) | This option enables the linker optimizer. Instead of a link, the linker generates a distribution file which contains an optimized distribution. |
| Specify distribution file name (-DistFile) | Enable this option to specify the name of the distribution file. The distribution file lists all distributed functions and specifies how the compiler reallocates them. |
| Generate optimizer information file (-DistInfo) | Using this option, the optimizer generates a distribution information file containing a list of all sections and their functions. Available function information includes the old size, optimized size, and new calling convention. |
| Choose optimizing method (-DistOpti) | Enable this option to choose the optimizing method. With the FillBanks argument the linker minimizes the free space in every bank. FillBanks is most effective for functions using the near calling convention. Use the CodeSize argument to minimize code when free space within the banks is no concern. |
| Specify distribution segment name (-DistSeg) | Use this option to specify the name of the distribution segment. |
| Specify library file name (-LibFile) | When this option is enabled,linker generates file<filename> which has information about the current libraries and also about the files with which they should be replaced with. |
| Enable library option file generation (_LibOptions) | Enables library information generation. When this option is enabled,linker generates file (default libFile.txt) which has information about the current library and the startup file and also about the files with which they should be replaced with. |
| Specify data optimizer options file name (-OptioneFile) | Specifies the name of the file that contains the set of linker-generated compiler options. When this option is enabled, linker places the second step compiler options in the specified file<filename>. |
| Enable option file generation (-Options) | Enables compiler option generation. The generated options will be used for second step compilation. Linker generates a text file containing a compiler option for the second step (one of the following: -ConstQualiNear, -NonConstQualiNear, -Mb). The content of the file is appended to the compiler options for the second compilation step. |
| Specify library file name (-P2LibFileName) | Specifies the name of the library information file. When this option is enabled in second link step,linker reads file<filename> which has information about the libraries. |
| Enable option to read libFile.txt in P2 (-ReadLibFile) | Instructs the linker to read in the library information file that it generated in step one. This option is passed in second link step. It tells the linker to read library information file(default libFile.txt). |
| Emit StartUp information to library info file (-StartUpInfo) | The information about the current startup file and the replacement startup file will be added to the library file(default libFile.txt) and used during the second compile-link step. |
| Overlap constants in ROM (-COCC) | Defines the default if constants and code should be optimized; commands DO_OVERLAP_CONSTS and DO_NOT_OVERLAP_CONSTS take precedence over the option. |
| Optimize copy down (-OCopy) | Changes the copy down structure to use few spaces. The optimization does assume that the application does perform both the zero out and the copy down step of the global initialization. If a value is set to zero by the zero out, then zero values are removed from the copy down information. The resulting initialization is not changed by this optimization if the default startup code is used. |