On Tue, 26 Mar 2002, Ben Combee wrote:
> In article <81358@palm-dev-forum>, [EMAIL PROTECTED] says...
> >
> >   dont need an explict compiler for this.. :) you can do this yourself,
> >   as long as you know what your doing. *g* - if you use gcc, its a bit
> >   easier than CW, cause CW puts 8 bytes of crap at the beginning of a
> >   segment (ben, you never answered how to disable that) :P
>
> There are two different things going on.
>
> 1) If you create a code segment target (like for a shared library), the
> start of the segment will be a jump instruction that goes to the real
> entry point.  In the map file, this is called "__DummyStartup__".  So,
> CW code segments should work just fine if you jump to address 0 from the
> start.  This method gives our linker more flexibility in placing the
> real startup code within the resource.
>
> It would be a nice optimization for the linker to just put the entry
> point first in the file, but there are lots of other changes of higher
> priority to our compiler/linker team.
>
> 2) In a multi-segment application, each additional segment starts with a
> structure that points us to its data relocations in the compressed data
> resource.  There is no way to disable this when building a multi-segment
> app.  If you want to see the definition of this header, see "struct
> SegmentHeader" in PalmOS_Startup.cpp in the CW runtime code.

  figured as much :) so:

  // code warrior puts 12 bytes of junk at the beginning of the segment
  #ifdef __GNUC__
    codePtr = (void *)MemHandleLock(memHandle);
  #else
    codePtr = (void *)MemHandleLock(memHandle) + 12;
  #endif

  is here to stay for a while :) *g* but, its ok.. been able to work
  around it for quite some time now :P would be really nice to turn
  it on/off tho :) [but, heck, commercial compiler] :P

// az "open source +1 - could at least hack it :P"
[EMAIL PROTECTED]
http://www.ardiri.com/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to