summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-07-03 18:24:05 +0000
committerEric Andersen <andersen@codepoet.org>2001-07-03 18:24:05 +0000
commitf95be941dec41c803891857a8ad240da5200dcb2 (patch)
tree061d3a87ac2d2877bd61b8b7051bc3180aece028 /ldso
parent58a6cf2c7add64af1c17c161a61f9307ffa3bad6 (diff)
Merge arm support into the mainstream. This change is pretty
minor, just carefully memset 0 strings before using them, and also referencs strings via the GOT for ARM as well. -Erik
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/hash.h21
-rw-r--r--ldso/ldso/ld_hash.h21
2 files changed, 26 insertions, 16 deletions
diff --git a/ldso/ldso/hash.h b/ldso/ldso/hash.h
index c7fee6c97..f38361090 100644
--- a/ldso/ldso/hash.h
+++ b/ldso/ldso/hash.h
@@ -71,8 +71,8 @@ extern char * _dl_find_hash(char * name, struct dyn_elf * rpnt1,
int copyrel);
extern int _dl_linux_dynamic_link(void);
-#ifdef __mc68000__
-/* On m68k constant strings are referenced through the GOT. */
+#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 *__s = (X); \
@@ -84,22 +84,27 @@ extern int _dl_linux_dynamic_link(void);
#endif
#define SEND_ADDRESS_STDERR(X, add_a_newline) { \
- char tmp[13]; \
- _dl_write(2, _dl_simple_ltoahex_inline( tmp, (unsigned long)(X)), 12); \
+ char tmp[13], *tmp1; \
+ _dl_memset_inline(tmp, 0, sizeof(tmp)); \
+ tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
+ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \
if (add_a_newline) { \
tmp[0]='\n'; \
_dl_write(2, tmp, 1); \
} \
-};
+};
#define SEND_NUMBER_STDERR(X, add_a_newline) { \
- char tmp[13]; \
- _dl_write(2, (void *)_dl_simple_ltoahex_inline( tmp, (unsigned long)(X)), 12); \
+ char tmp[13], *tmp1; \
+ _dl_memset_inline(tmp, 0, sizeof(tmp)); \
+ tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
+ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \
if (add_a_newline) { \
tmp[0]='\n'; \
_dl_write(2, tmp, 1); \
} \
-};
+};
+
extern int _dl_fdprintf(int, const char *, ...);
extern char * _dl_library_path;
extern char * _dl_not_lazy;
diff --git a/ldso/ldso/ld_hash.h b/ldso/ldso/ld_hash.h
index c7fee6c97..f38361090 100644
--- a/ldso/ldso/ld_hash.h
+++ b/ldso/ldso/ld_hash.h
@@ -71,8 +71,8 @@ extern char * _dl_find_hash(char * name, struct dyn_elf * rpnt1,
int copyrel);
extern int _dl_linux_dynamic_link(void);
-#ifdef __mc68000__
-/* On m68k constant strings are referenced through the GOT. */
+#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 *__s = (X); \
@@ -84,22 +84,27 @@ extern int _dl_linux_dynamic_link(void);
#endif
#define SEND_ADDRESS_STDERR(X, add_a_newline) { \
- char tmp[13]; \
- _dl_write(2, _dl_simple_ltoahex_inline( tmp, (unsigned long)(X)), 12); \
+ char tmp[13], *tmp1; \
+ _dl_memset_inline(tmp, 0, sizeof(tmp)); \
+ tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
+ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \
if (add_a_newline) { \
tmp[0]='\n'; \
_dl_write(2, tmp, 1); \
} \
-};
+};
#define SEND_NUMBER_STDERR(X, add_a_newline) { \
- char tmp[13]; \
- _dl_write(2, (void *)_dl_simple_ltoahex_inline( tmp, (unsigned long)(X)), 12); \
+ char tmp[13], *tmp1; \
+ _dl_memset_inline(tmp, 0, sizeof(tmp)); \
+ tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \
+ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \
if (add_a_newline) { \
tmp[0]='\n'; \
_dl_write(2, tmp, 1); \
} \
-};
+};
+
extern int _dl_fdprintf(int, const char *, ...);
extern char * _dl_library_path;
extern char * _dl_not_lazy;