[comp.sys.mac.programmer] Jump Table Offset error..

gb2a+@andrew.cmu.edu (George J. Baxter) (03/30/91)

    I have a nagging problem that is occuring with MPW.. I'm linking in
some external procedures to a larger program, and one group of
procudures keeps resulting in and error:

 ### Link: Error: Jump Table Offset is out of range. (Error 50) HandleMacEvents

There are actually several of these errors.  None of the procedures
named in the error are mine, but belong to the larger program I'm
linking into.  What exactly is this error, what causes it, and how can I
correct it?
        -george

-----------------------
gb2a@andrew.cmu.edu		    baxter@a.cfr.cmu.edu

baxter@imga.cfr.cmu.edu		    q100gb2a@vb.cc.cmu.edu

"Only a Hawaiian can say Humuhumunukunukuapuaa five times fast, correctly."

time@ice.com (Tim Endres) (04/01/91)

In article <1991Apr1.015113.9283@verity.com>, anders@verity.com (Anders Wallgren) writes:
> In article <obwsMSa00WBNI1lkkK@andrew.cmu.edu>, gb2a+@andrew (George J. Baxter) writes:
> >    I have a nagging problem that is occuring with MPW.. I'm linking in
> >some external procedures to a larger program, and one group of
> >procudures keeps resulting in and error:
> > ### Link: Error: Jump Table Offset is out of range. (Error 50) HandleMacEvents
> 
> [ ... fine discussion of jump table removed ... ]
> The answer (unfortunately for you since you didn't write the code) is
> to make sure that the segment that your external procedure is in gets
> split up into smaller segments.

You might also have another alternative. If the complaint is for only
one function, you *may* be able to move it closer to the calling function
and get the offset to within 32K. However, everything else starts
shifting....

-------------------------------------------------------------
Tim Endres                |  time@ice.com
ICE Engineering           |  uupsi!ice.com!time
8840 Main Street          |  Voice            FAX
Whitmore Lake MI. 48189   |  (313) 449 8288   (313) 449 9208

anders@verity.com (Anders Wallgren) (04/01/91)

In article <obwsMSa00WBNI1lkkK@andrew.cmu.edu>, gb2a+@andrew (George J. Baxter) writes:
>
>    I have a nagging problem that is occuring with MPW.. I'm linking in
>some external procedures to a larger program, and one group of
>procudures keeps resulting in and error:
>
> ### Link: Error: Jump Table Offset is out of range. (Error 50) HandleMacEvents
>


The problem is that MPW doesn't allow you to jump to a function in
another segment if that function is more than 32K into the segment.
This limitation arises because the jump table that is constructed to
allow inter-segment jumping uses a 16-bit offset into code segments.
This limitation will be removed when MPW 3.2 is released.

The answer (unfortunately for you since you didn't write the code) is
to make sure that the segment that your external procedure is in gets
split up into smaller segments.


anders