summaryrefslogtreecommitdiff
path: root/ldso/ldso/ld_string.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-03 06:34:13 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-03 06:34:13 +0000
commit12624faa157f2a85ff86407cdba118e29a4e94c4 (patch)
tree3e9c8107eb233a7c0bee33651df6da6a31beafa9 /ldso/ldso/ld_string.h
parentb35cf07aac65df84bf9b0006798080e6a264323f (diff)
Some more minor updates. Add in some debug stuff, and
a way to print out addresses _early_ on in the process.
Diffstat (limited to 'ldso/ldso/ld_string.h')
-rw-r--r--ldso/ldso/ld_string.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/ldso/ldso/ld_string.h b/ldso/ldso/ld_string.h
index 98f2dab81..5d18bb788 100644
--- a/ldso/ldso/ld_string.h
+++ b/ldso/ldso/ld_string.h
@@ -111,7 +111,7 @@ extern inline void * _dl_memset(void * str,int c,size_t len)
/* Early on, we can't call printf, so use this to print out
* numbers using the SEND_STDERR() macro */
-static inline char *_dl_simple_itol(unsigned long i)
+static inline char *_dl_simple_ltoa(unsigned long i)
{
/* 21 digits plus null terminator, good for 64-bit or smaller ints */
static char local[22];
@@ -124,5 +124,24 @@ static inline char *_dl_simple_itol(unsigned long i)
return p + 1;
}
+static inline char *_dl_simple_ltoahex(unsigned long i)
+{
+ /* 21 digits plus null terminator, good for 64-bit or smaller ints */
+ static char local[22];
+ char *p = &local[21];
+ *p-- = '\0';
+ do {
+ char temp = i % 0x10;
+ if (temp <= 0x09)
+ *p-- = '0' + temp;
+ else
+ *p-- = 'a' - 0x0a + temp;
+ i /= 0x10;
+ } while (i > 0);
+ *p-- = 'x';
+ *p-- = '0';
+ return p + 1;
+}
+
#endif