Re: [BUG] get_unmapped_area() change -> non booting machine

From: Jamie Lokier
Date: Tue Feb 10 2004 - 12:47:26 EST


Linus Torvalds wrote:
> What I find strange is that bash passed in something else than NULL as the
> argument in the first place. Doing a quick trace of my bash executable
> shows non-NULL hints only for MAP_FIXED mmap's. So what triggered this?

Run the "prelink" program on your system.

It's not bash which is using non-NULL hints, it's ld.so. Prelinked
libraries have relocations already resolved on the assumption that
they are mapped at a known address. (Prelink chooses a different
address for each library). ld.so calls mmap() with that address.

If the library cannot be mapped at the requested address, then ld.so
has to do dynamic linking as usual, dirtying some pages and looking up
symbols.

The real question is - why does malloc() break? I'd expect malloc()
to use MAP_ANON these days, when brk() fails. But it seems not.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/