From owner-svn-src-all@freebsd.org Tue Feb 25 00:45:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00B3424A0E5; Tue, 25 Feb 2020 00:45:10 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48RKw567Msz4Dtk; Tue, 25 Feb 2020 00:45:09 +0000 (UTC) (envelope-from bdragon@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF208625E; Tue, 25 Feb 2020 00:45:09 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01P0j9cR029273; Tue, 25 Feb 2020 00:45:09 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01P0j9eE029272; Tue, 25 Feb 2020 00:45:09 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202002250045.01P0j9eE029272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 25 Feb 2020 00:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358304 - head/stand/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/stand/powerpc/ofw X-SVN-Commit-Revision: 358304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 00:45:10 -0000 Author: bdragon Date: Tue Feb 25 00:45:09 2020 New Revision: 358304 URL: https://svnweb.freebsd.org/changeset/base/358304 Log: [PowerPC] Fix LLD10 linking of ofw loader on ppc Before this change, LLD10 was creating several extra PT_LOAD sections, which OFW does not understand. Like we do for the kernel already, specify the program headers manually. Additionally, to work around a crash in our base ld.bfd, we need to actually assign something to the output section. LLD does not need this. One side effect of this change is the removal of the GNU_STACK header. This is more correct, since we are using a statically-allocated stack and RWX mappings across the board this early in boot. Reviewed by: jhibbits, Fangrui Song Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23778 Modified: head/stand/powerpc/ofw/ldscript.powerpc Modified: head/stand/powerpc/ofw/ldscript.powerpc ============================================================================== --- head/stand/powerpc/ofw/ldscript.powerpc Tue Feb 25 00:37:13 2020 (r358303) +++ head/stand/powerpc/ofw/ldscript.powerpc Tue Feb 25 00:45:09 2020 (r358304) @@ -6,11 +6,15 @@ OUTPUT_ARCH(powerpc:common) ENTRY(_start) SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); +PHDRS +{ + text PT_LOAD; +} SECTIONS { /* Read-only sections, merged into text segment: */ . = 0x02c00000 + SIZEOF_HEADERS; - .interp : { *(.interp) } + .interp : { *(.interp) } :text .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) }