You have run into a limitation using 16-bit JMP offsets in your shared
library. I wrote an article on shared libraries that covers this topic.
Here's an exerpt, for the full text please see
http://www.wwg.com/newsview/shared.shtml
Good luck,
-Jeff Ishaq
The Windward Group
---
A limitation that is more likely to be problematic is an inherent problem in
addressing the code resource that comprises your shared library. While one
limitation is the maximum code resource size (64k), the real problem is with
the 16-bit JMPs in the dispatch table. If you have a large shared library
whose dispatch table contains a JMP to a function that is further than 32
kilobytes away from the start of the dispatch table, you will get a
link-time 16-bit addressing error. This is because the offset that is
stored in the dispatch table is a signed word, whose range is from -32k to
+32k. If you make the linker try to put an offset that is larger than 32k
in your dispatch table, it will gripe. Depending on where the linker
positions the actual dispatch table, you might get lucky and get away with
having a shared library that is larger than 32k without any link-time
errors.
---
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 23, 1999 1:43 PM
> To: [EMAIL PROTECTED]
> Subject: link error: illegal single-segment 32-bit reference to a
> function in a shared library
>
>
>
>
> I searched the CodeWarrior FAQ, and couldn't find an answer
> to my problem. Maybe
> this
> has been discussed in palm forum, but the egroup archive
> search doesn't function
> correctly
> (I couldn't retrive the next page of search results). Anyway,
> I created an
> array of function
> pointers in my palm SHARED LIBRARY (the code model is set to small):
>
> PFCN FuncArray[5] = { f1, f2, f3, f4, f5 }
>
> Compiled OK, but when I got the linker error:
> illegal single-segment 32-bit reference to function f1
> (same for all the funciton references)
>
> How can I fix the problem? Note that this is when I build
> shared library, and
> if I do not build as a
> shared library (with code model=smart), then I do not get the error.
> ------------------
> Jyh-Herng Chow, DBTI, D140, IBM Santa Teresa Lab
> Phone: 408-463-2601. T/L: 543-2601. Fax:
> 408-463-3362.
> Internet: [EMAIL PROTECTED] http://xyzzy.stl.ibm.com/chowjh/
>
>
>