svn commit: trunk/uClibc: ldso/include ldso/ldso utils

vapier at uclibc.org vapier at uclibc.org
Tue Apr 17 21:54:12 UTC 2007


Author: vapier
Date: 2007-04-17 14:54:11 -0700 (Tue, 17 Apr 2007)
New Revision: 18482

Log:
fix ld.so.cache handling on no-mmu setups

Modified:
   trunk/uClibc/ldso/include/dl-defs.h
   trunk/uClibc/ldso/ldso/dl-elf.c
   trunk/uClibc/utils/ldconfig.c


Changeset:
Modified: trunk/uClibc/ldso/include/dl-defs.h
===================================================================
--- trunk/uClibc/ldso/include/dl-defs.h	2007-04-17 17:30:12 UTC (rev 18481)
+++ trunk/uClibc/ldso/include/dl-defs.h	2007-04-17 21:54:11 UTC (rev 18482)
@@ -62,6 +62,12 @@
 	int sooffset;
 	int liboffset;
 } libentry_t;
+
+#ifdef __ARCH_USE_MMU__
+#define LDSO_CACHE_MMAP_FLAGS (MAP_SHARED)
+#else
+#define LDSO_CACHE_MMAP_FLAGS (MAP_PRIVATE)
+#endif
 #endif	/* __LDSO_CACHE_SUPPORT__ */
 
 #endif

Modified: trunk/uClibc/ldso/ldso/dl-elf.c
===================================================================
--- trunk/uClibc/ldso/ldso/dl-elf.c	2007-04-17 17:30:12 UTC (rev 18481)
+++ trunk/uClibc/ldso/ldso/dl-elf.c	2007-04-17 21:54:11 UTC (rev 18482)
@@ -57,7 +57,7 @@
 	}
 
 	_dl_cache_size = st.st_size;
-	_dl_cache_addr = (caddr_t) _dl_mmap(0, _dl_cache_size, PROT_READ, MAP_SHARED, fd, 0);
+	_dl_cache_addr = _dl_mmap(0, _dl_cache_size, PROT_READ, LDSO_CACHE_MMAP_FLAGS, fd, 0);
 	_dl_close(fd);
 	if (_dl_mmap_check_error(_dl_cache_addr)) {
 		_dl_dprintf(2, "%s:%i: can't map '%s'\n",

Modified: trunk/uClibc/utils/ldconfig.c
===================================================================
--- trunk/uClibc/utils/ldconfig.c	2007-04-17 17:30:12 UTC (rev 18481)
+++ trunk/uClibc/utils/ldconfig.c	2007-04-17 21:54:11 UTC (rev 18482)
@@ -813,7 +813,7 @@
 
     if (stat(realcachefile, &st) || (fd = open(realcachefile, O_RDONLY))<0)
 	err(EXIT_FATAL,"can't read %s (%s)", cachefile, strerror(errno));
-    if ((c = mmap(0,st.st_size, PROT_READ, MAP_SHARED ,fd, 0)) == (caddr_t)-1)
+    if ((c = mmap(0,st.st_size, PROT_READ, LDSO_CACHE_MMAP_FLAGS, fd, 0)) == (caddr_t)-1)
 	err(EXIT_FATAL,"can't map %s (%s)", cachefile, strerror(errno));
     close(fd);
 




More information about the uClibc-cvs mailing list