From nobody Sun Mar 12 21:49:35 2023 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 4PZYNH6V6bz3xh8n; Sun, 12 Mar 2023 21:49:35 +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 4PZYNH5fyHz4cwS; Sun, 12 Mar 2023 21:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657775; 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=ca6oX4w6zWFw5hMf/tvIjwXCcNec6WJlKZ5BbczKXSE=; b=bvtUEfOqwXHSFebUgHJQ5jYxCwy8N1UzgTfivYyT/9NoKybMfCRpFOYCby31YVmNqA9/qV 6VXGc2gw/MTniiiwuSKSuecZbobBU83MLTrqqEDLmCjDv+JGOh4CuqftS+pz9BqJk6d8Dh KlW54WEntj4WnMHvE+qDmq+tq6+YJFU6Y1iuJ9yc37rDDVzMFn3P2AURZ+IVjCXenAPqEz s4X5RDEgLe18zKs4rzUI6TH93TbjgFjiAR7Bsm0wnUXAAxcNKmRRYGg8MOgqoV+xoAVLsZ 73DJ+dnNc2GS86/Yqnci3z/aXz0q2mj+a06w0Qjcm3fdfYa0KYEpjTGD7In47w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678657775; 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=ca6oX4w6zWFw5hMf/tvIjwXCcNec6WJlKZ5BbczKXSE=; b=uu0ADEcnMAPbgqZE5iuPFYuj45BDMWfTe0/icr3bKL4SmHMQQ2cikxqmfNj9L+uiA9xKx5 wfep3HrOeCFsF5K3EK+VNmqOjxSyyZ+AGtIF0i1zJVlaFlAwGU47rg3sK7CIi7n9QW0u/x YXl7TZ0sDCSvLu7wWA8r8Q0CY9Xibv+U+ln0ry4g81ef7bNfTYeGqWUGJCyzinOoJMhcsz /++4AKFxhOHQRUG2zymG2NUwBfHXt3LZdOdZof9BpQRs/zItPwYRsI3PUeW1obRidkCWVP ljoRKYukWPIp1dCRctUUetLIStKn1LlhT4ky6uuskoHu/WglUsoHzzYl2MEF5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678657775; a=rsa-sha256; cv=none; b=Jg1sRALMyUDyn8F2dV+Oo4CHgLRzLkVqlPS5iMWGXyLrccShw4R02r+6LytKB/cpHZ3ckB wQdoNWmxCXl6UUq00FFoQuNMoDU7rHM4D0OhwJ9UP6f8KnZtP8DkY/CwzzENA9AYPqacb0 6x6UeCe1mwGqFAkDM1e4nCb2vu4vWMi///r0j/DFojaYBOL8xZUNP70SnjXWSr7QQ8bii5 ipN21Qhdhxi+IZa9gQhL+rajgL4gXfvjtuqsPkcHRm8rtIUmFSF/9SWYlGuTosXH+94+7S PghTtNUk49PBNgPDV41lzT3AO0TcUjPPPT/RLP95aX1Hk02NsvR6g88LutyxSA== 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 4PZYNH4jKXzS7h; Sun, 12 Mar 2023 21:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32CLnZTp049826; Sun, 12 Mar 2023 21:49:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CLnZ2h049825; Sun, 12 Mar 2023 21:49:35 GMT (envelope-from git) Date: Sun, 12 Mar 2023 21:49:35 GMT Message-Id: <202303122149.32CLnZ2h049825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c383f4857f16 - main - lib/csu: do not compile the body of handle_static_init() for PIC build at all 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c383f4857f1696c4beb782db36323f46f0c4f6de Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c383f4857f1696c4beb782db36323f46f0c4f6de commit c383f4857f1696c4beb782db36323f46f0c4f6de Author: Konstantin Belousov AuthorDate: 2023-03-12 01:45:37 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-12 21:47:41 +0000 lib/csu: do not compile the body of handle_static_init() for PIC build at all The referenced symbols that provide init array boundaries are weak, hidden, and undefined. The code that iterates over that arrays is not used for the case when libc is compiled as dso. This should fix linking with ld.bfd. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks --- lib/libc/csu/libc_start1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index 346409e3f370..d6a973bf0fe0 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -94,6 +94,7 @@ finalizer(void) static void handle_static_init(int argc, char **argv, char **env) { +#ifndef PIC void (*fn)(int, char **, char **); size_t array_size, n; @@ -115,6 +116,7 @@ handle_static_init(int argc, char **argv, char **env) if ((uintptr_t)fn != 0 && (uintptr_t)fn != 1) fn(argc, argv, env); } +#endif } static void