From owner-svn-src-head@freebsd.org Thu Nov 14 04:34:19 2019 Return-Path: Delivered-To: svn-src-head@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 3E5841C5B4C; Thu, 14 Nov 2019 04:34:19 +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 47D7t30pkHz48vG; Thu, 14 Nov 2019 04:34:19 +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 E204522FDD; Thu, 14 Nov 2019 04:34:18 +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 xAE4YIFg031912; Thu, 14 Nov 2019 04:34:18 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAE4YI0N031910; Thu, 14 Nov 2019 04:34:18 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201911140434.xAE4YI0N031910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 14 Nov 2019 04:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354701 - in head/sys: conf powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys: conf powerpc/aim X-SVN-Commit-Revision: 354701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2019 04:34:19 -0000 Author: bdragon Date: Thu Nov 14 04:34:17 2019 New Revision: 354701 URL: https://svnweb.freebsd.org/changeset/base/354701 Log: powerpc: Kernel fixes for ppc32 and powerpcspe w/ lld Fix wrong section ordering that was causing a ".got is not contiguous with other relro sections" lld error. This also brings ldscript.powerpc and ldscript.powerpcspe closer to ldscript.powerpc64. Also, remove unnecessary text relocs from the ppc32 AIM trap code. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D22349 Modified: head/sys/conf/ldscript.powerpc head/sys/conf/ldscript.powerpcspe head/sys/powerpc/aim/trap_subr32.S Modified: head/sys/conf/ldscript.powerpc ============================================================================== --- head/sys/conf/ldscript.powerpc Thu Nov 14 01:38:48 2019 (r354700) +++ head/sys/conf/ldscript.powerpc Thu Nov 14 04:34:17 2019 (r354701) @@ -15,6 +15,7 @@ SECTIONS .text : { + *(.glink) *(.text) *(.stub) /* .gnu.warning sections are handled specially by elf32.em. */ @@ -71,6 +72,11 @@ SECTIONS } .data1 : { *(.data1) } .got1 : { *(.got1) } + . = ALIGN(4096); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + + .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. @@ -87,10 +93,6 @@ SECTIONS .fixup : { *(.fixup) } PROVIDE (_FIXUP_END_ = .); PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ Modified: head/sys/conf/ldscript.powerpcspe ============================================================================== --- head/sys/conf/ldscript.powerpcspe Thu Nov 14 01:38:48 2019 (r354700) +++ head/sys/conf/ldscript.powerpcspe Thu Nov 14 04:34:17 2019 (r354701) @@ -15,6 +15,7 @@ SECTIONS .text : { + *(.glink) *(.text) *(.stub) /* .gnu.warning sections are handled specially by elf32.em. */ @@ -72,6 +73,11 @@ SECTIONS } .data1 : { *(.data1) } .got1 : { *(.got1) } + . = ALIGN(4096); + .got : { *(.got) } + .got.plt : { *(.got.plt) } + + .dynamic : { *(.dynamic) } /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. @@ -88,10 +94,6 @@ SECTIONS .fixup : { *(.fixup) } PROVIDE (_FIXUP_END_ = .); PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Nov 14 01:38:48 2019 (r354700) +++ head/sys/powerpc/aim/trap_subr32.S Thu Nov 14 04:34:17 2019 (r354701) @@ -302,10 +302,8 @@ CNAME(restorebridgesize) = .-CNAME(restorebridge) */ .globl CNAME(rstcode), CNAME(rstcodeend) CNAME(rstcode): - bl 1f - .long cpu_reset -1: mflr %r31 - lwz %r31,0(%r31) + lwz %r31, TRAP_GENTRAP(0) + addi %r31, %r31, (cpu_reset - generictrap) mtlr %r31 blrl CNAME(rstcodeend): @@ -384,10 +382,8 @@ CNAME(alitrap): mtcr %r31 /* Jump to s_trap */ - bl 1f - .long s_trap -1: mflr %r31 - lwz %r31,0(%r31) + lwz %r31, TRAP_GENTRAP(0) + addi %r31, %r31, (s_trap - generictrap) mtlr %r31 blrl CNAME(aliend): @@ -652,10 +648,8 @@ CNAME(dsitrap): mflr %r28 /* save LR (SP already saved) */ /* Jump to disitrap */ - bl 4f - .long disitrap -4: mflr %r1 - lwz %r1,0(%r1) + lwz %r1, TRAP_GENTRAP(0) + addi %r1, %r1, (disitrap - generictrap) mtlr %r1 blrl CNAME(dsiend): @@ -929,10 +923,8 @@ CNAME(dblow): mflr %r28 /* save LR */ /* Jump to dbtrap */ - bl 2f - .long dbtrap -2: mflr %r1 - lwz %r1,0(%r1) + lwz %r1, TRAP_GENTRAP(0) + addi %r1, %r1, (dbtrap - generictrap) mtlr %r1 blrl CNAME(dbend):