John Marshall wrote:
>
> revcom <[EMAIL PROTECTED]> wrote:
> > Has something changed to make Fred's '32K limit workaround' no longer
> > applicable?
>
> Actually something changed to make Fred's technique even easier! If the
> app's entry point (e.g., the start() function) is not at the beginning of
> the code #1 resource, build-prc v2.0 will insert a jump to the right place.
> This means you can just put start() (i.e., crt0.o) in the middle of your
> link line and execution will jump to the right place without you having
> to worry about creating your own myStart() function.
>
> Alas, as you've discovered, there's a bug (now fixed) that made it jump
> to the wrong address most of the time. :-( Thanks for uncovering it.
>
> You can work around this by putting your own myStart() function at the
> beginning as before and explicitly setting it to be the entry point by
> adding `-e myStart' to your link command.
>
> John
I tried the above and ran into a big problem. I'm programming in C++ and
found out that the intialization code that sets up the global data uses
the address of the start() function as the base address to add to the
relative addresses stored in the .data section to create the pointers in
my virtual tables. When you move the start() function, the relocation
code is using the wrong base address for the code section. Anyway I got
to thinking that the problem is that the linker first adds the start()
function then my object code and finally libcrt.a with the functions
needed by start(). What is really needed is to get the linker to process
libcrt.a before it processes my object code, so that is what I did. Here
is a sample of the line you need for the link phase of the code.
gcc $(CFLAGS) -nodefaultlibs -lcrt mycode1.o mycode2.o ... -lgcc -lg
-o myapp
This will allow the programmer to arrange the libraries as well as the
objects files so there a no function calls greater than 32k and doesn't
cause problems with pointers in the global data.
Brian Smith
Brain Kiosk Software
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html