questions about overlay support in GNU ld
Ian Lance Taylor
ian@wasabisystems.com
Sat May 29 00:13:00 GMT 2004
Tao Zhang <zhangtao@cc.gatech.edu> writes:
> I am trying to fit potentially very big programs into a very limited local
> storage. So we need to something like overlaying. I know GNU ld supports
> overlaying, but does it support function calls between overlays, by any
> means? We cannot limit our program partitioning too much so we have to
> support calls between overlays. If GNU ld currently doesn't support that,
> could someboy give me some pointers on how to implement it? Like related
> code pieces in GNU ld I should study etc.?
The linker doesn't support function calls between overlays directly.
That would be pretty system dependent. The usual approach is to use
function stubs in the non-overlayed code which are responsible for
loading the correct overlay and calling the appropriate function.
Then of course you have to handle function return correctly. The
linker will help a little bit, with OVERLAY and NOCROSSREFS, but it
won't do the work for you.
Ian
More information about the Binutils
mailing list