This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] MIPS/Linux: ld.so.cache unusable for (n)64/n32


Hello,

 It has been the case with glibc 2.4 and it appears to me that it still 
is.  When built for the (n)64 or presumably the n32 ABI, ld.so is unable 
to use the cache as it checks for the wrong o32 ID.  Here is a fix.  
Tested for (n)64.

2007-07-23  Maciej W. Rozycki  <macro@linux-mips.org>

	* sysdeps/unix/sysv/linux/mips/dl-cache.h (_DL_CACHE_DEFAULT_ID):
	New macros for the (n)64 and n32 ABIs.
	(_dl_cache_check_flags): Define if _DL_CACHE_DEFAULT_ID has been.

 Please apply.

  Maciej

glibc-2.4-mips-dl-cache-id.patch
diff -up --recursive --new-file glibc-2.4.macro/ports/sysdeps/unix/sysv/linux/mips/dl-cache.h glibc-2.4/ports/sysdeps/unix/sysv/linux/mips/dl-cache.h
--- glibc-2.4.macro/ports/sysdeps/unix/sysv/linux/mips/dl-cache.h	2003-06-25 08:03:24.000000000 +0000
+++ glibc-2.4/ports/sysdeps/unix/sysv/linux/mips/dl-cache.h	2007-07-21 23:13:16.000000000 +0000
@@ -1,5 +1,5 @@
 /* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,6 +17,20 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <ldconfig.h>
+
+/* Redefine the cache ID for new ABIs; o32 keeps using the generic check.  */
+#if _MIPS_SIM == _ABI64
+# define _DL_CACHE_DEFAULT_ID	(FLAG_MIPS64_LIBN64 | FLAG_ELF_LIBC6)
+#elif _MIPS_SIM == _ABIN32
+# define _DL_CACHE_DEFAULT_ID	(FLAG_MIPS64_LIBN32 | FLAG_ELF_LIBC6)
+#endif
+
+#ifdef _DL_CACHE_DEFAULT_ID
+# define _dl_cache_check_flags(flags) \
+  ((flags) == _DL_CACHE_DEFAULT_ID)
+#endif
+
 #define add_system_dir(dir) \
   do								\
     {								\


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]