In article <81972@palm-dev-forum>, [EMAIL PROTECTED] says...
>
> > some "internal" multiple segment control? :) the above was taken
> > from a code resource which is 12332 bytes in size (0x302C) :P now,
> > that makes these 12 bytes look like size determinators for some
> > multiple segment stuff :P
>
> Ben could probably answer that...(?)
I already did, and I even pointed to the header file and structure name
in the runtime library that defines how the start of a secondary code
segment from a multisegment application. Anyway, to quote
PalmOS_Startup.cpp:
typedef struct SegmentHeader { /* the structure of a segment header */
short jtsoffset; /* A5 relative offset of this segments jump table */
short jtentries; /* number of entries in this segments jump table */
long jtloffset; /* A5 relative offset of this segments jump table */
long xrefoffset; /* offset of xref data in this CODE resource */
char code[]; /* the code */
};
This data is all used at load time to handle finding the jump table and
relocations for the segment. Having this at the start of the code
segment makes it really easy for the segment loader to find. I don't
know why there are two jump table offset values, but everything else is
used.
We could stick this at the end of the code segment, but it would require
reworking the runtime code and the linker, and I'm really not interested
in introducing possible bugs into a working scheme.
--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/