This is the mail archive of the mailing list for the GCC 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: precompiled header support

On 11 May 2004, Ian Lance Taylor wrote:

> Gunther Nikl <> writes:
> >   What is "fixed for a particular instance of cc1"? That the address is
> >   always the same for a specific cc1 but might be different with another
> >   cc1? However, that doesn't really matter in this case.
> Yes, that is what I mean: the address is always the same for a
> specific cc1.
> >   Both approaches don't work with "my" host since the OS always loads
> >   executables to random addresses. This is by design to not require a MMU.
> >   An executable might have an relocation table if necessary to allow the
> >   loader to adapt the program for the real address in memory.
> That's a tough one.  Are the addresses truly random across the whole
> memory space?  Is there any area of memory which you can reasonably
> expect will not contain any code?  If not, then I don't think PCH will
> work for you.  Tell Geoff Keating--he has argued that every system has
> some address available.

For AmigaOS, the addresses are random in the RAm area space.

Imagine an OS that doesn't use an MMU. Basically, all the processes wind
up sharing the single physical address space. Therefore, when a program
needs to be loaded, the OS finds a free chunk of physical RAM and loads it
there, then updates the relocations so the program will run correctly at
that address.

The free chunk of physical RAM is dependent on what other programs are
currently running at the moment, and the state of the global heap.
So therefore, the load address is random within the physical RAM space.

Geoff's assertion does not apply to the AmigaOS case.

I believe ucLinux (MMUless Linux) also does the same thing, so PCH
probably will not work there either.


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