summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-08-22 02:56:46 +0000
committerEric Andersen <andersen@codepoet.org>2003-08-22 02:56:46 +0000
commitf9c09888823fa659fcfe43eaa816a7a9ddbd04eb (patch)
tree999a07775d432f726dba6816e5b6817864959e13
parent6f4b3f9b2a000d0d659247b9098fb838a3a65788 (diff)
Remove some mips specific hacks that are no longer needed, and actively break
things, now that I have cleaned up the code to be a bit less horribly messy. With this, the shared lib loader works on mips once again. -Erik
-rw-r--r--ldso/ldso/ldso.c44
1 files changed, 13 insertions, 31 deletions
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index b3fbab842..2f8e611ba 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -419,18 +419,28 @@ LD_BOOT(unsigned long args)
if (dpnt->d_tag == DT_MIPS_SYMTABNO)
app_tpnt->mips_symtabno =
(unsigned long) dpnt->d_un.d_val;
-#endif
if (dpnt->d_tag > DT_JMPREL) {
dpnt++;
continue;
}
app_tpnt->dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val;
-#if !defined(__mips__)
+
+#warning "Debugging threads on mips won't work till someone fixes this..."
+#if 0
if (dpnt->d_tag == DT_DEBUG) {
dpnt->d_un.d_val = (unsigned long) debug_addr;
}
+#endif
+
#else
-#warning "Debugging threads on mips won't work till someone fixes this..."
+ if (dpnt->d_tag > DT_JMPREL) {
+ dpnt++;
+ continue;
+ }
+ app_tpnt->dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val;
+ if (dpnt->d_tag == DT_DEBUG) {
+ dpnt->d_un.d_val = (unsigned long) debug_addr;
+ }
#endif
if (dpnt->d_tag == DT_TEXTREL)
app_tpnt->dynamic_info[DT_TEXTREL] = 1;
@@ -690,20 +700,7 @@ static void _dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf_resolve *a
for (j = 0; j < epnt->e_phnum; j++, myppnt++) {
if (myppnt->p_type == PT_DYNAMIC) {
tpnt->dynamic_addr = (ElfW(Dyn) *)myppnt->p_vaddr + load_addr;
-#if defined(__mips__)
- {
- int k = 1;
- ElfW(Dyn) *dpnt = (ElfW(Dyn) *) tpnt->dynamic_addr;
-
- while(dpnt->d_tag) {
- dpnt++;
- k++;
- }
- tpnt->dynamic_size = k * sizeof(ElfW(Dyn));
- }
-#else
tpnt->dynamic_size = myppnt->p_filesz;
-#endif
}
}
}
@@ -728,23 +725,8 @@ static void _dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf_resolve *a
continue;
#endif
/* OK, we have what we need - slip this one into the list. */
-#if defined(__mips__)
- {
- int i = 1;
- Elf32_Dyn *dpnt = (Elf32_Dyn *) tpnt->dynamic_addr;
-
- while(dpnt->d_tag) {
- dpnt++;
- i++;
- }
- app_tpnt = _dl_add_elf_hash_table("", 0,
- app_tpnt->dynamic_info, ppnt->p_vaddr,
- (i * sizeof(Elf32_Dyn)));
- }
-#else
app_tpnt = _dl_add_elf_hash_table("", 0,
app_tpnt->dynamic_info, ppnt->p_vaddr, ppnt->p_filesz);
-#endif
_dl_loaded_modules->libtype = elf_executable;
_dl_loaded_modules->ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
_dl_loaded_modules->n_phent = auxvt[AT_PHNUM].a_un.a_val;