This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: questions about overlay support in GNU ld


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]