Context: I have a SysLib library, registered with SysLibLoad,
whose name is "dummy name", say.
If I try to find the library by name, using SysLibFind,
the call fails or works depending how my jumptable looks like.
If it looks like this:
| 1: .asciiz "dummy name"
| .even
| jumptable:
| dc.w 1b - jumptable
| dc.w DummyOpen - jumptable
| dc.w DummyClose - jumptable
| dc.w DummySleep - jumptable
| dc.w DymmyWake - jumptable
| dc.w DummyFunA - jumptable
| ...
SysLibName always fails. However If it works when
I arrange the table to looks like this:
| .even
| jumptable:
| dc.w 1f - jumptable
| dc.w DummyOpen - jumptable
| dc.w DummyClose - jumptable
| dc.w DummySleep - jumptable
| dc.w DymmyWake - jumptable
| dc.w DummyFunA - jumptable
| ...
| 1: .asciiz "dummy name"
The difference is that the first entry of the table (i.e., offset to
the name) is negative in the former table while it is positive in the
latter. I beleive SysLibFind assumes this offset is an unsigned
value, and this sounds like a bug to me because all the other
entries are interpreted as signed by the trap dispatch code
(i.e., one can define functions before or after the jumptable).
Now I'm not really worried by this, but I just meant to point
this out. (this is with PalmOS 3.5, maybe it has changed with 4.0?)
--
Alexandre Duret-Lutz
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/