This is the mail archive of the
mailing list for the GCC project.
Re: PCH relocation ?
Richard Guenther wrote:
On Tue, 18 Jan 2005 11:39:16 -0800, Mark Mitchell <firstname.lastname@example.org> wrote:
Marc Espie wrote:
PCH file, of offsets of pointers in the PCH file. Then the relocation
would be as easy as running along the list and adding the difference between
the actual load address and the original expected load address.
Now, that's a very good idea. Beats reverse-engineering the file.
I've seen a design in which the PCH gets mapped back in, and then the
same machinery that was used to map it out walks over it, adding the
appropriate offset to all pointers it finds. That's nice in that no
on-the-side list is required.
And to get the benefit of not paging in all the PCH at start you do this
per page using appropriate page protection and signal handlers? Maybe
it's worth it - if even possible with the "machinery".
The implementation I worked with was not that clever, but, yes, you
might be able to make that work.