summaryrefslogtreecommitdiffstats
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-17 11:05:02 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-17 11:05:02 +0000
commit265e399393d6324a2c290b8f3bfa1f31a8e18c27 (patch)
tree76403d497787c5ca56106a525380922fc62f0259 /ldso
parent92d3d2b03011c9344e412cfb620cba0c93f03366 (diff)
downloaduClibc-alpine-265e399393d6324a2c290b8f3bfa1f31a8e18c27.tar.bz2
uClibc-alpine-265e399393d6324a2c290b8f3bfa1f31a8e18c27.tar.xz
A few more little fixups
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/ld_string.h31
-rw-r--r--ldso/ldso/ldso.c10
2 files changed, 18 insertions, 23 deletions
diff --git a/ldso/ldso/ld_string.h b/ldso/ldso/ld_string.h
index 822d6f313..b94b1c5f9 100644
--- a/ldso/ldso/ld_string.h
+++ b/ldso/ldso/ld_string.h
@@ -224,30 +224,17 @@ static inline char *_dl_simple_ltoahex(char * local, unsigned long i)
#if defined mc68000 || defined __arm__
/* On some arches constant strings are referenced through the GOT. */
/* XXX Requires load_addr to be defined. */
-#define SEND_STDERR(X) \
-{ \
- const char *ptr, *str; \
- ptr = str = (char *)(X); \
- if(str < (const char *)load_addr) { \
- str += load_addr; \
- ptr += load_addr; \
- } \
- while (*ptr) \
- ptr++; \
- _dl_write(2, str, ptr - str); \
-}
+#define SEND_STDERR(X) \
+ { const char *__s = (X); \
+ if (__s < (const char *) load_addr) __s += load_addr; \
+ _dl_write (2, __s, _dl_strlen (__s)); \
+ }
#else
-#define SEND_STDERR(str) \
-{ \
- register char *ptr = (char *) str; \
- while (*ptr) \
- ptr++; \
- _dl_write(2, str, ptr - str); \
-}
+#define SEND_STDERR(X) _dl_write(2, X, _dl_strlen(X));
#endif
#define SEND_ADDRESS_STDERR(X, add_a_newline) { \
- char tmp[22], *tmp1; \
+ char tmp[13], *tmp1; \
_dl_memset(tmp, 0, sizeof(tmp)); \
tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
_dl_write(2, tmp1, _dl_strlen(tmp1)); \
@@ -258,9 +245,9 @@ static inline char *_dl_simple_ltoahex(char * local, unsigned long i)
};
#define SEND_NUMBER_STDERR(X, add_a_newline) { \
- char tmp[22], *tmp1; \
+ char tmp[13], *tmp1; \
_dl_memset(tmp, 0, sizeof(tmp)); \
- tmp1=_dl_simple_ltoa( tmp, (unsigned long)(X)); \
+ tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
_dl_write(2, tmp1, _dl_strlen(tmp1)); \
if (add_a_newline) { \
tmp[0]='\n'; \
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 07d4a85c3..b330fa6d6 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -447,9 +447,12 @@ DL_BOOT(unsigned long args)
}
#endif
+
/* OK, now do the relocations. We do not do a lazy binding here, so
that once we are done, we have considerably more flexibility. */
-
+#ifdef DL_DEBUG
+ SEND_STDERR("About to do library loader relocations.\n");
+#endif
goof = 0;
for (indx = 0; indx < 2; indx++) {
int i;
@@ -505,6 +508,11 @@ DL_BOOT(unsigned long args)
SEND_STDERR(" undefined.\n");
goof++;
}
+#ifdef DL_DEBUG
+ SEND_STDERR("About to fixup symbol: ");
+ SEND_STDERR(strtab + symtab[symtab_index].st_name);
+ SEND_STDERR("\n");
+#endif
}
/*
* Use this machine-specific macro to perform the actual relocation.