[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Stand-alone code resources

Normally build-prc processes a bfd executable as a full-blown executable, converting its .data, .bss, and .text and any other code sections into the corresponding Palm OS resources, as appropriate.

However if the bfd executable contains certain sections that are special to build-prc, its .text section will be converted into a stand-alone code resource instead, and the other sections listed above will be discarded (producing warnings) if present.

These "special sections" are .disposn (which is an abbreviation of disposition) and .trap. They are interpreted as follows:

Note that these two-byte integer fields are interpreted according to the native endianness of the bfd executable in which they occur.

Producing a stand-alone code resource

There is nothing special about compiling code that is to become stand-alone, other than that you must not use global data or any extra code resources, because stand-alone code, by definition, cannot have such things.

There are considerations at link time, related to the lack of startup code:

You can easily set up the special sections marking your code as stand-alone by using the following macros, provided in `Standalone.h':

STANDALONE_CODE_RESOURCE_ID (id)
Mark the executable as a stand-alone code resource with the specified id and a suitable resource type depending on the resulting compiled executable's architecture: `code' for 68000 or `armc' for ARM.

STANDALONE_CODE_RESOURCE_TYPE_ID (type, id)
STANDALONE_CODE_RESOURCE_TYPESTR_ID (type, id)
Mark the executable as a stand-alone code resource with the specified resource type and id. If you specify type with a multicharacter char constant (`'TYPE''), use the ...TYPE... macro; if you use a string (`"TYPE"'), use the ...TYPESTR... version.

HACKMASTER_TRAP (vector)
Mark the executable as a stand-alone code resource, and add a TRAP resource containing vector, which may be any C constant expression, for example, a numeric constant or even a sysTrapfoo constant as defined in a Palm OS SDK's `CoreTraps.h'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Build Daemon user on July, 29 2004 using texi2html