From nobody Sun Sep 22 14:49:08 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 4XBTXh6Czbz5Xp3g; Sun, 22 Sep 2024 14:49:08 +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 4XBTXh31Qdz4gck; Sun, 22 Sep 2024 14:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727016548; 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=MuyhF6uT8uXQx7wj9OPD+o8hVsbLopJejxRWKrW01fw=; b=h9GOhEpW8AQzDjkRoUqqw6HYg0rVDPDAyIDQqYX6onoh++1hfwa6twZGg5nPh7pkLDnF/i HErDtd7Z/K2En84NRIe4q+y3dG82J0LjVt+5j0Ha9BDUkYsbqTPyjFQyHzA6JmRyZat6sN Pnvkc4g1w4f8kUfgoImwjn+HBOL8mGskA0lC2e7lFdqiV+loMG6gCAIWD0KM+5cEmmSjew lkKsakiVf5unlLeKhGAIsZEuGdtWzG2hiEqf0V4xpKqXD2hEG01QwBDRRFoaLIyQ+pBIlG kafhPEtpXL/c6OcopL73IQUJtlpYzw6n1QaKeMPt7Pes4+TeaC2Ot7vnrctRhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727016548; a=rsa-sha256; cv=none; b=wJ9ex4KWaTt8EetQFlMNSjDa6zlbiGI+oCqYhIlHyWy3IBmwb1WQRmzTMw2Tf1e2RyAiYW vUz4m9cLUjGivJX3GB92+aO70FCzxpgQjKj5Z0GHeX2wdCxfXLchoyiIXZ8xitRFMnrAxy 1Z0IgfaYgUD4XKU7CW7vk6YCKo7UiRmi4ClS/bFxRFy/OKr5zVtxB4IQhnVs0Iqo9k+ug4 FfdaR8TpATIHAPMWDn46TlWbZj7VeOiyiuxRdIkdEs2uGmKPKsv5tHW5ExYXd4XBEYYTsR Hs395p/hvAj1UriFsTG0iOiPAJYp28jH7OqLyT7MKOG4BEySPlG3tAKoYM0dhA== 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=1727016548; 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=MuyhF6uT8uXQx7wj9OPD+o8hVsbLopJejxRWKrW01fw=; b=ZS0GKERzmVy+ATMuPsty30yTF2EmCxl+sY6P+9R0cUbLN/RglEgEILEgCdorCOJAidoL3s AX2yKRw6VyH/ra/ZZIRIkImKyaPTUEB5I3n2OZtqDT2r3xzZRYXSnEQ0YhVXJXIz/KWVg0 hTtdcdTfveCcybZnB6IY2mo6UBvWHmwEgqwWIwfa5zAgfaVhc4LREF79YHvayNSM3hnVhp rvgjJLig7cHKxRdOTgPc45oAN7AF8EfEXgXzo4phcYWJY+xUW9AzSXY2t7Xb2D5k3gpzGv Slbvxj6tQ+z0zZIwwCbMb6PUkLKJgQZX1DOgKJIOzcwcjpJ3vuoVPinAF083Kw== 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 4XBTXh2XCZz1L2L; Sun, 22 Sep 2024 14:49:08 +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 48MEn87J029885; Sun, 22 Sep 2024 14:49:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48MEn88v029882; Sun, 22 Sep 2024 14:49:08 GMT (envelope-from git) Date: Sun, 22 Sep 2024 14:49:08 GMT Message-Id: <202409221449.48MEn88v029882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: bb5f70161454 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: bb5f701614546c2e2cc682e23f49f7606cea3138 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bb5f701614546c2e2cc682e23f49f7606cea3138 commit bb5f701614546c2e2cc682e23f49f7606cea3138 Author: Zhenlei Huang AuthorDate: 2024-09-02 04:26:48 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-22 14:45:36 +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 (cherry picked from commit 3e76d05231b0aa77d922bdbc9abf62d9747a91ab) --- 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 a9c39977a6fc..f42af5bc4a4c 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 21c7dc35d9b7..8a4aeebb6622 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -98,6 +98,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 2bfc02768a22..bb72d25e6af7 100644 --- a/sys/conf/ldscript.powerpc +++ b/sys/conf/ldscript.powerpc @@ -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.powerpc64 b/sys/conf/ldscript.powerpc64 index f436a3bc0f64..d4daa4d07c14 100644 --- a/sys/conf/ldscript.powerpc64 +++ b/sys/conf/ldscript.powerpc64 @@ -105,7 +105,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 bd883853711a..a87ae9f139fd 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) } :text :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 38209f6516c8..82ac2ad1b811 100644 --- a/sys/conf/ldscript.powerpcspe +++ b/sys/conf/ldscript.powerpcspe @@ -80,8 +80,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 9a2764a23789..ad6f2676c504 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 :