summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-02-17 07:33:12 +0000
committerEric Andersen <andersen@codepoet.org>2004-02-17 07:33:12 +0000
commit93915a08a4887ba96e0dfd0a9791ff8c576e4d41 (patch)
tree3091f5c0438ae848a2c3fef18ecb710804046871
parent44cbdd1f703631f0723fc14fc5e5a0d2d93b3709 (diff)
Kill off an arm specific hack, that fostered three other arch specific
hacks. Just check for the elf magic string one byte at a time....
-rw-r--r--ldso/ldso/arm/dl-startup.h4
-rw-r--r--ldso/ldso/dl-startup.c14
2 files changed, 5 insertions, 13 deletions
diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h
index 383fe4e1f..6e3033959 100644
--- a/ldso/ldso/arm/dl-startup.h
+++ b/ldso/ldso/arm/dl-startup.h
@@ -18,8 +18,4 @@ asm("" \
" mov pc, r6\n" \
);
- /* It seems ARM needs an offset here */
-#undef ELFMAGIC
-#define ELFMAGIC ELFMAG+load_addr
-
#define DL_BOOT(X) static void __attribute__ ((unused)) _dl_boot2 (X)
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index 63c0c7f2d..0ac5c0b48 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -90,9 +90,6 @@
#include "ldso.h"
-/* Some arches may need to override this in dl-startup.h */
-#define ELFMAGIC ELFMAG
-
/* This is a poor man's malloc, used prior to resolving our internal poor man's malloc */
#define LD_MALLOC(SIZE) ((void *) (malloc_buffer += SIZE, malloc_buffer - SIZE)) ; REALIGN();
@@ -186,15 +183,14 @@ DL_BOOT(unsigned long args)
/* Check the ELF header to make sure everything looks ok. */
if (!header || header->e_ident[EI_CLASS] != ELFCLASS32 ||
header->e_ident[EI_VERSION] != EV_CURRENT
-#if !defined(__powerpc__) && !defined(__mips__) && !defined(__sh__)
- || _dl_strncmp((void *) header, ELFMAGIC, SELFMAG) != 0
-#else
+ /* Do not use an inline _dl_strncmp here or some arches
+ * will blow chunks, i.e. those that need to relocate all
+ * string constants... */
|| header->e_ident[EI_MAG0] != ELFMAG0
|| header->e_ident[EI_MAG1] != ELFMAG1
|| header->e_ident[EI_MAG2] != ELFMAG2
- || header->e_ident[EI_MAG3] != ELFMAG3
-#endif
- ) {
+ || header->e_ident[EI_MAG3] != ELFMAG3)
+ {
SEND_STDERR("Invalid ELF header\n");
_dl_exit(0);
}