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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: Problem with ldconfig


>>>>> Ulrich Drepper writes:

 > Andreas Jaeger <aj@suse.de> writes:
>> What do you think?  Shall I go ahead and make a complete patch?  Or do
>> you prefer another solution.  
>> 
>> Btw. these changes will imply an increment of the ldconfig version number.

 > I don't consider the change as a problem as long as the libc5
 > compatibility is maintained.
I don't touch the libc5 part at all.

Here's a patch that also changes cache_file_new.  64 bit experts,
please check that all alignments are proper in the two structs - or do
you like to see changes?

Thorsten, please tell me whether this fixes the problems you noticed
on sparc.

Andreas

2000-09-19  Andreas Jaeger  <aj@suse.de>

	* sysdeps/generic/dl-cache.h: Include stdint.h.
	(struct file_entry_new): Use fixed sizes for interoperability
	between 32bit and 64bit systems, add __unused to make alignment
	explicit.
	(CACHE_VERSION): Increment.
	(struct cache_file_new): Use fixed sizes, add one more unused
	entry to make alignment explicit.

============================================================
Index: sysdeps/generic/dl-cache.h
--- sysdeps/generic/dl-cache.h	2000/07/12 21:09:31	1.4
+++ sysdeps/generic/dl-cache.h	2000/09/19 07:41:01
@@ -17,6 +17,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <stdint.h>
+
 #ifndef _DL_CACHE_DEFAULT_ID
 # define _DL_CACHE_DEFAULT_ID	3
 #endif
@@ -66,25 +68,27 @@
 };
 
 #define CACHEMAGIC_NEW "glibc-ld.so.cache"
-#define CACHE_VERSION "1.0"
+#define CACHE_VERSION "1.1"
 
 
 struct file_entry_new
 {
-  int flags;			/* This is 1 for an ELF library.  */
-  unsigned int key, value;	/* String table indices.  */
-  unsigned long hwcap;		/* Hwcap entry.  */
+  int32_t flags;		/* This is 1 for an ELF library.  */
+  uint32_t key, value;		/* String table indices.  */
+  uint32_t __unused;		/* Align next field always on 8 byte boundary.	*/
+  uint64_t hwcap;		/* Hwcap entry.	 */
 };
 
 struct cache_file_new
 {
   char magic[sizeof CACHEMAGIC_NEW - 1];
   char version[sizeof CACHE_VERSION - 1];
-  unsigned int nlibs;		/* Number of entries.  */
-  unsigned int len_strings;	/* Size of string table. */
-  unsigned int unused[4];	/* Leave space for future extensions.  */
+  uint32_t nlibs;		/* Number of entries.  */
+  uint32_t len_strings;		/* Size of string table. */
+  uint32_t unused[5];		/* Leave space for future extensions
+				   and align to 8 byte boundary.  */
   struct file_entry_new libs[0]; /* Entries describing libraries.  */
-  /* After this the string table of size len_strings is found.  */
+  /* After this the string table of size len_strings is found.	*/
 };
 
 /* Used to align cache_file_new.  */

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

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