summaryrefslogtreecommitdiff
path: root/ldso/ldso/cris
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-02-10 09:26:57 +0000
committerEric Andersen <andersen@codepoet.org>2004-02-10 09:26:57 +0000
commit70709408336e483de74947eb53e9ba01ef4ab140 (patch)
treefe17e15c0f272c571607172fc5c89d094de5f60c /ldso/ldso/cris
parentc201ba7c107edbb5fe81c641e87715a4930a4ff1 (diff)
Rework file naming, aiming for at least a vague level of consistancy
Diffstat (limited to 'ldso/ldso/cris')
-rw-r--r--ldso/ldso/cris/boot1_arch.h16
-rw-r--r--ldso/ldso/cris/dl-sysdep.h2
-rw-r--r--ldso/ldso/cris/ld_syscalls.h7
-rw-r--r--ldso/ldso/cris/ld_sysdep.h112
4 files changed, 1 insertions, 136 deletions
diff --git a/ldso/ldso/cris/boot1_arch.h b/ldso/ldso/cris/boot1_arch.h
deleted file mode 100644
index bf7714539..000000000
--- a/ldso/ldso/cris/boot1_arch.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * This code fix the stack pointer so that the dynamic linker
- * can find argc, argv and auxvt (Auxillary Vector Table).
- */
-asm("" \
-" .text\n" \
-" .globl _dl_boot\n" \
-" .type _dl_boot,@function\n" \
-"_dl_boot:\n" \
-" move.d $sp,$r10\n" \
-" move.d $pc,$r9\n" \
-" add.d _dl_boot2 - ., $r9\n" \
-" jsr $r9\n" \
-);
-
-#define DL_BOOT(X) static void __attribute__ ((unused)) _dl_boot2 (X)
diff --git a/ldso/ldso/cris/dl-sysdep.h b/ldso/ldso/cris/dl-sysdep.h
index c127076ff..7066863f6 100644
--- a/ldso/ldso/cris/dl-sysdep.h
+++ b/ldso/ldso/cris/dl-sysdep.h
@@ -66,7 +66,7 @@
struct elf_resolve;
extern unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry);
-/* Cheap modulo implementation, taken from arm/ld_sysdep.h. */
+/* Cheap modulo implementation, taken from arm/dl-sysdep.h. */
static inline unsigned long
cris_mod(unsigned long m, unsigned long p)
{
diff --git a/ldso/ldso/cris/ld_syscalls.h b/ldso/ldso/cris/ld_syscalls.h
deleted file mode 100644
index 651280c18..000000000
--- a/ldso/ldso/cris/ld_syscalls.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Define the __set_errno macro as nothing so that INLINE_SYSCALL
- * won't set errno, which is important since we make system calls
- * before the errno symbol is dynamicly linked.
- */
-#define __set_errno(X) {(void)(X);}
-#include "sys/syscall.h"
diff --git a/ldso/ldso/cris/ld_sysdep.h b/ldso/ldso/cris/ld_sysdep.h
deleted file mode 100644
index c127076ff..000000000
--- a/ldso/ldso/cris/ld_sysdep.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* CRIS can never use Elf32_Rel relocations. */
-#define ELF_USES_RELOCA
-
-/*
- * Get a pointer to the argv array. On many platforms this can be just
- * the address if the first argument, on other platforms we need to
- * do something a little more subtle here.
- */
-#define GET_ARGV(ARGVP, ARGS) ARGVP = ((unsigned long *) ARGS)
-
-/*
- * Initialization sequence for a GOT.
- */
-#define INIT_GOT(GOT_BASE,MODULE) \
-{ \
- GOT_BASE[1] = (unsigned long) MODULE; \
- GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
-}
-
-/*
- * Here is a macro to perform a relocation. This is only used when
- * bootstrapping the dynamic loader. RELP is the relocation that we
- * are performing, REL is the pointer to the address we are relocating.
- * SYMBOL is the symbol involved in the relocation, and LOAD is the
- * load address.
- */
-#define PERFORM_BOOTSTRAP_RELOC(RELP, REL, SYMBOL, LOAD, SYMTAB) \
- switch (ELF32_R_TYPE((RELP)->r_info)) { \
- case R_CRIS_GLOB_DAT: \
- case R_CRIS_JUMP_SLOT: \
- case R_CRIS_32: \
- *REL = SYMBOL; \
- break; \
- case R_CRIS_16_PCREL: \
- *(short *) *REL = SYMBOL + (RELP)->r_addend - *REL - 2; \
- break; \
- case R_CRIS_32_PCREL: \
- *REL = SYMBOL + (RELP)->r_addend - *REL - 4; \
- break; \
- case R_CRIS_NONE: \
- break; \
- case R_CRIS_RELATIVE: \
- *REL = (unsigned long) LOAD + (RELP)->r_addend; \
- break; \
- default: \
- _dl_exit(1); \
- break; \
- }
-
-/*
- * Transfer control to the user's application once the dynamic loader
- * is done. This routine has to exit the current function, then call
- * _dl_elf_main.
- */
-#define START() __asm__ volatile ("moveq 0,$r8\n\t" \
- "move $r8,$srp\n\t" \
- "move.d %1,$sp\n\t" \
- "jump %0\n\t" \
- : : "r" (_dl_elf_main), "r" (args))
-
-/* Defined some magic numbers that this ld.so should accept. */
-#define MAGIC1 EM_CRIS
-#undef MAGIC2
-#define ELF_TARGET "CRIS"
-
-struct elf_resolve;
-extern unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry);
-
-/* Cheap modulo implementation, taken from arm/ld_sysdep.h. */
-static inline unsigned long
-cris_mod(unsigned long m, unsigned long p)
-{
- unsigned long i, t, inc;
-
- i = p;
- t = 0;
-
- while (!(i & (1 << 31))) {
- i <<= 1;
- t++;
- }
-
- t--;
-
- for (inc = t; inc > 2; inc--) {
- i = p << inc;
-
- if (i & (1 << 31))
- break;
-
- while (m >= i) {
- m -= i;
- i <<= 1;
- if (i & (1 << 31))
- break;
- if (i < p)
- break;
- }
- }
-
- while (m >= p)
- m -= p;
-
- return m;
-}
-
-#define do_rem(result, n, base) result = cris_mod(n, base);
-
-/* 8192 bytes alignment */
-#define PAGE_ALIGN 0xffffe000
-#define ADDR_ALIGN 0x1fff
-#define OFFS_ALIGN 0xffffe000