John Reiser jreiser@BitWagon.com writes:
Some environments strictly enforce the semantics of mmap(), namely a successful return value need not equal the requested address unless MAP_FIXED, even if the requested address is unmapped and otherwise available. Unless MAP_FIXED, then it is legal to return any page range that is large enough. Callers of the patched code were relying on getting actual fixed addresses in the interval [0, 0x110000). In particular, this did not work under valgrind.
You can't use MAP_FIXED on an address that you are not sure is available. If it wasn't reserved first, the best we can do is request the address, and refuse to support DOS apps if we don't get it. If you want to make this work in all cases you have to fix valgrind to allow the preloader to do its job.