This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: questions about overlay support in GNU ld
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Tao Zhang <zhangtao at cc dot gatech dot edu>
- Cc: binutils at sources dot redhat dot com
- Date: 28 May 2004 19:32:10 -0400
- Subject: Re: questions about overlay support in GNU ld
- References: <Pine.GSO.4.58.0405281927050.29314@gaia.cc.gatech.edu>
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