Commit 49ad2d5f authored by Russell King's avatar Russell King

[ARM] Fixes for 2.5.46

- Add LDFLAGS_BLOB definitions
- Tweak kernel_thread for better code
- Fix vmlinux-armv.lds.in to prevent ld complaining about the
  architecture private flags.
(I'm not certain that the last item isn't a hole in some bug fix in
ld - this fix appears to work with every binutils I've found thus
far.  However, if this suspected bug gets fixed, we're going to have
to rethink how we combine binary objects into ELF objects.)
parent 0dff14d6
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# Copyright (C) 1995-2001 by Russell King # Copyright (C) 1995-2001 by Russell King
LDFLAGS_vmlinux :=-p -X LDFLAGS_vmlinux :=-p -X
LDFLAGS_BLOB :=--format binary
AFLAGS_vmlinux.lds.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) AFLAGS_vmlinux.lds.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR)
OBJCOPYFLAGS :=-O binary -R .note -R .comment -S OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
GZFLAGS :=-9 GZFLAGS :=-9
...@@ -60,6 +61,7 @@ AFLAGS +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float -Wa,-mno-fpu ...@@ -60,6 +61,7 @@ AFLAGS +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float -Wa,-mno-fpu
ifeq ($(CONFIG_CPU_26),y) ifeq ($(CONFIG_CPU_26),y)
PROCESSOR := armo PROCESSOR := armo
HEAD := arch/arm/mach-arc/head.o arch/arm/kernel/init_task.o HEAD := arch/arm/mach-arc/head.o arch/arm/kernel/init_task.o
LDFLAGS_BLOB += --oformat elf26-littlearm
ifeq ($(CONFIG_ROM_KERNEL),y) ifeq ($(CONFIG_ROM_KERNEL),y)
DATAADDR = 0x02080000 DATAADDR = 0x02080000
TEXTADDR = 0x03800000 TEXTADDR = 0x03800000
...@@ -72,6 +74,7 @@ ifeq ($(CONFIG_CPU_32),y) ...@@ -72,6 +74,7 @@ ifeq ($(CONFIG_CPU_32),y)
PROCESSOR = armv PROCESSOR = armv
HEAD := arch/arm/kernel/head.o arch/arm/kernel/init_task.o HEAD := arch/arm/kernel/head.o arch/arm/kernel/init_task.o
TEXTADDR = 0xC0008000 TEXTADDR = 0xC0008000
LDFLAGS_BLOB += --oformat elf32-littlearm
endif endif
ifeq ($(CONFIG_ARCH_ARCA5K),y) ifeq ($(CONFIG_ARCH_ARCA5K),y)
......
...@@ -391,12 +391,12 @@ void dump_thread(struct pt_regs * regs, struct user * dump) ...@@ -391,12 +391,12 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
*/ */
pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
{ {
pid_t __ret; register unsigned int r0 asm("r0") = flags | CLONE_VM | CLONE_UNTRACED;
register unsigned int r1 asm("r1") = 0;
register pid_t __ret asm("r0");
__asm__ __volatile__( __asm__ __volatile__(
"orr r0, %1, %2 @ kernel_thread sys_clone \n\ __syscall(clone)" @ kernel_thread sys_clone \n\
mov r1, #0 \n\
"__syscall(clone)" \n\
movs %0, r0 @ if we are the child \n\ movs %0, r0 @ if we are the child \n\
bne 1f \n\ bne 1f \n\
mov fp, #0 @ ensure that fp is zero \n\ mov fp, #0 @ ensure that fp is zero \n\
...@@ -406,8 +406,8 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) ...@@ -406,8 +406,8 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
b sys_exit \n\ b sys_exit \n\
1: " 1: "
: "=r" (__ret) : "=r" (__ret)
: "Ir" (flags), "r" (CLONE_VM | CLONE_UNTRACED), "r" (fn), "r" (arg) : "0" (r0), "r" (r1), "r" (fn), "r" (arg)
: "r0", "r1", "lr"); : "lr");
return __ret; return __ret;
} }
......
...@@ -37,7 +37,7 @@ SECTIONS ...@@ -37,7 +37,7 @@ SECTIONS
__initcall_end = .; __initcall_end = .;
. = ALIGN(32); . = ALIGN(32);
__initramfs_start = .; __initramfs_start = .;
*(.init.initramfs) usr/built-in.o(.init.ramfs)
__initramfs_end = .; __initramfs_end = .;
. = ALIGN(4096); . = ALIGN(4096);
__init_end = .; __init_end = .;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment