summaryrefslogtreecommitdiff
path: root/ldso/ldso/m68k/dl-startup.h
diff options
context:
space:
mode:
authorKhem Raj <kraj@mvista.com>2009-04-09 07:38:04 +0000
committerKhem Raj <kraj@mvista.com>2009-04-09 07:38:04 +0000
commit3c2a68b9dc9ae45f5eb0971a3e6583af732c3f91 (patch)
tree5e66ac6f4b89da6d854a304862d1b6337f8e4fd2 /ldso/ldso/m68k/dl-startup.h
parent0dca115912f5d64c96f14876fff3bd582a8c4a1b (diff)
The attached patches fixes the problems found bringing up uclibc on coldfire
M5485 processor 1. Disable mmap2() if we're compiling for coldfire and fall back to mmap(). It seems to map a different file area on a 2.6.25 linux kernel. 2. Uses pc-relative addresing[1], computes ADDR_ALIGN, PAGE_ALIGN and OFFSET_ALIGN relatively to _dl_pagesize[3]. On coldfire/M5485 _dl_pagesize is 0x2000. Signed-off-by: Groleo Marius <groleo@gmail.com>
Diffstat (limited to 'ldso/ldso/m68k/dl-startup.h')
-rw-r--r--ldso/ldso/m68k/dl-startup.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/ldso/ldso/m68k/dl-startup.h b/ldso/ldso/m68k/dl-startup.h
index 2c38102a3..13530e05c 100644
--- a/ldso/ldso/m68k/dl-startup.h
+++ b/ldso/ldso/m68k/dl-startup.h
@@ -4,6 +4,17 @@
* Copyright (C) 2005 by Erik Andersen <andersen@codepoet.org>
*/
+/* Perform operation OP with PC-relative SRC as the first operand and
+ * DST as the second. TMP is available as a temporary if needed. */
+
+#ifdef __mcoldfire__
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
+ "move.l #" SRC " - ., " TMP "\n\t" OP " (-8, " PC ", " TMP "), " DST
+#else
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
+ OP " " SRC "(" PC "), " DST
+#endif
+
__asm__ ("\
.text\n\
.globl _start\n\
@@ -21,7 +32,7 @@ _dl_start_user:\n\
move.l %d0, %a4\n\
# See if we were run as a command with the executable file\n\
# name as an extra leading argument.\n\
- move.l _dl_skip_args(%pc), %d0\n\
+ " PCREL_OP ("move.l", "_dl_skip_args", "%d0", "%d0", "%pc") "\n\
# Pop the original argument count\n\
move.l (%sp)+, %d1\n\
# Subtract _dl_skip_args from it.\n\
@@ -31,7 +42,7 @@ _dl_start_user:\n\
# Push back the modified argument count.\n\
move.l %d1, -(%sp)\n\
# Pass our finalizer function to the user in %a1.\n\
- lea _dl_fini(%pc), %a1\n\
+ " PCREL_OP ("lea", "_dl_fini", "%a1", "%a1", "%pc") "\n\
# Initialize %fp with the stack pointer.\n\
move.l %sp, %fp\n\
# Jump to the user's entry point.\n\