summaryrefslogtreecommitdiff
path: root/ldso/ldso/mips
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/mips
parentc201ba7c107edbb5fe81c641e87715a4930a4ff1 (diff)
Rework file naming, aiming for at least a vague level of consistancy
Diffstat (limited to 'ldso/ldso/mips')
-rw-r--r--ldso/ldso/mips/README4
-rw-r--r--ldso/ldso/mips/boot1_arch.h37
-rw-r--r--ldso/ldso/mips/ld_syscalls.h7
-rw-r--r--ldso/ldso/mips/ld_sysdep.h136
4 files changed, 2 insertions, 182 deletions
diff --git a/ldso/ldso/mips/README b/ldso/ldso/mips/README
index 1cf6301e5..9ca6a869b 100644
--- a/ldso/ldso/mips/README
+++ b/ldso/ldso/mips/README
@@ -18,7 +18,7 @@ contains the function to perform relocations for objects
other than the linker itself. The code was taken from the
function 'elf_machine_rel' in 'sysdeps/mips/dl-machine.h'.
-ld_syscalls.h
+dl-syscalls.h
-------------
Used to contain all the macro functions for the system calls
as well as the list of system calls supported. We now include
@@ -27,7 +27,7 @@ so we can use the same file for the linker as well as userspace.
Original code was taken from the Linux kernel source 2.4.17 and
can be found in the file 'include/asm-mips/unistd.h'.
-ld_sysdep.h
+dl-sysdep.h
-----------
Contains bootstrap code for the dynamic linker, magic numbers
for detecting MIPS target types and some macros. The macro
diff --git a/ldso/ldso/mips/boot1_arch.h b/ldso/ldso/mips/boot1_arch.h
deleted file mode 100644
index 886f8b8b8..000000000
--- a/ldso/ldso/mips/boot1_arch.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
- * will work as expected and cope with whatever platform specific wierdness is
- * needed for this architecture.
- */
-
-asm("" \
-" .text\n" \
-" .globl _dl_boot\n" \
-"_dl_boot:\n" \
-" .set noreorder\n" \
-" bltzal $0, 0f\n" \
-" nop\n" \
-"0: .cpload $31\n" \
-" .set reorder\n" \
-" la $4, _DYNAMIC\n" \
-" sw $4, -0x7ff0($28)\n" \
-" move $4, $29\n" \
-" la $8, coff\n" \
-" .set noreorder\n" \
-" bltzal $0, coff\n" \
-" nop\n" \
-"coff: subu $8, $31, $8\n" \
-" .set reorder\n" \
-" la $25, _dl_boot2\n" \
-" addu $25, $8\n" \
-" jalr $25\n" \
-" lw $4, 0($29)\n" \
-" la $5, 4($29)\n" \
-" sll $6, $4, 2\n" \
-" addu $6, $6, $5\n" \
-" addu $6, $6, 4\n" \
-" la $7, _dl_elf_main\n" \
-" lw $25, 0($7)\n" \
-" jr $25\n" \
-);
-
-#define DL_BOOT(X) static void __attribute__ ((unused)) _dl_boot2 (X)
diff --git a/ldso/ldso/mips/ld_syscalls.h b/ldso/ldso/mips/ld_syscalls.h
deleted file mode 100644
index e4a1ff9c4..000000000
--- a/ldso/ldso/mips/ld_syscalls.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Define the __set_errno macro as nothing so that we don't bother
- * setting 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/mips/ld_sysdep.h b/ldso/ldso/mips/ld_sysdep.h
deleted file mode 100644
index 17ce7cf71..000000000
--- a/ldso/ldso/mips/ld_sysdep.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* vi: set sw=4 ts=4: */
-
-/*
- * Various assmbly language/system dependent hacks that are required
- * so that we can minimize the amount of platform specific code.
- */
-
-/*
- * Define this if the system uses RELOCA.
- */
-#undef 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 the application/library GOT.
- */
-#define INIT_GOT(GOT_BASE,MODULE) \
-do { \
- unsigned long i; \
- \
- /* Check if this is the dynamic linker itself */ \
- if (MODULE->libtype == program_interpreter) \
- continue; \
- \
- /* Fill in first two GOT entries according to the ABI */ \
- GOT_BASE[0] = (unsigned long) _dl_linux_resolve; \
- GOT_BASE[1] = (unsigned long) MODULE; \
- \
- /* Add load address displacement to all local GOT entries */ \
- i = 2; \
- while (i < MODULE->mips_local_gotno) \
- GOT_BASE[i++] += (unsigned long) MODULE->loadaddr; \
- \
-} while (0)
-
-
-/*
- * Here is a macro to perform the GOT relocation. This is only
- * used when bootstrapping the dynamic loader.
- */
-#define PERFORM_BOOTSTRAP_GOT(got) \
-do { \
- Elf32_Sym *sym; \
- unsigned long i; \
- \
- /* Add load address displacement to all local GOT entries */ \
- i = 2; \
- while (i < tpnt->mips_local_gotno) \
- got[i++] += load_addr; \
- \
- /* Handle global GOT entries */ \
- got += tpnt->mips_local_gotno; \
- sym = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + \
- load_addr) + tpnt->mips_gotsym; \
- i = tpnt->mips_symtabno - tpnt->mips_gotsym; \
- \
- while (i--) { \
- if (sym->st_shndx == SHN_UNDEF || \
- sym->st_shndx == SHN_COMMON) \
- *got = load_addr + sym->st_value; \
- else if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && \
- *got != sym->st_value) \
- *got += load_addr; \
- else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) { \
- if (sym->st_other == 0) \
- *got += load_addr; \
- } \
- else \
- *got = load_addr + sym->st_value; \
- \
- got++; \
- sym++; \
- } \
-} while (0)
-
-
-/*
- * Here is a macro to perform a relocation. This is only used when
- * bootstrapping the dynamic loader.
- */
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
- switch(ELF32_R_TYPE((RELP)->r_info)) { \
- case R_MIPS_REL32: \
- if (symtab_index) { \
- if (symtab_index < tpnt->mips_gotsym) \
- *REL += SYMBOL; \
- } \
- else { \
- *REL += LOAD; \
- } \
- break; \
- case R_MIPS_NONE: \
- break; \
- default: \
- SEND_STDERR("Aiieeee!"); \
- _dl_exit(1); \
- }
-
-
-/*
- * Transfer control to the user's application, once the dynamic loader
- * is done. This routine has to exit the current function, then
- * call the _dl_elf_main function. For MIPS, we do it in assembly
- * because the stack doesn't get properly restored otherwise. Got look
- * at boot1_arch.h
- */
-#define START()
-
-
-/* Here we define the magic numbers that this dynamic loader should accept */
-#define MAGIC1 EM_MIPS
-#define MAGIC2 EM_MIPS_RS3_LE
-
-
-/* Used for error messages */
-#define ELF_TARGET "MIPS"
-
-
-unsigned long _dl_linux_resolver(unsigned long sym_index,
- unsigned long old_gpreg);
-
-
-#define do_rem(result, n, base) result = (n % base)
-
-/* 4096 bytes alignment */
-#define PAGE_ALIGN 0xfffff000
-#define ADDR_ALIGN 0xfff
-#define OFFS_ALIGN 0x7ffff000