On Wed, Oct 03, 2001 at 09:56:40AM +0200, G�nter Knauf wrote: > Hi Bill, > can you please explain if every module really needs an entry in BaseAddress.ref? I >tested with many modules without an entry and it seems to work with the linker >defaults... > If it is needed how should it be done then with 3rd party modules?
Yes, it is needed. Without it, the linker will assign the same, fixed address to every module. At runtime, those modules will then need to be relocated to some address. Using BaseAddress.ref, we can effectively do the relocation at link time. Sure, it is possible some other code is present and a relocation is forced, but that will be atypical. Relocation is expensive. Doing it at link time rather than load time is a huge win. 3rd party modules can do whatever they want. Invariably, they will probably get relocated and/or clash with other 3rd party modules. But we *do* have control over Apache itself and can help those. There are further optimizations with assigning addresses that we probably don't do. Specifically, if there are "gaps" in the address space, then you end up wasting space in the processor's mapping tables. As a result, you want to pack the modules as tightly as possible. Of course, that tight-packing is at odds with the optional loading of modules. If we do the packing, then decide not to load something, then we end up with a hole. [ and you can extend that to third party modules if we attempt to act as a registry for them. it goes without saying that people won't have every third party module, so each apache process would have *huge* holes, thus wasting significant processor tables ] Does that answer your questions? :-) Cheers, -g -- Greg Stein, http://www.lyra.org/
