From nobody Wed Feb 14 19:43:07 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 4TZpWw02HBz52ghJ; Wed, 14 Feb 2024 19:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TZpWv4hmCz4jL0; Wed, 14 Feb 2024 19:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707939787; 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=NPrPkp39JjW0aMleEGK3Ajk+3pjE3RDcUy+yarT9Zb0=; b=E2AO5uLQQ2OOF3cM9SL+X4mmuQik20mZ0Mqvtt6MNRZCaUgKbouaQAVlaH2Fk9l4cy7sgn 5PQmYMBasuD6EcVRam9+iu77xEJmzgUwlXxY/K74DJ9tNV27QinddPIpf+MAtF9+o0vtH9 4SkyqL18xSaOgQJGi4mZYujwfxMbtGi82T7O/kzi6isWabTgKp+NpJe6V9QD/VaYvK8sj7 BsxBRXsGoPTf99qbwe+Pv7a1JdbGZ5w7S/WH+Hfm3zo3z+pquXEfy+DkNBLh885Xfy1R+7 XEk+w+kZRBNN3zj5pgHnmlLwTqEj9S3I72FVnoklb7BhisyAc1O3V7obRJb0Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707939787; a=rsa-sha256; cv=none; b=kZIH4Fja/RENBTlc0G1lDGkdemlhB50UfhMeG/HCdvb010/6zBn+qpDLlI5uCwDZ3dMcU3 MXQoC6fQ8Espyft/jA8ANaLgAQNHCFh7gofgBeSgANjV6u1lC/Nfo6Q1+mhYskuF+/1+qJ K+cX9u42zR4soNKEU2YUfC1JLo4refsWo8ngjWM7lVZBe0gmuxU9yD9df/+yocggb4/hal oecjeACFffl5IWK8/33u5ubtqHuifzJHhk00KDfH7Y541LpypYXYEFaUjKBpVmR7jkNFYe uUqF7mAP5XtyCkKqIYUrdFUsZ3N1ZCbZ2II6ayTPEYTlBKrGVG42HFmk+nZBUg== 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=1707939787; 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=NPrPkp39JjW0aMleEGK3Ajk+3pjE3RDcUy+yarT9Zb0=; b=A0BmnOq2Qjy2avtffZbChEyPDmH2gYpFjsDcfYd6vXlAIJqzmbuHRTMz69ISUoE8FOR8JQ wKIH2UEYeLJYktro2TrGm+cAzPgGCKEJBUn2ahg+KnsF1Jr5RK9afcbiPnRWT/9eOUlrQY mYu1gUCZC4C8y2fFuIprAERq0l2cFnQn54SxGfw2cuovIoozBSPxhSKk8Uf28eO84OjxG9 O9jp+4QdcmEaBISoDmzWlJAccGmPevfX1vqSuZ8OPTpnQKZ13ykYMaq4rUYsLcHcE1yIg1 U8WSg4ssYGOHROMN1/vrJT+YqQ3qWBGrbuKoSj19uTLIqxisQ44d2X598Vsbqw== 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 4TZpWv3n8mz19t0; Wed, 14 Feb 2024 19:43:07 +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 41EJh7Dw067406; Wed, 14 Feb 2024 19:43:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41EJh7aV067403; Wed, 14 Feb 2024 19:43:07 GMT (envelope-from git) Date: Wed, 14 Feb 2024 19:43:07 GMT Message-Id: <202402141943.41EJh7aV067403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 42ceb92e6a54 - stable/13 - 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: 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: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 42ceb92e6a544fa0956eb660b3c16e38189acf20 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=42ceb92e6a544fa0956eb660b3c16e38189acf20 commit 42ceb92e6a544fa0956eb660b3c16e38189acf20 Author: Dimitry Andric AuthorDate: 2024-02-14 19:41:09 +0000 Commit: Dimitry Andric CommitDate: 2024-02-14 19:42:21 +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) --- 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();