From nobody Mon Feb 9 18:46:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60893+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60893+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1591637669; cv=none; d=zohomail.com; s=zohoarc; b=ke0r3YgR8aw/7lLKt1SK8LkrKXwejv5FwUMyGe/0rvXdDGq0nGA+lwZlhgh1fwWD1IwFETF9TkHpnF5girMKszWXRtd2mUEfPlcipngWedPeW0f19km1THofrm7iTd26N6szZSO72zQWcC7iiRwJ45XR+Nev06OXb9bOgcF3BRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591637669; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=deSxfnz0+DvK2QlOWurzZjKRqpf6SatWk/SvRE70G4w=; b=UtelERLyIQPpLp4WdreBguaywep8QoHf3QKWwf5oscBOgmf1gTxocqgN8Ac1468agtZ0ZfX/IX5ipDLmJs3tKcM+uSLDi0MTi7wBEMxjy4kdHHG7ynevSIyl4UqVbfJKInMWfyD+2BaZZeBad12Hhl55bKmEYsSB5E42lopEgTw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60893+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591637669242580.4695504868286; Mon, 8 Jun 2020 10:34:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VxHJYY1788612x1TvueZh3wF; Mon, 08 Jun 2020 10:34:28 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.145.1591637668433236023 for ; Mon, 08 Jun 2020 10:34:28 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1C8021FB; Mon, 8 Jun 2020 10:34:28 -0700 (PDT) X-Received: from localhost.localdomain (unknown [10.37.8.184]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 33B093F73D; Mon, 8 Jun 2020 10:34:26 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Bob Feng , Liming Gao , Laszlo Ersek , Leif Lindholm , Ilias Apalodimas , Julien Grall , Jiewen Yao Subject: [edk2-devel] [PATCH 2/4] BaseTools/Scripts/GccBase.lds: export image base symbol Date: Mon, 8 Jun 2020 19:34:11 +0200 Message-Id: <20200608173413.1100679-3-ard.biesheuvel@arm.com> In-Reply-To: <20200608173413.1100679-1-ard.biesheuvel@arm.com> References: <20200608173413.1100679-1-ard.biesheuvel@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@arm.com X-Gm-Message-State: QfewgbG1NCKbSjcZBkewCUIbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591637668; bh=7g1l4JJrWLqWHtZbx+xdCvnHJu4EjtACuWUgLTIZcB8=; h=Cc:Date:From:Reply-To:Subject:To; b=WzlqS1r+v1CORa2zuLFJKlP13sRJj767HtwVJbGJa6uUHMofzwKWrdL4GwR3odJ3rXZ 8Qx6XZcTIzvCLIoyySwFwWRVIAeVRlpNvgSe1Seoblh17zD7sHeRR5gs+Zpr3/KbjITlU mxTwpGY7NHrmxvFA97TlFC0T/zp5ZRZ15DQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" To help converted ELF images perform self-relocation, export a symbol 'ElfImageBase' that can be used in the code to discover the start of the image in memory. Note the use of PROVIDE() - this ensures that the symbol is only emitted if a reference to it exists in the code being linked, but no definition. This means the symbol is never emitted in a way that can conflict with existing code. Signed-off-by: Ard Biesheuvel Reviewed-by: Bob Feng --- BaseTools/Scripts/GccBase.lds | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds index a9dd2138d4b5..e73c1206a2e2 100644 --- a/BaseTools/Scripts/GccBase.lds +++ b/BaseTools/Scripts/GccBase.lds @@ -12,6 +12,8 @@ =20 SECTIONS { =20 + PROVIDE(ElfImageBase =3D .); + /* * The PE/COFF binary consists of DOS and PE/COFF headers, and a sequenc= e of * section headers adding up to PECOFF_HEADER_SIZE bytes (which differs --=20 2.26.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60893): https://edk2.groups.io/g/devel/message/60893 Mute This Topic: https://groups.io/mt/74757210/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-