PCH relocation ?
Mark Mitchell
mark@codesourcery.com
Tue Jan 18 20:06:00 GMT 2005
Richard Guenther wrote:
> On Tue, 18 Jan 2005 11:39:16 -0800, Mark Mitchell <mark@codesourcery.com> 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.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304
More information about the Gcc
mailing list