From nobody Fri Dec 13 00:30:03 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 4Y8Vbc0P8Cz5gxTH; Fri, 13 Dec 2024 00:30:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y8Vbb6n8Gz4cwS; Fri, 13 Dec 2024 00:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734049804; 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=O3UD11Ke/dAoS4FOEnKf4++0B03LOiMkOiKrARs/5qo=; b=rgVQtzf4QQhLiJZy2eM1oOI0MIHZUwt+nYC4Vy4JIIeCyRmlCEvVwQYAqjaWCI+V8vwV8B o3WZaaPAaJKQEYyvwp4/T4Mhk7w8nnXPrnYPVEJuHJ60Y93ZUzuq0JQXKqoUe5qtv5Bm45 AWvECk+m9sIFbtBrTYf5vIyYiQ11ROP8FhJF6Uq92qMjMBToLZAkN/9fVTItivVv9wYGlc 82HloOuDJrczbFqbf8B9kHo84UKLNRbfZaqFODZj+oPBqSDlUqUomctynIdTWqUIpJvqVB Wjqnj6MfPF/Tmr28nmHSrsaK/Q5giq3mK6TKVSJSPXrLRN3wVeQBAKuGwtyEKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734049803; 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=O3UD11Ke/dAoS4FOEnKf4++0B03LOiMkOiKrARs/5qo=; b=ym/2pG60ELp6QkBvPNIzQp+WsRjOoXV3nZPsaKcpoaUdUQaNFyhla7C9k2MkX9xc/aGv5/ DCj305w6RCKRRmTThk+HdbEtJxxKytM5XJyBfIeCY9iQKykxn5zl8tpRVyWOLTxpD5+IpO WtJXRAypB2rz3TqVT3GnZtqrHdx0HV8Fh4hkeuWhbxBrREpqJUqLf5Oz0yEYYBIru3fKFU IBmH1efay3VXY/OAM6rNN75aamdIHNpqWhhKQfmGMyPM1G1Hid3xGySD4oETpN3lwDEJmW r92CygjmvcQKJ1HK5Sw+++xsCV8I0/DVQuroJpa1PPWXGj1fLE+d5GORukgeXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734049803; a=rsa-sha256; cv=none; b=j8BR9gNhSltAUQwvANPzjgBokixi0U2oOMbIwZQDcV95Ctd6tLTejxl4GWI+TRs9b8RBF2 lS7HjvN1G2LEFVjs8+kD2cTa9LIkVe0isjmSeGjVJI5jGphCi5eoi4YqmmLtcGMz4PrUfK S5ZNQ2Bb0JsFRwDVhbNmrEPvJpkdzJm905CMdQ2ZHxpmZ2KR0YE4FJZ9HfNunO+psk4C4C qPTFnOE+7B09X2wM5wbJCrWyBVerJg2w4Ak2NpiBXWf5A9nl1SNCrFz+aNLSOPTM+F3DcZ ti1KdVRUDmYY+x+6+BSOPV/vOHiwfNRSieSRlvzqZ7EoPtrOgm1tckVeaKSOOw== 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 4Y8Vbb6NKtzFgB; Fri, 13 Dec 2024 00:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BD0U3Uw089650; Fri, 13 Dec 2024 00:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BD0U3ru089645; Fri, 13 Dec 2024 00:30:03 GMT (envelope-from git) Date: Fri, 13 Dec 2024 00:30:03 GMT Message-Id: <202412130030.4BD0U3ru089645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: d4e02f74fe8d - stable/12 - rtld-elf: Fix for mips with LLD 14+ 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 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/12 X-Git-Reftype: branch X-Git-Commit: d4e02f74fe8de9acbb5370d66b5d507200f2ff42 Auto-Submitted: auto-generated The branch stable/12 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=d4e02f74fe8de9acbb5370d66b5d507200f2ff42 commit d4e02f74fe8de9acbb5370d66b5d507200f2ff42 Author: Jessica Clarke AuthorDate: 2024-12-13 00:18:33 +0000 Commit: Jessica Clarke CommitDate: 2024-12-13 00:29:50 +0000 rtld-elf: Fix for mips with LLD 14+ As of LLD 14, it no longer falls back to the address of .text if it can't find the entry point, and instead just uses address 0. Since the mips port has always used rtld_start as its entry point symbol but has never set RTLD_ENTRY to match (instead getting the default .rtld_start), with LLD 14+ it ends up using an entry point of 0, i.e. reinterpreting various headers and metadata sections as code, and thus quickly dies, in my case with SIGILL. This has seemingly always been a warning with LLD even when it defaulted to .text, but that went unnoticed this whole time, until now. Fix this by specifying the right symbol name. This is a direct commit to stable/13 as mips no longer exists in main. (cherry picked from commit d7bf409a63501a28357a9a9ec24628e1208d530d) --- libexec/rtld-elf/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index dfa6d4e6b85e..5604cb80a6e7 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -37,6 +37,8 @@ RTLD_ARCH= ${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR} .if ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -nostdlib -e _rtld_start +.elif ${MACHINE_CPUARCH} == "mips" +LDFLAGS+= -nostdlib -e rtld_start .else LDFLAGS+= -nostdlib -e .rtld_start .endif