Peal: Palm ELF ARM Loader

Peal is an ELF postlinker and loader for Palm OS. It allows ARM code to use global variables and function pointers without restriction.

Download

Peal version 2005-4-14
tar.gz archive (39 KB)
zip archive (68 KB)

New since version 2004-12-29:

See the release history for older versions and change logs.

Peal is distributed under a BSD-style license. See the README for complete license information.

Features

Features supported by Peal and Peal-loaded ARM code:

Limitations

Usage

See the README for more details. The download package includes a complete example program.

  1. Build the peal-postlink program in the postlink/ directory:
    cd postlink; make

  2. Write ARM code that uses global data or function pointers. ARM functions intended to be called by m68k code may take a single parameter. ARM functions that need to call back into m68k code should use the variables gEmulStateP and gCall68KFuncP from arm/pealstub.h.
    unsigned long MyArmFunction(void *arg) { ... }

  3. Write m68k code that uses the API in m68k/peal.h to load ARM code and call ARM functions:
    PealModule m = PealLoadFromResources('armc', 1000);
    void *address = PealLookupSymbol(m, "MyArmFunction");
    unsigned long result = PealCall(m, address, myArg);
    PealUnload(m);


  4. Compile m68k/peal.c along with other m68k code.

  5. Add -fPIC when compiling to compile all ARM code as position-independent:
    arm-palmos-gcc -fPIC ...
    Compile arm/pealstub.c along with other ARM code.

  6. Add --emit-relocs when linking ARM code to preserve relocation information:
    arm-palmos-ld --emit-relocs ...
    or arm-palmos-gcc -Wl,--emit-relocs ...

  7. Run the Peal postlinker to generate ARM code resources:
    peal-postlink -s 1000 -t armc -o postlinked-rsrcs.ro linked-binary.bin

  8. Add the resources generated by peal-postlink to your Palm program as usual.

Alternatives

If you don't like Peal, there are several other tools that help provide a more full-featured ARM environment on Palm OS:


seal! Greg Parker
gparker-peal2@sealiesoftware.com
Sealie Software