summaryrefslogtreecommitdiff
path: root/src/ldso/microblaze
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-09-29 01:05:31 -0400
committerRich Felker <dalias@aerifal.cx>2012-09-29 01:05:31 -0400
commit8c0a3d9e5c169fc9d0f246ab59362b658b029ad7 (patch)
tree6ac54202768db511e8bb959d85060adb98cbf226 /src/ldso/microblaze
parente0ea44cb764fcdbe8515f22096930bede2c7896f (diff)
downloadmusl-8c0a3d9e5c169fc9d0f246ab59362b658b029ad7.tar.gz
microblaze port
based on initial work by rdp, with heavy modifications. some features including threads are untested because qemu app-level emulation seems to be broken and I do not have a proper system image for testing.
Diffstat (limited to 'src/ldso/microblaze')
-rw-r--r--src/ldso/microblaze/dlsym.s5
-rw-r--r--src/ldso/microblaze/start.s27
2 files changed, 32 insertions, 0 deletions
diff --git a/src/ldso/microblaze/dlsym.s b/src/ldso/microblaze/dlsym.s
new file mode 100644
index 00000000..2044e2df
--- /dev/null
+++ b/src/ldso/microblaze/dlsym.s
@@ -0,0 +1,5 @@
+.global dlsym
+.type dlsym,@function
+dlsym:
+ brid __dlsym
+ add r7, r15, r0
diff --git a/src/ldso/microblaze/start.s b/src/ldso/microblaze/start.s
new file mode 100644
index 00000000..4afd59f0
--- /dev/null
+++ b/src/ldso/microblaze/start.s
@@ -0,0 +1,27 @@
+# FIXME: clearing argv entries
+.global _start
+_start:
+ add r19, r0, r0
+
+ lw r5, r0, r1
+ addi r6, r1, 4
+ mfs r7, rpc
+ addi r7, r7, _GLOBAL_OFFSET_TABLE_+8
+ addi r7, r7, _DYNAMIC@GOTOFF
+ brlid r15, __reloc_self
+ nop
+
+ lwi r5, r1, 0
+ brlid r15, __dynlink
+ addi r6, r1, 4
+
+ lwi r4, r1, 0
+1: lwi r5, r1, 4
+ addi r5, r5, 1
+ bnei r5, 1f
+ addi r4, r4, -1
+ addi r1, r1, 4
+ bri 1b
+1: swi r4, r1, 0
+ add r5, r0, r0
+ bra r3