From nobody Thu Aug 6 18:03:25 2026 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 4hGFWf6rsJz6nRCP for ; Thu, 06 Aug 2026 18:03:26 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hGFWf17VPz3gk3 for ; Thu, 06 Aug 2026 18:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786039406; 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=P6QKSQe2tqawL7rPMeiu4LIfO6T8jwzAVG7TKuYpFGU=; b=ZEmtcfHXBJsl+jgtwReMh3xMwJrfC1c1WMrhOPngXB84LoSlniDhr1TEARtYIOg3993qmp 85iHe4jCuOWAY1qOEdGQ2xybed+rJ2lhLUqPqYbUaqG3GwRw0Raroah1kaENydbUM1G9eF ZXXmVqmxRKCBA2W0cqFQDYHA1Q3p8aVoFNOLjKfcN7MJnVvr+a/vQbjSvlmLkriG3pnXvJ safV7BQu9gWAAlIsPtejH9m3X9Jg/ScbMM9MfXj1PsQU0SzFk6aM9YciabjNZwd25h3tcF wLl+IIaQB3Y6SqxKEe53T42sPN4OApCSNxjlpTRlzhLIH3/t3g+YcwCMZsYotg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786039406; a=rsa-sha256; cv=none; b=V6aDh46p8IkP0CAZ1sZzVG98T84nwgSOqg8DoZOwSpRPbLqIcmthrC9OKKzrlZq/4yth7q EJwM86Bb/EjFj/+j0e+SLjFgt8xAxpHKh8F+hhlukwBarRLnkBRF7G9NAWl0gaq8aqu3p4 /Fj7VZgfFg/wH0MCaklV7u8Rhicii1fziqZiuLYRUSmzWbqgcVgl8osoE2QlZO/bMqqW5B kkCgUz6Cyc2e71lHOpstnp+Gs0Yb4tbt5neqPS5yY/GHgEZh5dR9D5nWm/4udMzj/oNWfU SdwcpN4jlECD1Jppf/wxDlOrGCUcx2Uxx7v06/yYWMZRfmBVnlN1ukddZr8mSg== 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=1786039406; 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=P6QKSQe2tqawL7rPMeiu4LIfO6T8jwzAVG7TKuYpFGU=; b=D7NrwWDH+bDPdsSYiMs+M/Q63mVJxAQD0j/BMIfXyuHsLleBZ74SntnMMkRm8Mm5xSDZLT I0++L7pygoYDxWciReiIB72+FGIN0tKwCjS26LEgBj4Na0mQcn0yAyNtoxTspiJp5idltF +VTpsMXNf8rSqkmxDFguK7SP3r7sfweXmyrBAhOOSD/kPcVKzeZiX/zb9vv0a/l3dLAMve o2FtK1TDFDxCw8VvQmSNpH2jMMDFZZOMvhYX/9+iMaU9l2DxOFPZujdPyYmp5wE69bw4HO 9oHYGH02hHpxPkzg14r18tFBD0z5WWmXZZdT6onB4Fhyhoh4yQYXDls6opLauw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hGFWd73ZtzXX3 for ; Thu, 06 Aug 2026 18:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32726 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 06 Aug 2026 18:03:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: bf61c2737559 - stable/15 - Merge commit cbf48349e3e1 from llvm-project (by Jessica Clarke): 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: bf61c2737559aad0f00c7e7a2e7c75b0c472979c Auto-Submitted: auto-generated Date: Thu, 06 Aug 2026 18:03:25 +0000 Message-Id: <6a74cc6d.32726.18607b62@gitrepo.freebsd.org> The branch stable/15 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=bf61c2737559aad0f00c7e7a2e7c75b0c472979c commit bf61c2737559aad0f00c7e7a2e7c75b0c472979c Author: Jessica Clarke AuthorDate: 2026-07-27 16:53:53 +0000 Commit: Jessica Clarke CommitDate: 2026-08-06 18:02:04 +0000 Merge commit cbf48349e3e1 from llvm-project (by Jessica Clarke): [NFC][ELF][PPC64] Pass address not offset to writePPC64LoadAndBranch (#212275) Every caller currently subtracts the TOC base in its argument, so move that into common code inside writePPC64LoadAndBranch. This will also allow a different computation to be used in some cases in a future commit. Note that offset is now unsigned not signed; even previously, all arguments were uint64_t, and all uses are unsigned, so making it signed doesn't make much sense. MFC after: 1 week (cherry picked from commit bcbcd7303009344dc1051e4601284620bca29be8) --- contrib/llvm-project/lld/ELF/Arch/PPC64.cpp | 3 +-- contrib/llvm-project/lld/ELF/Thunks.cpp | 20 +++++++++----------- contrib/llvm-project/lld/ELF/Thunks.h | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/contrib/llvm-project/lld/ELF/Arch/PPC64.cpp b/contrib/llvm-project/lld/ELF/Arch/PPC64.cpp index 3cd4a6294e2a..8e85cfab8a63 100644 --- a/contrib/llvm-project/lld/ELF/Arch/PPC64.cpp +++ b/contrib/llvm-project/lld/ELF/Arch/PPC64.cpp @@ -1168,8 +1168,7 @@ void PPC64::writePlt(uint8_t *buf, const Symbol &sym, void PPC64::writeIplt(uint8_t *buf, const Symbol &sym, uint64_t /*pltEntryAddr*/) const { - writePPC64LoadAndBranch(ctx, buf, - sym.getGotPltVA(ctx) - getPPC64TocBase(ctx)); + writePPC64LoadAndBranch(ctx, buf, sym.getGotPltVA(ctx)); } static std::pair toAddr16Rel(RelType type, uint64_t val) { diff --git a/contrib/llvm-project/lld/ELF/Thunks.cpp b/contrib/llvm-project/lld/ELF/Thunks.cpp index 65d0f094c43c..45b9ab9530e0 100644 --- a/contrib/llvm-project/lld/ELF/Thunks.cpp +++ b/contrib/llvm-project/lld/ELF/Thunks.cpp @@ -1402,7 +1402,8 @@ void PPC32LongThunk::writeTo(uint8_t *buf) { write32(ctx, buf + 4, 0x4e800420); // bctr } -void elf::writePPC64LoadAndBranch(Ctx &ctx, uint8_t *buf, int64_t offset) { +void elf::writePPC64LoadAndBranch(Ctx &ctx, uint8_t *buf, uint64_t addr) { + uint64_t offset = addr - getPPC64TocBase(ctx); uint16_t offHa = (offset + 0x8000) >> 16; uint16_t offLo = offset & 0xffff; @@ -1413,10 +1414,9 @@ void elf::writePPC64LoadAndBranch(Ctx &ctx, uint8_t *buf, int64_t offset) { } void PPC64PltCallStub::writeTo(uint8_t *buf) { - int64_t offset = destination.getGotPltVA(ctx) - getPPC64TocBase(ctx); // Save the TOC pointer to the save-slot reserved in the call frame. write32(ctx, buf + 0, 0xf8410018); // std r2,24(r1) - writePPC64LoadAndBranch(ctx, buf + 4, offset); + writePPC64LoadAndBranch(ctx, buf + 4, destination.getGotPltVA(ctx)); } void PPC64PltCallStub::addSymbols(ThunkSection &isec) { @@ -1456,10 +1456,9 @@ void PPC64R2SaveStub::writeTo(uint8_t *buf) { write32(ctx, buf + nextInstOffset + 4, BCTR); // bctr } else { ctx.in.ppc64LongBranchTarget->addEntry(&destination, addend); - const int64_t offsetFromTOC = - ctx.in.ppc64LongBranchTarget->getEntryVA(&destination, addend) - - getPPC64TocBase(ctx); - writePPC64LoadAndBranch(ctx, buf + 4, offsetFromTOC); + const uint64_t addr = + ctx.in.ppc64LongBranchTarget->getEntryVA(&destination, addend); + writePPC64LoadAndBranch(ctx, buf + 4, addr); } } @@ -1519,10 +1518,9 @@ bool PPC64R12SetupStub::isCompatibleWith(const InputSection &isec, } void PPC64LongBranchThunk::writeTo(uint8_t *buf) { - int64_t offset = - ctx.in.ppc64LongBranchTarget->getEntryVA(&destination, addend) - - getPPC64TocBase(ctx); - writePPC64LoadAndBranch(ctx, buf, offset); + uint64_t addr = + ctx.in.ppc64LongBranchTarget->getEntryVA(&destination, addend); + writePPC64LoadAndBranch(ctx, buf, addr); } void PPC64LongBranchThunk::addSymbols(ThunkSection &isec) { diff --git a/contrib/llvm-project/lld/ELF/Thunks.h b/contrib/llvm-project/lld/ELF/Thunks.h index 446345b8517f..a802827ba407 100644 --- a/contrib/llvm-project/lld/ELF/Thunks.h +++ b/contrib/llvm-project/lld/ELF/Thunks.h @@ -85,7 +85,7 @@ std::unique_ptr addLandingPadThunk(Ctx &, Symbol &s, int64_t a); void writePPC32PltCallStub(Ctx &, uint8_t *buf, uint64_t gotPltVA, const InputFile *file, int64_t addend); -void writePPC64LoadAndBranch(Ctx &, uint8_t *buf, int64_t offset); +void writePPC64LoadAndBranch(Ctx &, uint8_t *buf, uint64_t addr); } // namespace lld::elf