summaryrefslogtreecommitdiffstats
path: root/sys/conf/Makefile.mips
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2016-05-16 23:56:31 +0000
committeradrian <adrian@FreeBSD.org>2016-05-16 23:56:31 +0000
commitaa53a333b4f2abae9d1b2edc130cc99cb5231b2c (patch)
tree1f7000cd859c4080ac41e3273a9930ab3a05c0bb /sys/conf/Makefile.mips
parent35698b98c017847fbbab9b3bd94a41c32b13a54f (diff)
downloadFreeBSD-src-aa53a333b4f2abae9d1b2edc130cc99cb5231b2c.zip
FreeBSD-src-aa53a333b4f2abae9d1b2edc130cc99cb5231b2c.tar.gz
[mips] Improve MIPS trampoline code
This patch fix trampoline build. inckern.S increases stack and calls _startC of elf_trampoline, so inckern.S should be called before elf_trampoline. gcc4.2 puts text (code) into image according to order of source files in this call, so order has changed. In addition make will install trampoline kernel. It allows to use kernel for firmware build. Submitted by: Michael Zhilin <mizhka@gmail.com> Differential Revision: https://reviews.freebsd.org/D6242
Diffstat (limited to 'sys/conf/Makefile.mips')
-rw-r--r--sys/conf/Makefile.mips3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/conf/Makefile.mips b/sys/conf/Makefile.mips
index 09eca75..d1e6923 100644
--- a/sys/conf/Makefile.mips
+++ b/sys/conf/Makefile.mips
@@ -62,6 +62,7 @@ ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE
.if !defined(WITHOUT_KERNEL_TRAMPOLINE)
KERNEL_EXTRA=trampoline
+KERNEL_EXTRA_INSTALL=${KERNEL_KO}.tramp.bin
trampoline: ${KERNEL_KO}.tramp.bin
${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \
$S/$M/$M/inckern.S
@@ -72,7 +73,7 @@ ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \
${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \
-T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \
-DKERNNAME="\"${KERNEL_KO}.tmp\"" -DELFSIZE=${TRAMP_ELFSIZE} \
- $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \
+ $S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c \
-o ${KERNEL_KO}.tramp.elf
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.elf \
${KERNEL_KO}.tramp.bin
OpenPOWER on IntegriCloud