From owner-svn-src-projects@freebsd.org Mon Sep 18 05:59:48 2017 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93C4CE2275D for ; Mon, 18 Sep 2017 05:59:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60EA180BBA; Mon, 18 Sep 2017 05:59:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8I5xlsF071737; Mon, 18 Sep 2017 05:59:47 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8I5xl3t071735; Mon, 18 Sep 2017 05:59:47 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201709180559.v8I5xl3t071735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 18 Sep 2017 05:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r323698 - projects/powernv/conf X-SVN-Group: projects X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: projects/powernv/conf X-SVN-Commit-Revision: 323698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Sep 2017 05:59:48 -0000 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 :