summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-30 21:28:56 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-30 21:28:56 +0000
commit22a9e5bbdf43e1086d80341480d0601ee9c6f898 (patch)
tree359f16a4709f1a44915c1beb8f8ae621690fc158 /ldso
parent75ee43d1c2bc330fd4ce44c4ee3f5d2d2476e5bf (diff)
Sanitize the calling of _dl_linux_resolver so it can be read by
mere mortals, and so it says what it means. Ick this stuff was nasty. -Erik
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/i386/dl-sysdep.h3
-rw-r--r--ldso/ldso/i386/elfinterp.c8
-rw-r--r--ldso/ldso/i386/ld_sysdep.h3
-rw-r--r--ldso/ldso/i386/resolve.S7
-rw-r--r--ldso/ldso/i386/sysdep.h3
5 files changed, 10 insertions, 14 deletions
diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h
index 2011049b1..64d4b7a46 100644
--- a/ldso/ldso/i386/dl-sysdep.h
+++ b/ldso/ldso/i386/dl-sysdep.h
@@ -75,6 +75,7 @@
/* Used for error messages */
#define ELF_TARGET "386"
-extern unsigned int _dl_linux_resolver(int dummy, int i);
+struct elf_resolve;
+extern unsigned int _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
#define do_rem(result, n, base) result = (n % base)
diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c
index 01149c69b..359018a51 100644
--- a/ldso/ldso/i386/elfinterp.c
+++ b/ldso/ldso/i386/elfinterp.c
@@ -53,23 +53,17 @@ extern char *_dl_progname;
extern int _dl_linux_resolve(void);
-unsigned int _dl_linux_resolver(int dummy, int i)
+unsigned int _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry)
{
- unsigned int * sp;
- int reloc_entry;
int reloc_type;
struct elf32_rel * this_reloc;
char * strtab;
struct elf32_sym * symtab;
struct elf32_rel * rel_addr;
- struct elf_resolve * tpnt;
int symtab_index;
char * new_addr;
char ** got_addr;
unsigned int instr_addr;
- sp = &i;
- reloc_entry = sp[1];
- tpnt = (struct elf_resolve *) sp[0];
rel_addr = (struct elf32_rel *) (tpnt->dynamic_info[DT_JMPREL] +
tpnt->loadaddr);
diff --git a/ldso/ldso/i386/ld_sysdep.h b/ldso/ldso/i386/ld_sysdep.h
index 2011049b1..64d4b7a46 100644
--- a/ldso/ldso/i386/ld_sysdep.h
+++ b/ldso/ldso/i386/ld_sysdep.h
@@ -75,6 +75,7 @@
/* Used for error messages */
#define ELF_TARGET "386"
-extern unsigned int _dl_linux_resolver(int dummy, int i);
+struct elf_resolve;
+extern unsigned int _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
#define do_rem(result, n, base) result = (n % base)
diff --git a/ldso/ldso/i386/resolve.S b/ldso/ldso/i386/resolve.S
index 8ae2efa70..4abf243f4 100644
--- a/ldso/ldso/i386/resolve.S
+++ b/ldso/ldso/i386/resolve.S
@@ -13,8 +13,7 @@ _dl_linux_resolve:
lea 0x20(%esp),%eax /* eax = tpnt and reloc_entry params */
pushl 4(%eax) /* push copy of reloc_entry param */
pushl (%eax) /* push copy of tpnt param */
- pushl %eax /* _dl_linux_resolver expects a dummy
- * param - this could be removed */
+
#ifdef __PIC__
call .L24
.L24:
@@ -25,9 +24,9 @@ _dl_linux_resolve:
#else
call _dl_linux_resolver
#endif
- movl %eax,0x2C(%esp) /* store func addr over original
+ movl %eax,0x28(%esp) /* store func addr over original
* tpnt param */
- addl $0xC,%esp /* remove copy parameters */
+ addl $0x8,%esp /* remove copy parameters */
popa /* restore regs */
ret $4 /* jump to func removing original
* reloc_entry param from stack */
diff --git a/ldso/ldso/i386/sysdep.h b/ldso/ldso/i386/sysdep.h
index 2011049b1..64d4b7a46 100644
--- a/ldso/ldso/i386/sysdep.h
+++ b/ldso/ldso/i386/sysdep.h
@@ -75,6 +75,7 @@
/* Used for error messages */
#define ELF_TARGET "386"
-extern unsigned int _dl_linux_resolver(int dummy, int i);
+struct elf_resolve;
+extern unsigned int _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
#define do_rem(result, n, base) result = (n % base)