Contents Index Building multi-segment applications Explicitly assigning segments pdf/preface.pdf

UltraLite User's Guide
  Developing Applications for the Palm Computing Platform
    Building multi-segment applications

Enabling multi-segment code generation


This section describes how to instruct the UltraLite Analyzer to generate multi-segment code using its default scheme. If you wish to customize the assignment of code to segments by explicitly assigning functions to segments, you can do so. For more information, see Explicitly assigning segments.

You enable generated code segments by defining macros. Macro definition is different for the CodeWarrior and PRC Tools development tools, so the procedure for enabling multi-segment code generation also differs.

To enable multi-segment code generation (CodeWarrior)

To enable multi-segment code generation (PRC Tools)

  1. Instruct the gnu compiler to compile segmented code.

    Define the following two macros on the compiler command line:

  2. Construct a segment definition file for the GNU link tools multilink and build-prc.

    Run the dbulseg command-line utility against each source file, and supply a name for the definition file. For example, the following command line:

    dbulseg gensource.c project.def AppName CreatorID

    creates a project.def definition file with the following content:

    application{ "AppName" CreatorID }
    multiple code{ ULRT1 ... ULRT17 ULG512 ULG513 ... }

    where the ULG segment names are obtained from the generated source file gensource.c.

    For more information on the UltraLite segment utility, see The UltraLite segment utility.

Notes 

When multi-segment code generation is enabled, the default behavior of the UltraLite Analyzer is as follows:

PRC Tools compiler issues 

When a function defined at the bottom of a source file makes an inter-segment call to a function defined at the top of the same source file, and there is more than 32 kb of code in between, the PRC Tools compiler may generate jsr instructions unacceptable to the assembler. Normally, the offset of the jsr instruction is replaced during the relocation stage of the linker, but in this case, the error prevents the compilation from going any further. To avoid this issue, instruct the assembler to ignore any signed overflow errors by using the -Wa,-J compiler switches.


Contents Index Building multi-segment applications Explicitly assigning segments pdf/preface.pdf