At 12:54 PM +0200 2000/01/12, Margus Freudenthal wrote:
>Is there a way to create GCC shared libraries that are bigger than 64
>KB? I have bunch of code that makes up static library with size of
>about 100 KB. When I try to compile it into shared library, i get error
>"region coderes is full", which I think implies that my library doesn't
>fit into single segment. As I see it, I can separate my code to two or
>three libraries, but then I'd have multiple libraries referencing each
>other and it would be more trouble to install and uninstall these files.
>
>Any suggestions?
You'll have to do a lot of work yourself. Palm OS shared libraries may contain up to
64k of code, in a single segment. Beyond that, you'll have to implement the
multi-segment loading, dispatching, and globals management explicitly.
For example, upon first open of the library, you would open the shared library's
database, load and lock each additional code segment, build a jump table into each
public function of those additional segments, store that table in the library's
dispatch globals (or modify the library's jump table directly with this information --
whichever you prefer). Lastly, you would unlock and unload each of those segments upon
final close of the library. This is basically the functionality you get for free when
building a multi-segment application, though the implementation is somewhat different
because applications have A5 globals and implicitly reference the database in which
they reside, thus allowing the multi-segment loading "glue" code to act more
dynamically, with a little help from the linker.
The only other option I can see is to build individual shared libraries, each 64k or
less in size. However this shifts the complexity towards the user by forcing them to
install and manage more components. And that's not very Palm Zen.
Regards,
Jim Schram
3Com/Palm Computing
Partner Engineering