Date: Mon, 18 Sep 2017 05:59:47 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323698 - projects/powernv/conf Message-ID: <201709180559.v8I5xl3t071735@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Mon Sep 18 05:59:47 2017 New Revision: 323698 URL: https://svnweb.freebsd.org/changeset/base/323698 Log: Work around odd behavior in kexec-lite: it requires that there be no INTERP section (just an assertion, no good reason for this) and ignores the defined entry point for the executable, beginning execution at the beginning of the first PT_LOAD section. Solve these by (if possible) dropping INTERP and arranging things such that the first instruction of the first PT_LOAD section is, in fact, the entry point. This allows stock kexec-lite, and thus petitboot, to directly load and start the FreeBSD kernel from Linux. Still panics a little ways in with an SMP error, but that is a problem for another day. Modified: projects/powernv/conf/Makefile.powerpc projects/powernv/conf/ldscript.powerpc64 Modified: projects/powernv/conf/Makefile.powerpc ============================================================================== --- projects/powernv/conf/Makefile.powerpc Mon Sep 18 04:12:46 2017 (r323697) +++ projects/powernv/conf/Makefile.powerpc Mon Sep 18 05:59:47 2017 (r323698) @@ -46,6 +46,12 @@ CFLAGS.gcc+= -Wa,-many CFLAGS+= -fPIC LDFLAGS+= -pie +# Work around assertion in kexec-lite. The GCC version switch is really +# a binutils version switch by correlation. +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 50000 +LDFLAGS+= --no-dynamic-linker +.endif + .if !empty(DDB_ENABLED) CFLAGS+= -fno-omit-frame-pointer .endif Modified: projects/powernv/conf/ldscript.powerpc64 ============================================================================== --- projects/powernv/conf/ldscript.powerpc64 Mon Sep 18 04:12:46 2017 (r323697) +++ projects/powernv/conf/ldscript.powerpc64 Mon Sep 18 05:59:47 2017 (r323698) @@ -10,7 +10,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + SIZEOF_HEADERS; + . = kernbase; PROVIDE (begin = . - SIZEOF_HEADERS); .text :
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709180559.v8I5xl3t071735>