summaryrefslogtreecommitdiff
path: root/ldso/ldso/sh64/dl-startup.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-12-17 08:07:14 +0000
committerEric Andersen <andersen@codepoet.org>2003-12-17 08:07:14 +0000
commit14ad6760690b422e2d0f709c06a543196a6da2c0 (patch)
tree69c315b6c87ac9ab90cfe435ea3c31f801135368 /ldso/ldso/sh64/dl-startup.h
parent0a0a648ed65342e7bb71608894c308bfb6143a4d (diff)
Patch from Paul Mundt <lethal@linux-sh.org>:
Here's the patch for the ldso bits for sh64. This is still in need of a bunch of debugging, testing, etc. and is really only being submitted for general completeness. This assumes that the previous patches I've submitted have already been applied. I plan on playing with this and buildroot some more later, as I'd definitely like to see buildroot images for sh64.
Diffstat (limited to 'ldso/ldso/sh64/dl-startup.h')
-rw-r--r--ldso/ldso/sh64/dl-startup.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/ldso/ldso/sh64/dl-startup.h b/ldso/ldso/sh64/dl-startup.h
new file mode 100644
index 000000000..0a538ac30
--- /dev/null
+++ b/ldso/ldso/sh64/dl-startup.h
@@ -0,0 +1,25 @@
+/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
+ * will work as expected and cope with whatever platform specific wierdness is
+ * needed for this architecture.
+ */
+
+asm("" \
+" .section .text..SHmedia32,\"ax\"\n" \
+" .globl _dl_boot\n" \
+" .type _dl_boot, @function\n" \
+" .align 5\n" \
+"_dl_boot:\n" \
+" ! Set r12 to point to GOT\n" \
+" movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ3-.)) >> 16) & 65535), r12\n" \
+" shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ3-.)) & 65535), r12\n" \
+".LZZZ3:\n" \
+" ptrel/u r12, tr0\n" \
+" gettr tr0, r12 ! GOT address\n" \
+" add r18, r63, r11 ! save return address - needed?\n" \
+" add r15, r63, r2 ! arg = stack pointer\n" \
+" pt _dl_boot2, tr0 ! should work even if PIC\n" \
+" blink tr0, r18 ! call _dl_boot2 - user EP is in r2\n" \
+);
+
+#define _dl_boot _dl_boot2
+#define LD_BOOT(X) static void * __attribute__ ((unused)) _dl_boot (X)