From nobody Mon Sep 02 04:29:37 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 4Wxwl60DTGz5Tqmy; Mon, 02 Sep 2024 04:29:38 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wxwl5523Cz4qqB; Mon, 2 Sep 2024 04:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725251377; 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=Ie+NyzVDTKVdpVQrV4oaK7v21bikuqwxY9utdUShqok=; b=Z6ix2KfvMfKKLj+ZEDGqVfDyN1NPzUEeuLEeLRkvTbxUxt9u59lYH1J2EZMUh9/TIRCEnB AF6m41GHHn5F+A8AXFlGSLI8PHUAxBVyroO0mGVeRLFB0e5BnH9qSdZmYSTNBtX4DbVHnv Q/aelp/2s6YUbCTQhYD3w5w+L/wZZYPDZly41isWCjw33J+sW0ykWw53idxb39gb3R0GGi 0ZP4MYeAKrZeoNSDbOr0Fm9XmgVHLPBqvauUDhH1VP4dqWKMAvxYmRYkt/7Q3Ln+n5rWk8 OyTfulxlH8CUCgEveR4ZQu6vsBsBh+sCRTxSRdO1tKDfR0d5d9Oz/ThrQXH4IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725251377; a=rsa-sha256; cv=none; b=wKjCidJBjN1D4Hg1DxBcezESyfuOi4ViI5A1jc2Ta28tu9SXQX0Jo6rK0I8Jy+9gbzYUhT bypCQGVnib1i2hKzGZMfQBQMdd0jYDNffwbeBTITCMzamz1no7+9kfxILbVB/YXGgPyIZo iE0LI/W1v3pDiUGamj72xmJqejGDD5wuYIHTddLEapYFhP9m/WRvLk5XHU9U3gmPd/GdBK L6IkaEi8S6tEDQKGaPC3mwFuUM7ZV8Ykq03WHtKhzWt2qQALjOh1koRHhzzRZpWjPkhcGh e3puEOhp/lU0Fe1/suXTOVZI3cvmZj4zZr3Jp9C+aRWV+FLhVqus8eVjVbT4Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725251377; 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=Ie+NyzVDTKVdpVQrV4oaK7v21bikuqwxY9utdUShqok=; b=Xnn5BY0fBG/mK9Dt3ftYRC2xJMtQWeCYcwwIyAkgeHYsetZ/pIkSSzPEaqEDr+FcMwv+6B ZpGbCzgVB4QKbVG+2X6t3ZfhlPpfjg+JOnUxqGCh0dlciVyXaQJjf3cG2vGpCknsrSRD4t SANaNAFMnzubzn9HdAbevrzC/T85iy3Typ5WD7fM3iExHQ4b/lJiDMft2E4dV1sYOu1zdL C5/rirQ4/IMCN0grdBtWbKGKf+jZSw31aKp3oSZ+rj3aToKHFx7wd+IQH5MdjhzxLFpbo8 hL39xx4yvKYL0s1hVC7bNOYo6P8464C1VBkKvT4OCZ8KL1iM0eYoiuB8guE/kw== 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 4Wxwl54dnSzxc8; Mon, 2 Sep 2024 04:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4824TbqK056220; Mon, 2 Sep 2024 04:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4824TbKK056217; Mon, 2 Sep 2024 04:29:37 GMT (envelope-from git) Date: Mon, 2 Sep 2024 04:29:37 GMT Message-Id: <202409020429.4824TbKK056217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3e76d05231b0 - main - kernel: Add defination of .init_array and .fini_array for all other platforms 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e76d05231b0aa77d922bdbc9abf62d9747a91ab Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3e76d05231b0aa77d922bdbc9abf62d9747a91ab commit 3e76d05231b0aa77d922bdbc9abf62d9747a91ab Author: Zhenlei Huang AuthorDate: 2024-09-02 04:26:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-02 04:26:48 +0000 kernel: Add defination of .init_array and .fini_array for all other platforms Currently these sections are not used but defined only for amd64 and i386. Added them for all other platforms to keep all platforms in sync. There should be no functional change. This change is extracted from a bigger patch [1] of hselasky, with additional fix for the order of .fini_array section. 1. https://reviews.freebsd.org/D40467 Obtained from: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45214 --- sys/conf/ldscript.arm | 14 ++++++++++++++ sys/conf/ldscript.arm64 | 14 ++++++++++++++ sys/conf/ldscript.powerpc | 16 ++++++++++++++-- sys/conf/ldscript.powerpc64 | 15 ++++++++++++++- sys/conf/ldscript.powerpc64le | 15 ++++++++++++++- sys/conf/ldscript.powerpcspe | 16 ++++++++++++++-- sys/conf/ldscript.riscv | 14 ++++++++++++++ 7 files changed, 98 insertions(+), 6 deletions(-) diff --git a/sys/conf/ldscript.arm b/sys/conf/ldscript.arm index 0764c99f9042..e8d2db3f854b 100644 --- a/sys/conf/ldscript.arm +++ b/sys/conf/ldscript.arm @@ -83,6 +83,20 @@ SECTIONS } .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64 index 32af035105d0..0d50eef431cf 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -100,6 +100,20 @@ SECTIONS . = ALIGN(128); .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors : diff --git a/sys/conf/ldscript.powerpc b/sys/conf/ldscript.powerpc index 0e11dd4459db..3a407a4dbf88 100644 --- a/sys/conf/ldscript.powerpc +++ b/sys/conf/ldscript.powerpc @@ -78,8 +78,20 @@ SECTIONS . = ALIGN(4096); .got : { *(.got) } .got.plt : { *(.got.plt) } - - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .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. diff --git a/sys/conf/ldscript.powerpc64 b/sys/conf/ldscript.powerpc64 index 58a3dc69931b..a342a48b9daf 100644 --- a/sys/conf/ldscript.powerpc64 +++ b/sys/conf/ldscript.powerpc64 @@ -104,7 +104,20 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .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. diff --git a/sys/conf/ldscript.powerpc64le b/sys/conf/ldscript.powerpc64le index a65b39b3d9eb..1d5f3efe64fd 100644 --- a/sys/conf/ldscript.powerpc64le +++ b/sys/conf/ldscript.powerpc64le @@ -104,7 +104,20 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got) } .toc : ALIGN(8) { *(.toc) } - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .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. diff --git a/sys/conf/ldscript.powerpcspe b/sys/conf/ldscript.powerpcspe index 66630aaabaae..fa82cbe8330f 100644 --- a/sys/conf/ldscript.powerpcspe +++ b/sys/conf/ldscript.powerpcspe @@ -79,8 +79,20 @@ SECTIONS . = ALIGN(4096); .got : { *(.got) } .got.plt : { *(.got.plt) } - - + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } .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. diff --git a/sys/conf/ldscript.riscv b/sys/conf/ldscript.riscv index b964a8739b7c..c730b423ccc2 100644 --- a/sys/conf/ldscript.riscv +++ b/sys/conf/ldscript.riscv @@ -71,6 +71,20 @@ SECTIONS } .data1 : { *(.data1) } . = ALIGN(32 / 8); + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + } + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP (*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + } _start_ctors = .; PROVIDE (start_ctors = .); .ctors :