OSDN Git Service

A few more little fixups
authorEric Andersen <andersen@codepoet.org>
Sun, 17 Feb 2002 11:05:02 +0000 (11:05 -0000)
committerEric Andersen <andersen@codepoet.org>
Sun, 17 Feb 2002 11:05:02 +0000 (11:05 -0000)
ldso/ldso/ld_string.h
ldso/ldso/ldso.c

index 822d6f3..b94b1c5 100644 (file)
@@ -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'; \
index 07d4a85..b330fa6 100644 (file)
@@ -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.