svn commit: trunk/uClibc/ldso: include ldso/arm ldso/cris ldso/frv ldso etc...

vapier at uclibc.org vapier at uclibc.org
Wed Mar 8 03:58:15 UTC 2006


Author: vapier
Date: 2006-03-07 19:58:13 -0800 (Tue, 07 Mar 2006)
New Revision: 14466

Log:
macro out the /10 operation so arches can have their own versions ... and create some default macros for do_rem/do_div_10 so we dont duplicate the samething in many arch header files

Modified:
   trunk/uClibc/ldso/include/dl-string.h
   trunk/uClibc/ldso/ldso/arm/dl-sysdep.h
   trunk/uClibc/ldso/ldso/cris/dl-sysdep.h
   trunk/uClibc/ldso/ldso/frv/dl-sysdep.h
   trunk/uClibc/ldso/ldso/i386/dl-sysdep.h
   trunk/uClibc/ldso/ldso/m68k/dl-sysdep.h
   trunk/uClibc/ldso/ldso/mips/dl-sysdep.h
   trunk/uClibc/ldso/ldso/powerpc/dl-sysdep.h
   trunk/uClibc/ldso/ldso/sh64/dl-sysdep.h
   trunk/uClibc/ldso/ldso/x86_64/dl-sysdep.h


Changeset:
Modified: trunk/uClibc/ldso/include/dl-string.h
===================================================================
--- trunk/uClibc/ldso/include/dl-string.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/include/dl-string.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -11,6 +11,14 @@
 #include <dl-sysdep.h> /* for do_rem */
 #include <features.h>
 
+/* provide some sane defaults */
+#ifndef do_rem
+# define do_rem(result, n, base) ((result) = (n) % (base))
+#endif
+#ifndef do_div_10
+# define do_div_10(result, remain) ((result) /= 10)
+#endif
+
 static size_t _dl_strlen(const char * str);
 static char *_dl_strcat(char *dst, const char *src);
 static char * _dl_strcpy(char * dst,const char *src);
@@ -234,7 +242,7 @@
 		char temp;
 		do_rem(temp, i, 10);
 		*--p = '0' + temp;
-		i /= 10;
+		do_div_10(i, temp);
 	} while (i > 0);
 	return p;
 }
@@ -324,7 +332,7 @@
 	do { \
 		do_rem(v, (X), 10); \
 		*--tmp2 = '0' + v; \
-		(X) /= 10; \
+		do_div_10((X), v); \
 	} while ((X) > 0); \
 	_dl_write(2, tmp2, tmp1 - tmp2 + sizeof(tmp) - 1); \
 }

Modified: trunk/uClibc/ldso/ldso/arm/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/arm/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/arm/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -43,6 +43,7 @@
 	return m;
 }
 #define do_rem(result, n, base) ((result) = arm_modulus(n, base))
+#define do_div_10(result, remain) ((result) = (((result) - (remain)) / 2) * -(-1ul / 5ul))
 
 /* Here we define the magic numbers that this dynamic loader should accept */
 #define MAGIC1 EM_ARM

Modified: trunk/uClibc/ldso/ldso/cris/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/cris/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/cris/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -18,8 +18,6 @@
 struct elf_resolve;
 extern unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry);
 
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
 /* 8192 bytes alignment */
 #define PAGE_ALIGN 0xffffe000
 #define ADDR_ALIGN 0x1fff

Modified: trunk/uClibc/ldso/ldso/frv/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/frv/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/frv/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -65,8 +65,6 @@
 
 extern int _dl_linux_resolve(void) __attribute__((__visibility__("hidden")));
 
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
 /* 16KiB page alignment.  Should perhaps be made dynamic using
    getpagesize(), based on AT_PAGESZ from auxvt?  */
 #define PAGE_ALIGN 0xffffc000

Modified: trunk/uClibc/ldso/ldso/i386/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/i386/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/i386/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -25,8 +25,6 @@
 struct elf_resolve;
 extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
 
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
 /* 4096 bytes alignment */
 #define PAGE_ALIGN 0xfffff000
 #define ADDR_ALIGN 0xfff

Modified: trunk/uClibc/ldso/ldso/m68k/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/m68k/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/m68k/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -25,10 +25,6 @@
 struct elf_resolve;
 extern unsigned int _dl_linux_resolver (struct elf_resolve *, int);
 
-/* Define this because we do not want to call .udiv in the library.
-   Not needed for m68k.  */
-#define do_rem(result, n, base)  ((result) = (n) % (base))
-
 /* 4096 bytes alignment */
 #define PAGE_ALIGN 0xfffff000
 #define ADDR_ALIGN 0xfff

Modified: trunk/uClibc/ldso/ldso/mips/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/mips/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/mips/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -63,8 +63,6 @@
 struct elf_resolve;
 void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy);
 
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
 /* 4096 bytes alignment */
 #define PAGE_ALIGN 0xfffff000
 #define ADDR_ALIGN 0xfff

Modified: trunk/uClibc/ldso/ldso/powerpc/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/powerpc/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/powerpc/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -67,9 +67,6 @@
 extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
 void _dl_init_got(unsigned long *lpnt,struct elf_resolve *tpnt);
 
-
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
 /* 4096 bytes alignment */
 #define PAGE_ALIGN 0xfffff000
 #define ADDR_ALIGN 0xfff

Modified: trunk/uClibc/ldso/ldso/sh64/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/sh64/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/sh64/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -25,8 +25,6 @@
 struct elf_resolve;
 extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
 
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
 /* 4096 bytes alignment */
 #define PAGE_ALIGN 0xfffff000
 #define ADDR_ALIGN 0xfff

Modified: trunk/uClibc/ldso/ldso/x86_64/dl-sysdep.h
===================================================================
--- trunk/uClibc/ldso/ldso/x86_64/dl-sysdep.h	2006-03-08 02:02:39 UTC (rev 14465)
+++ trunk/uClibc/ldso/ldso/x86_64/dl-sysdep.h	2006-03-08 03:58:13 UTC (rev 14466)
@@ -41,8 +41,6 @@
 struct elf_resolve;
 extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
 
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
 /* 4096 bytes alignment */
 #define PAGE_ALIGN 0xfffff000
 #define ADDR_ALIGN 0xfff




More information about the uClibc-cvs mailing list