From nobody Mon May 13 20:58:31 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 4VdWzq2PtJz5KxT5; Mon, 13 May 2024 20:58:31 +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 4VdWzq1sxYz4nRP; Mon, 13 May 2024 20:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715633911; 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=liPmscFLYDM2pVj8//UwM4+OYuKVVEqWinHj6/FPfFc=; b=SAWuf34qPT++A1CUEV7S+WLm6V74VnAToCL9R5CdMEzoYairNMHt+2tYRHgd6hCZh/FuUU emzm+06bnHEJ6I4aK13HrryogGleS7IsAcWc6CoTmmMTEivPTAJcK2zhQTRrFSsQX8OXig qQnhkg+nAmEZXxs4MrIlIsX1ysQQh53Gyv+QwNx4u//7vd10BpXH/0K1sv/GzPQC/gf+78 dTcWEbnz758XNG0DqfcE9ZQDXH25t7bh+VDcRFdZXK7AQNpe5bmna3L3uSG38/iziYRfC3 Ls8S+swlOy2yDOOBZPH+Pz+UGN7NqBZn4ztezsLbhUSSWvw5PPNLzOEX1Oo5ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715633911; a=rsa-sha256; cv=none; b=QPqT0BAs4P9R3+KmZp+NMvR8CcmcBn7D72gTu7wv0hYmvlxUYFv0Qrw8iLXTnh1VQywjGG TlVIHaMpTXYw9ofF0sptkdQjgu3UJkhQKk442QqlK2lSFW2f2ut//mXCzIjYPHngQku771 KB08J6CSjB49CmXqGNa67e/4LJDVkp+5CAxFRR5QCCmVyA0Yp61QMQcm7yEIUOzH33qgaB sLYyy7VYh23wQujNJ6glSol2VOpVSrQp6gYeff4b+zqYkxILgTQz7Ts8dwmrXmJNnxoi2G LGr1W5Zp7Mb0jNK0QRECL1ONaeT3U+ivW0LRrltl+rd/7UxY6ftgtJgDoKTt4w== 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=1715633911; 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=liPmscFLYDM2pVj8//UwM4+OYuKVVEqWinHj6/FPfFc=; b=I0kGMD0dBDcLzWZsrK3RyeDf0z3adVQvxpoATymBJGPGj6E9LU/T6oCYEnUW0Mskz3nHWz 7kNSSFD5fy5VWskA/fmzXnlmq+l0CdX0xHkcBzRolkLpUQ+nXzeZuwipTQlvAAsjtPlS7p INOCV64okLl7RnNODwIII22wuSrNu4HG5oI2MdPPhJxwT4wySDgPcWf7Cr/5CjbkIgMlfo Ga7/SetBjuZmpVhqNrzAS8X7XvM1oOlMCYQkPfB+MV51JCpR9gBuJiqI9TrMHRad+BFbKl 95+NDObl8tSNCfLJaysdVenDaS8HzPTbEJyWQBoCO3sNVv11A9huW4C9JACGdg== 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 4VdWzq1BPKz13NL; Mon, 13 May 2024 20:58:31 +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 44DKwVoO087109; Mon, 13 May 2024 20:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DKwVZg087106; Mon, 13 May 2024 20:58:31 GMT (envelope-from git) Date: Mon, 13 May 2024 20:58:31 GMT Message-Id: <202405132058.44DKwVZg087106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: 975e833ff730 - releng/14.1 - lld: work around elftoolchain bug which causes bloated RISCV binaries 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 975e833ff73005bd3b786de57e037b3bbd15fbab Auto-Submitted: auto-generated The branch releng/14.1 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=975e833ff73005bd3b786de57e037b3bbd15fbab commit 975e833ff73005bd3b786de57e037b3bbd15fbab Author: Dimitry Andric AuthorDate: 2024-02-14 19:41:09 +0000 Commit: Mike Karels CommitDate: 2024-05-13 20:58:20 +0000 lld: work around elftoolchain bug which causes bloated RISCV binaries The elftoolchain strip(1) command appears to have trouble with the new .riscv.attributes sections being added by lld 17 to RISCV binaries. This causes huge 'holes' in the files, making them larger than necessary. Since nothing in the base system uses the new section yet, patch lld to leave it out for now. Direct commit to stable/13, since this intended to go into the 13.3 release, while the elftoolchain bug is being investigated. Cherry-pick to stable/14 from stable/13 for the 14.1 release; the bug has not been fixed yet. Hopefully it will be fixed (or the code replaced) in time for 14.2. When that happens, this can be reverted. Reported by: karels Submitted by: jrtc27 Approved by: re (cperciva) (cherry picked from commit 42ceb92e6a544fa0956eb660b3c16e38189acf20) (cherry picked from commit 8f0bd08e9869ac1e6ad1f0f9c3964a76457cbce1) --- contrib/llvm-project/lld/ELF/Writer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/llvm-project/lld/ELF/Writer.cpp b/contrib/llvm-project/lld/ELF/Writer.cpp index 8a08b0fcc90d..0c1bd27bb1fe 100644 --- a/contrib/llvm-project/lld/ELF/Writer.cpp +++ b/contrib/llvm-project/lld/ELF/Writer.cpp @@ -2148,9 +2148,13 @@ template void Writer::finalizeSections() { addPhdrForSection(part, SHT_MIPS_OPTIONS, PT_MIPS_OPTIONS, PF_R); addPhdrForSection(part, SHT_MIPS_ABIFLAGS, PT_MIPS_ABIFLAGS, PF_R); } +#if 0 + // XXX: This stops elftoolchain strip adjusting .riscv.attributes, + // leaving large holes in binaries. if (config->emachine == EM_RISCV) addPhdrForSection(part, SHT_RISCV_ATTRIBUTES, PT_RISCV_ATTRIBUTES, PF_R); +#endif } Out::programHeaders->size = sizeof(Elf_Phdr) * mainPart->phdrs.size();