Greg,
>We are porting a library that uses globals and statics extensively. We are
>hoping use A5-relative addressing to enable this. Somehow, though, the
>compiler is generating A4-relative addressing. We are using CodeWarrior
>R4, how do we specify A5-relative addressing? Any other gotcha's we should
>know about?
Whenever you build a single-segment (code) resource using MetroWerks, it
automatically switches to A4-relative global addressing.
There is no built-in support for globals in shared libraries. I wrote an
article about how to hack in A4-relative support - I think it was called
"PalmOS Shared-Library Globals" in Handheld Systems.
You could probably get A5-relative globals to work as well, but it would
take even more hacking, and you would probably increase compatibility
problems with some apps that assume A5 is always their A5 (for example
inside of trap patches).
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 650-947-9222 (direct) +1 408-261-7550 (main)