summaryrefslogtreecommitdiff
path: root/ldso/ldso/i386
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-03-17 17:14:06 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-03-17 17:14:06 +0000
commit2331c7f052ef946d357037e694430a2f473e7af5 (patch)
tree25f311c14b0dfc3d90bfa1cfd0a452f8a7569432 /ldso/ldso/i386
parentfde774dc47375abbad649b5de91b8e96dcc014a8 (diff)
General arch cleanup and prepare support for standalone
execution of ldso. Added new asm for MIPS to be tested. All arches should retest.
Diffstat (limited to 'ldso/ldso/i386')
-rw-r--r--ldso/ldso/i386/dl-startup.h21
-rw-r--r--ldso/ldso/i386/dl-sysdep.h4
2 files changed, 17 insertions, 8 deletions
diff --git a/ldso/ldso/i386/dl-startup.h b/ldso/ldso/i386/dl-startup.h
index fd546491e..68a2a6563 100644
--- a/ldso/ldso/i386/dl-startup.h
+++ b/ldso/ldso/i386/dl-startup.h
@@ -4,8 +4,15 @@
* Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
*/
-/* For x86 we do not need any special setup so go right to _dl_boot() */
-#define DL_BOOT(X) __attribute_used__ void _dl_boot (X)
+asm(
+ " .text\n"
+ " .globl _start\n"
+ " .type _start,@function\n"
+ "_start:\n"
+ " .set _start,_dl_start\n"
+ " .size _start,.-_start\n"
+ " .previous\n"
+);
/* 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
@@ -40,7 +47,9 @@ void PERFORM_BOOTSTRAP_RELOC(ELF_RELOC *rpnt, unsigned long *reloc_addr,
/* 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. */
-#define START() \
- __asm__ volatile ("leave\n\t" \
- "jmp *%%eax\n\t" \
- : "=a" (status) : "a" (_dl_elf_main))
+#define START() { \
+ int status = 0; \
+ __asm__ volatile ("leave\n\t" \
+ "jmp *%%eax\n\t" \
+ : "=a" (status) : "a" (_dl_elf_main)); \
+}
diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h
index de0e85faa..a916bb776 100644
--- a/ldso/ldso/i386/dl-sysdep.h
+++ b/ldso/ldso/i386/dl-sysdep.h
@@ -61,8 +61,8 @@ elf_machine_load_address (void)
via the GOT to make sure the compiler initialized %ebx in time. */
extern int _dl_errno;
Elf32_Addr addr;
- asm ("leal _dl_boot@GOTOFF(%%ebx), %0\n"
- "subl _dl_boot@GOT(%%ebx), %0"
+ asm ("leal _dl_start@GOTOFF(%%ebx), %0\n"
+ "subl _dl_start@GOT(%%ebx), %0"
: "=r" (addr) : "m" (_dl_errno) : "cc");
return addr;
}