summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-02-17 07:02:08 +0000
committerEric Andersen <andersen@codepoet.org>2004-02-17 07:02:08 +0000
commit44cbdd1f703631f0723fc14fc5e5a0d2d93b3709 (patch)
treee03b6a129ada3dd422793e073c56e4e623ad9edc
parenta7268bc492a1c8e3009dbae24511c2bd4cb9c27a (diff)
When doing _dl_mmap to obtain a bit of anonymous memory, use a much more
sensible -1 fd, rather than pretending to work off of fd 0, which makes absolutely no sense.
-rw-r--r--ldso/ldso/dl-elf.c6
-rw-r--r--ldso/ldso/dl-startup.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index e14a23ddc..8a3fa6d20 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -444,7 +444,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
}
header = _dl_mmap((void *) 0, PAGE_SIZE, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (_dl_mmap_check_error(header)) {
_dl_dprintf(2, "%s: can't map '%s'\n", _dl_progname, libname);
_dl_internal_error_number = LD_ERROR_MMAP_FAILED;
@@ -803,7 +803,7 @@ void _dl_dprintf(int fd, const char *fmt, ...)
static char *buf;
buf = _dl_mmap((void *) 0, PAGE_SIZE, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (_dl_mmap_check_error(buf)) {
_dl_write(fd, "mmap of a spare page failed!\n", 29);
_dl_exit(20);
@@ -906,7 +906,7 @@ void *_dl_malloc(int size)
_dl_dprintf(2, "malloc: mmapping more memory\n");
#endif
_dl_mmap_zero = _dl_malloc_addr = _dl_mmap((void *) 0, size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (_dl_mmap_check_error(_dl_mmap_zero)) {
_dl_dprintf(2, "%s: mmap of a spare page failed!\n", _dl_progname);
_dl_exit(20);
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index 3a0c31419..63c0c7f2d 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -293,7 +293,7 @@ found_got:
/* Call mmap to get a page of writable memory that can be used
* for _dl_malloc throughout the shared lib loader. */
mmap_zero = malloc_buffer = _dl_mmap((void *) 0, PAGE_SIZE,
- PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (_dl_mmap_check_error(mmap_zero)) {
SEND_STDERR("dl_boot: mmap of a spare page failed!\n");
_dl_exit(13);