From nobody Fri Jan 26 00:19:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TLdbj3sv9z58LYG; Fri, 26 Jan 2024 00:19:13 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TLdbj3QNBz4tv3; Fri, 26 Jan 2024 00:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706228353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9XyLcVdeoh3kBss6wKG8alP4Wxp4dgC4OM+auUovu54=; b=t6lyALnX6HJm1b0PkzYcl1CwuDKhpCEln+4w5tMMUacZRC55dz1hFxODeblkjjH3rmaK6A H/92vMr5yeE/gCMPx2YQJ0fugWWTxQeLk4Y/nB2J8gj37c06LOUA7vbeyXlRzv1+9FRHgi 3LULdDTq6/OdQ7hNbv2qAzPJIbHBsmank2e5xRFvU/EdW7BVDl4uUq3oX2FmFcPyYr6O/f jOgIV9UCtRMfUkPv+CuQahBG1sDz+qriD8QgqdJfBs9KY6Aj+NI+JG0L5WRQCFMr5kotR6 ygnIcHZnuYiUgV+e3zuvsbSc0lPIJwnTQEXuw/LKczZKARufOB1cy7jLcLaA6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706228353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9XyLcVdeoh3kBss6wKG8alP4Wxp4dgC4OM+auUovu54=; b=QVXbgaByQZOUpiNulraRi7J5oxOc3LUdfmSAbMCay1x6xBLCfjQxZV7VvzTKJXcOhYc3+3 /SETh/MqVt0+aHbdSly653kHIE5tjnKlE7hTMOKzyvLpnxgUQ4bfHxrz+t/gzbHePQTACK bMyPZLj8olxV4Q80b46CWpmVf5zbjkX/j5jspg/6+URnsL8T2MfEV9XadWuteczHqx5ZPx DICWW2SDZbTNotOvIMEAUnmUmm85LCCHBb3xLrRFmbyjNQIK3mbGHB8j9iOHRVNbfKPy02 vAQQuhJ2IDIkCe9X6SnzCxpXhoEUcokFmz/yG3ajyDRvg58nLt9lWEZS+0jBww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706228353; a=rsa-sha256; cv=none; b=wKtoUForh43DFLIjKcJ8SwV5NCNfTd6mvYh30I8kw5Xcxf8+N5eNKlDyJY+6WOhUFHhrf+ Z4jk06VqoNnZS95uHNQH7XNp0uWBpfhe++8YQnffj9i8BdckL/IlLx9sOHFIcv91U5c0NM 8YRvcoF4E2EboAqQEeOAMRVG+53U8t23P32KxsYEUuGxm7F+XGs4dMOE6xy602OITKfwlu gwZWutNkWlOwlKe4J5hQo6WdNM+OFsncgrzbwVOfzwp8eXQ1qLZ72FhiEoezAyVB1NfiVT MgcBo67bMBn2L7AexEitQw9j8Dz2Z7aOWRwcMjYC364RBsDqK66UOXsmk9ku9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TLdbj2SyWzJx2; Fri, 26 Jan 2024 00:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40Q0JDmW084174; Fri, 26 Jan 2024 00:19:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40Q0JD04084171; Fri, 26 Jan 2024 00:19:13 GMT (envelope-from git) Date: Fri, 26 Jan 2024 00:19:13 GMT Message-Id: <202401260019.40Q0JD04084171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 3896a6cc0a8e - main - ldscript.powerpc*: Only put .dynamic in PT_DYNAMIC List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3896a6cc0a8e774f33e6381ecc73be6e51dc6a53 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3896a6cc0a8e774f33e6381ecc73be6e51dc6a53 commit 3896a6cc0a8e774f33e6381ecc73be6e51dc6a53 Author: Jessica Clarke AuthorDate: 2024-01-26 00:19:02 +0000 Commit: Jessica Clarke CommitDate: 2024-01-26 00:19:02 +0000 ldscript.powerpc*: Only put .dynamic in PT_DYNAMIC Currently there are a few output sections left as implicitly using :kernel :dynamic before :kernel on its own is used again, which means they end up in both the PT_LOAD and the PT_DYNAMIC segments, an unusual situation which the new libelf-based kldxref initially treated as invalid. Thus, hoist the :kernel to the very next section to ensure only .dynamic is in PT_DYNAMIC, as is more normal. Whilst here, sync ldscript.powerpc64le with ldscript.powerpc64 to pick up various fixes that were presumably made between the start of the powerpc64le port and it being committed and got missed. Reviewed by: jhibbits, jhb Differential Revision: https://reviews.freebsd.org/D43066 --- sys/conf/ldscript.powerpc | 4 ++-- sys/conf/ldscript.powerpc64 | 4 ++-- sys/conf/ldscript.powerpc64le | 17 +++++++++-------- sys/conf/ldscript.powerpcspe | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/sys/conf/ldscript.powerpc b/sys/conf/ldscript.powerpc index 2bfc02768a22..c08123e4eaba 100644 --- a/sys/conf/ldscript.powerpc +++ b/sys/conf/ldscript.powerpc @@ -86,7 +86,7 @@ SECTIONS get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ PROVIDE (_GOT2_START_ = .); - .got2 : { *(.got2) } + .got2 : { *(.got2) } :kernel PROVIDE (__CTOR_LIST__ = .); .ctors : { *(.ctors) } PROVIDE (__CTOR_END__ = .); @@ -100,7 +100,7 @@ SECTIONS /* 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. */ - .sdata : { *(.sdata) } :kernel + .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); .sbss : diff --git a/sys/conf/ldscript.powerpc64 b/sys/conf/ldscript.powerpc64 index f436a3bc0f64..df279576193f 100644 --- a/sys/conf/ldscript.powerpc64 +++ b/sys/conf/ldscript.powerpc64 @@ -111,7 +111,7 @@ SECTIONS get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ PROVIDE (_GOT2_START_ = .); - .got2 : { *(.got2) } + .got2 : { *(.got2) } :kernel PROVIDE (__CTOR_LIST__ = .); .ctors : { *(.ctors) } PROVIDE (__CTOR_END__ = .); @@ -125,7 +125,7 @@ SECTIONS /* 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. */ - .sdata : { *(.sdata) } :kernel + .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); .sbss : diff --git a/sys/conf/ldscript.powerpc64le b/sys/conf/ldscript.powerpc64le index bd883853711a..3fd80d3130fb 100644 --- a/sys/conf/ldscript.powerpc64le +++ b/sys/conf/ldscript.powerpc64le @@ -7,15 +7,15 @@ SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); PHDRS { - text PT_LOAD ; - dynamic PT_DYNAMIC ; + kernel PT_LOAD; + dynamic PT_DYNAMIC; } SECTIONS { /* Low-address wrapper for bootloaders (kexec/kboot) that can't parse ELF */ . = kernbase - 0x100; - .kboot : { *(.text.kboot) } :text + .kboot : { *(.text.kboot) } :kernel /* Read-only sections, merged into text segment: */ . = kernbase; @@ -36,9 +36,6 @@ SECTIONS /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */ /DISCARD/ : { *(.interp) } - /* Also delete notes */ - /DISCARD/ : { *(.note.*) } - .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } @@ -50,6 +47,10 @@ SECTIONS *(.note.gnu.build-id) PROVIDE (__build_id_end = .); } + + /* Do not emit any additional notes. */ + /DISCARD/ : { *(.note.*) } + .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) } .rela.data : @@ -105,12 +106,12 @@ SECTIONS .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - .dynamic : { *(.dynamic) } :text :dynamic + .dynamic : { *(.dynamic) } :kernel :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ PROVIDE (_GOT2_START_ = .); - .got2 : { *(.got2) } + .got2 : { *(.got2) } :kernel PROVIDE (__CTOR_LIST__ = .); .ctors : { *(.ctors) } PROVIDE (__CTOR_END__ = .); diff --git a/sys/conf/ldscript.powerpcspe b/sys/conf/ldscript.powerpcspe index 38209f6516c8..7d5b54a655a6 100644 --- a/sys/conf/ldscript.powerpcspe +++ b/sys/conf/ldscript.powerpcspe @@ -87,7 +87,7 @@ SECTIONS get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */ PROVIDE (_GOT2_START_ = .); - .got2 : { *(.got2) } + .got2 : { *(.got2) } :kernel PROVIDE (__CTOR_LIST__ = .); .ctors : { *(.ctors) } PROVIDE (__CTOR_END__ = .); @@ -101,7 +101,7 @@ SECTIONS /* 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. */ - .sdata : { *(.sdata) } :kernel + .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); .sbss :