Author: adrian
Date: Mon May 16 23:56:31 2016
New Revision: 299993
URL: https://svnweb.freebsd.org/changeset/base/299993

Log:
  [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 <miz...@gmail.com>
  Differential Revision:        https://reviews.freebsd.org/D6242

Modified:
  head/sys/conf/Makefile.mips

Modified: head/sys/conf/Makefile.mips
==============================================================================
--- head/sys/conf/Makefile.mips Mon May 16 23:54:28 2016        (r299992)
+++ head/sys/conf/Makefile.mips Mon May 16 23:56:31 2016        (r299993)
@@ -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/
        ${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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to