[uClibc-cvs] uClibc/ldso/ldso dl-elf.c, 1.66, 1.67 dl-startup.c, 1.6, 1.7

Erik Andersen andersen at uclibc.org
Tue Feb 17 07:02:10 UTC 2004


Update of /var/cvs/uClibc/ldso/ldso
In directory nail:/tmp/cvs-serv20492

Modified Files:
	dl-elf.c dl-startup.c 
Log Message:
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.


Index: dl-elf.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/dl-elf.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- dl-elf.c	14 Feb 2004 11:30:31 -0000	1.66
+++ dl-elf.c	17 Feb 2004 07:02:08 -0000	1.67
@@ -444,7 +444,7 @@
 	}
 
 	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 @@
 	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 @@
 		_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);

Index: dl-startup.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/dl-startup.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dl-startup.c	14 Feb 2004 11:30:31 -0000	1.6
+++ dl-startup.c	17 Feb 2004 07:02:08 -0000	1.7
@@ -293,7 +293,7 @@
 	/* 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);




More information about the uClibc-cvs mailing list