From nobody Mon Jul 15 12:38:20 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 4WN1vc5yl7z5Qrh0; Mon, 15 Jul 2024 12:38:20 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WN1vc3K0kz4HZ4; Mon, 15 Jul 2024 12:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047100; 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=/pv1YCOxvhs1NnL/t05cKNMGn1PIGhsnYN38RtACeQI=; b=iyNqjSVdOJhs9seZRyG57nIC6Rfln3ZEd9kJV1aykHlCKgmRyrFow0AHfMebcjEiD4JBE7 76obTtRINDbxxzYzEPSCxI0lNnmAizAKoUzY9bivgrcMQ71XcPhJncLErlWoIRYERldbIu 7WJZyMPC+f16Gjv7PVtzZ10WyA4GfaTC+t7duBgbkbIsDiKIIcmmKSzCbjPmRkq4YkbrpG Cj9/nBT9uaH3/9oWYymmlo/MWR9P3w4DHAvOcEmUugjgNWdjLOin5hTG4qBw8exEP8gkZW SNj7bltFqbsO1bUmv2ootIWAXvCdAQ9oFDVFDvbQEAo3b2TxxYcqmBavSR1I3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047100; a=rsa-sha256; cv=none; b=wVttVBkmn0nE4we5SnGXXjIG7V6RWUoHhvRkwxLakalntV94x1Uy+T4nMQrEZhamGaKH+L icfwr83ydHSnIfPa5mW65bL/kswizswmPoNRN9TwNv3kx1fP+dqAPT6XCFyHfIIkuMF6Df jEj2Ng10LrZHLC2Dl6e+TixiY93jwAIVKSeSM7XGqMjYvuPDpQTqX9GNO2rvhhrlVrC04H BB4g5qwHqIwi54SiXw76cK4dTFjaFp1daA1rAqo25XrQciUPszOxChxIwdR+Xp2OypCprD rz/ado0v5KD0ROtwYKC2K6DBiU/C9Z2kBqjj4/PCWnBh1k/UFL0yAfgYoNkk2Q== 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=1721047100; 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=/pv1YCOxvhs1NnL/t05cKNMGn1PIGhsnYN38RtACeQI=; b=Ve1/rgXC3K2vvHCXDAnelHwNvj/fe6DiCxxKUElJTkxhY/ibc6+2BewUdyqBR/5xwKY+vR eqMHed3aelf8Lq4crcaTE6SsdB8ay4J6pcO23G0tQYou/AzwYNaWtDSCXvz2iy/Zc3gV8B z/AB1/lZB6MkQrlBpyUazMuBzgtRpyE4Nu0rqgBjTW5DX+SKKpRglNlINn1kM42K2Omn/O PoSdTB3prW8aq2HOdXqSsw0fhVMw7tDkBuJaGbZVrxplPtjtQI4KJAzTu17/182fSqfcdt 0vYSc0oYPt933vb9dLb6GOQCUwdOwTkXkYRpb0XYL7hpeJiIlVwhdMixpze6FQ== 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 4WN1vc2wqmzt5h; Mon, 15 Jul 2024 12:38:20 +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 46FCcKdn060843; Mon, 15 Jul 2024 12:38:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCcK0A060840; Mon, 15 Jul 2024 12:38:20 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:20 GMT Message-Id: <202407151238.46FCcK0A060840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 71f04a360965 - stable/14 - csu: Find the main pointer through the GOT 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 71f04a3609655a1b9cfb28d45e2f5bf41dcb4e67 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=71f04a3609655a1b9cfb28d45e2f5bf41dcb4e67 commit 71f04a3609655a1b9cfb28d45e2f5bf41dcb4e67 Author: Andrew Turner AuthorDate: 2024-05-22 08:18:10 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:26:22 +0000 csu: Find the main pointer through the GOT Use the Global Offset Table to find the location of main in crt1. With lld the old code would point to main@plt, however ld.bfd fails to link when main is in a shared library. Fix this by using the GOT address to find main as it works with both lld and bfd. Reviewed by: jrtc27 Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45259 (cherry picked from commit 53120fbb68952b7d620c2c0e1cf05c5017fc1b27) --- lib/csu/aarch64/crt1_s.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/csu/aarch64/crt1_s.S b/lib/csu/aarch64/crt1_s.S index 981cf4653efd..1fb60f756a7a 100644 --- a/lib/csu/aarch64/crt1_s.S +++ b/lib/csu/aarch64/crt1_s.S @@ -44,8 +44,8 @@ ENTRY(_start) add x2, x1, x0, lsl #3 /* env is after argv */ add x2, x2, #8 /* argv is null terminated */ #ifdef PIC - adrp x4, main - add x4, x4, :lo12:main + adrp x4, :got:main + ldr x4, [x4, :got_lo12:main] #else ldr x4, =main #endif