No subject


Wed Feb 14 08:32:59 UTC 2007


Modified:
   trunk/uClibc/ldso/include/dl-defs.h
   trunk/uClibc/ldso/ldso/ldso.c
   trunk/uClibc/ldso/ldso/mips/dl-sysdep.h


Changeset:
Modified: trunk/uClibc/ldso/include/dl-defs.h
===================================================================
--- trunk/uClibc/ldso/include/dl-defs.h	2007-02-17 15:52:02 UTC (rev 17917)
+++ trunk/uClibc/ldso/include/dl-defs.h	2007-02-17 17:55:45 UTC (rev 17918)
@@ -164,4 +164,9 @@
   ((*SIGNATURE DL_ADDR_TO_FUNC_PTR ((ADDR), (LOADADDR)))(__VA_ARGS__))
 #endif
 
+/* An alignment value for a memory block returned by _dl_malloc. */
+#ifndef DL_MALLOC_ALIGN
+# define DL_MALLOC_ALIGN (__WORDSIZE / 8)
+#endif
+
 #endif	/* _LD_DEFS_H */

Modified: trunk/uClibc/ldso/ldso/ldso.c
===================================================================
--- trunk/uClibc/ldso/ldso/ldso.c	2007-02-17 15:52:02 UTC (rev 17917)
+++ trunk/uClibc/ldso/ldso/ldso.c	2007-02-17 17:55:45 UTC (rev 17918)
@@ -950,10 +950,11 @@
 	_dl_malloc_addr += size;
 
 	/*
-	 * Align memory to 4 byte boundary.  Some platforms require this,
-	 * others simply get better performance.
+	 * Align memory to DL_MALLOC_ALIGN byte boundary.  Some
+	 * platforms require this, others simply get better
+	 * performance.
 	 */
-	_dl_malloc_addr = (unsigned char *) (((unsigned long) _dl_malloc_addr + 3) & ~(3));
+	_dl_malloc_addr = (unsigned char *) (((unsigned long) _dl_malloc_addr + DL_MALLOC_ALIGN - 1) & ~(DL_MALLOC_ALIGN - 1));
 	return retval;
 }
 

Modified: trunk/uClibc/ldso/ldso/mips/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/mips/dl-sysdep.h	2007-02-17 15:52:02 UTC (rev 17917)
+++ trunk/uClibc/ldso/ldso/mips/dl-sysdep.h	2007-02-17 17:55:45 UTC (rev 17918)
@@ -214,3 +214,7 @@
 {
 	/* No RELATIVE relocs in MIPS? */
 }
+
+#ifdef __mips64
+#define DL_MALLOC_ALIGN 8	/* N64/N32 needs 8 byte alignment */
+#endif



More information about the uClibc-cvs mailing list