summaryrefslogtreecommitdiff
path: root/ldso/ldso/mips/dl-startup.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-06-10 07:22:28 +0000
committerEric Andersen <andersen@codepoet.org>2005-06-10 07:22:28 +0000
commit39624db737b70fa6a4f374262d014aa4b73e7456 (patch)
tree7c59e5c543f701241fc0ded1813b47bddb7e67ca /ldso/ldso/mips/dl-startup.h
parent471547253f18dfd4f6a11cb786f97782f9861772 (diff)
Finish updating mips for the new ABI
Diffstat (limited to 'ldso/ldso/mips/dl-startup.h')
-rw-r--r--ldso/ldso/mips/dl-startup.h72
1 files changed, 48 insertions, 24 deletions
diff --git a/ldso/ldso/mips/dl-startup.h b/ldso/ldso/mips/dl-startup.h
index f369f77f1..fdc5d5717 100644
--- a/ldso/ldso/mips/dl-startup.h
+++ b/ldso/ldso/mips/dl-startup.h
@@ -2,40 +2,64 @@
* will work as expected and cope with whatever platform specific wierdness is
* needed for this architecture.
* Copyright (C) 2005 by Joakim Tjernlund
+ * Copyright (C) 2005 by Erik Andersen
*/
+
asm(""
" .text\n"
" .globl _start\n"
+ " .ent _start\n"
" .type _start,@function\n"
"_start:\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"
+ " move $25, $31\n"
+ " bal 0f\n"
" nop\n"
- "coff: subu $8, $31, $8\n"
+ "0:\n"
+ " .cpload $31\n"
+ " move $31, $25\n"
" .set reorder\n"
- " la $25, _dl_start\n"
- " addu $25, $8\n"
- " jalr $25\n"
- " move $17, $2\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"
- " move $25, $17\n"
- " jr $25\n"
- " .size _start,.-_start\n"
- " .previous\n"
+ " la $4, _DYNAMIC\n"
+ " sw $4, -0x7ff0($28)\n"
+ " move $4, $29\n"
+ " subu $29, 16\n"
+ " la $8, .coff\n"
+ " bltzal $8, .coff\n"
+ ".coff:\n"
+ " subu $8, $31, $8\n"
+ " la $25, _dl_start\n"
+ " addu $25, $8\n"
+ " jalr $25\n"
+ " addiu $29, 16\n"
+ " move $16, $28\n"
+ " move $17, $2\n"
+ " lw $2, _dl_skip_args\n"
+ " beq $2, $0, 1f\n"
+ " lw $4, 0($29)\n"
+ " subu $4, $2\n"
+ " sll $2, 2\n"
+ " addu $29, $2\n"
+ " sw $4, 0($29)\n"
+ "1:\n"
+ " lw $5, 0($29)\n"
+ " la $6, 4 ($29)\n"
+ " sll $7, $5, 2\n"
+ " addu $7, $7, $6\n"
+ " addu $7, $7, 4\n"
+ " and $2, $29, -2 * 4\n"
+ " sw $29, -4($2)\n"
+ " subu $29, $2, 32\n"
+ " .cprestore 16\n"
+ " lw $29, 28($29)\n"
+ " la $2, _dl_fini\n"
+ " move $25, $17\n"
+ " jr $25\n"
+ ".end _start\n"
+ ".size _start, . -_start\n"
+ "\n\n"
+ "\n\n"
+ ".previous\n"
);
/*