From nobody Thu Feb 15 18:10:51 2024 X-Original-To: dev-commits-src-branches@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 4TbNR0243Yz59nYZ; Thu, 15 Feb 2024 18:10:52 +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 4TbNR01cxtz4pCM; Thu, 15 Feb 2024 18:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708020652; 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=fz2DURkpuIkOHc7DKp1t1bqIXH0pUkTOOh71gGbjO18=; b=rwG30HSW9Sj2gSi/UjrWys3JslrLQ5sxxsWfdwk9Fkr/xTSPpV/l7K+kQZ7bWOAFfcPuXA LRgJjusfRFhQyVYOr201Gste/LtALtGEj9fxPELjhEYLmheqCQgzz/0YQJ6KbvTb4MRxQE Cho49scjj0b43AVx+DK++7fFpFyYEO826vhb5/n3efhI3/VkYIPE34zszuRYklW5flWhTd cK2PZxLxV8O5/9rj10CIxaHdZwSOwxYLzybcDx6YdnrM2Rw/Z0tyuSwIKy2duNntt0Lvlm lnV8DQiHVrFQ5sjAYBi6epU36tZ/AcL0XYDIBkFH1qp1aZYQhb0PrunRazDYoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708020652; a=rsa-sha256; cv=none; b=xTPqm1NJPYSLif6F8i0ztxa2iiSSXn8l08nfVL6WZz5BGqqimm6fuRPtDBT5rTIMdRsrKS HSAiw7AXvAplV2XbWaZHVKCIs/DXc2zEVNgAfWHvkiatzW5zfUy+xJouwHOBcTli5hNO6L Xl5BfiibKnkDMblE/IhLbiQo3eQ8RiSLMCb673DMuWFG/h0oE57EX37qso7hK0/lKkCnCF rDwwSL9NtKntW+7JOs1bVgzvNv1iRZC937VjieiJSamFdSBBLZeanfsgMgl6fJMNY44HtG PqOU6qmhiIP3K/NjhR52CRb+1F6aHbudJXk+FuKHKL5s1Pjjjg8nbVJUen5zsg== 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=1708020652; 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=fz2DURkpuIkOHc7DKp1t1bqIXH0pUkTOOh71gGbjO18=; b=i1ANnmAIxsr40s2OGk9kz/dvuFO/1fJgczN+5Vf1aAGRsxoM3AD90Lfzu5CaVHSpWtHs+s EFNaXsWvPC+KApMWceEhFyWt3MsnF88Wyv1F5kNWOnfWbhocjkOl3/RsSmJdWmHAA22iQq yjZ3Jg/luskEmMp4jmh/lNDXyV3kxIw48rYd/sdmJ0TppZjyaw1SMSS7x5iMfngOMl/faE wLf1zj1zH9LEFbcOutOXfFBZw5gn7hqnD6Sa/5pa2j5goNDo8a1+ByNWVrSeVMIceELsfp oao/e3DS0wOb4AMs75VEPK2n8zG2T9ghrAItBoSMrAdn1ojlKGhXXIcYqK/Lgw== 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 4TbNR00gkCzrYj; Thu, 15 Feb 2024 18:10:52 +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 41FIApTX029458; Thu, 15 Feb 2024 18:10:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41FIApMI029455; Thu, 15 Feb 2024 18:10:51 GMT (envelope-from git) Date: Thu, 15 Feb 2024 18:10:51 GMT Message-Id: <202402151810.41FIApMI029455@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: 313b30b6ab1f - releng/13.3 - lld: work around elftoolchain bug which causes bloated RISCV binaries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13.3 X-Git-Reftype: branch X-Git-Commit: 313b30b6ab1f0c9549d29129f2fb6b1e31ef5f0f Auto-Submitted: auto-generated The branch releng/13.3 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=313b30b6ab1f0c9549d29129f2fb6b1e31ef5f0f commit 313b30b6ab1f0c9549d29129f2fb6b1e31ef5f0f Author: Dimitry Andric AuthorDate: 2024-02-14 19:41:09 +0000 Commit: Mike Karels CommitDate: 2024-02-15 18:09:56 +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. Reported by: karels Submitted by: jrtc27 Approved by: re (cperciva) (cherry picked from commit 42ceb92e6a544fa0956eb660b3c16e38189acf20) --- 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 368c9aabceae..850a6bb49721 100644 --- a/contrib/llvm-project/lld/ELF/Writer.cpp +++ b/contrib/llvm-project/lld/ELF/Writer.cpp @@ -2044,9 +2044,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();