From nobody Mon Feb 9 14:02:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+103345+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103345+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682052347; cv=none; d=zohomail.com; s=zohoarc; b=SpijB5RTepARdQthD9AADJeK3IqVUzH5I/fUVkS+B7pLQlkJHMx8Vu06Q/tfnpYhaieXtkqAjNo2fgl9Z5DdL4jIVDNAXhQscbmbpVG8R+zofpjH1trkRePScTNzAwkLYCCSXIqsPnxnwMbib88JBGXt0yDc9KhrrgwgFGlm854= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682052347; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gcvzbBLITRpeCBUBYGcZrsLlXOdLjGgnkLDx1AhF8Tw=; b=TfE0GyuS5fvj5I6+5uq5A7dE+cc6JMN42p81F3c3uNc7PXBBSNXDry0TM2O9DE2cgZrLIcLnZRxge14XL0JEPMuF1NpJnnJadjgdLX6QU7LroKnvSVyFFaFx6OtepseAPKhxxfQ0+fw3eq39j62Sr/Sesr2ELiYBMbW/oqv8xdw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103345+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1682052347225276.37057790387644; Thu, 20 Apr 2023 21:45:47 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vgsrYY1788612xNL7MV2P9Zr; Thu, 20 Apr 2023 21:45:46 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.4754.1682052346233233357 for ; Thu, 20 Apr 2023 21:45:46 -0700 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-662-3aatJEutOByRouuTwaHICQ-1; Fri, 21 Apr 2023 00:45:38 -0400 X-MC-Unique: 3aatJEutOByRouuTwaHICQ-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BEF93C0E239; Fri, 21 Apr 2023 04:45:37 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 995BA63A5D; Fri, 21 Apr 2023 04:45:36 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 606161800084; Fri, 21 Apr 2023 06:45:35 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Yuwei Chen , Oliver Steffen , Bob Feng , =?UTF-8?q?Marvin=20H=C3=A4user?= , Daniel Schaefer , Chao Li , Dongyan Qian , Michael D Kinney , Pawel Polawski , Baoqi Zhang , Leif Lindholm , Rebecca Cran , Zhiguang Liu , Sunil V L , Ard Biesheuvel , Liming Gao , Gerd Hoffmann , Ard Biesheuvel Subject: [edk2-devel] [PATCH v5 01/10] BaseTools: make sure the got is empty Date: Fri, 21 Apr 2023 06:45:26 +0200 Message-Id: <20230421044535.4030762-2-kraxel@redhat.com> In-Reply-To: <20230421044535.4030762-1-kraxel@redhat.com> References: <20230421044535.4030762-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,kraxel@redhat.com X-Gm-Message-State: FcnM5X3CdKtDfgHYOFIEO1mlx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1682052346; bh=HkkIorM/Rq1jeE7I4z5l8EEGL09VgSoO5q4LhwOUSnE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=EnkfZpyUNs9aY/umH/qaK+6DYxSjn8lplBqwucTxXsfqG4es4EUDwEm8Sqtit9aHr2e uFN1j9MiH9RgAQLLseVm+VxDbrTLAwDnCWkRnxuOdXE+NO/R8HvKvIrRETw4+O8uA7+4i VZien63wu0viV5eWwpoZIAitrmuEdxO4Ahw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1682052349039100017 Content-Type: text/plain; charset="utf-8"; x-default="true" Add ASSERT()s that .got and .got.plt sections are empty to linker scripts for gcc and clang. Suggested-by: Ard Biesheuvel Signed-off-by: Gerd Hoffmann --- BaseTools/Scripts/ClangBase.lds | 10 ++++++++++ BaseTools/Scripts/GccBase.lds | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/BaseTools/Scripts/ClangBase.lds b/BaseTools/Scripts/ClangBase.= lds index 61452ddd9506..c7dcd2024ac8 100644 --- a/BaseTools/Scripts/ClangBase.lds +++ b/BaseTools/Scripts/ClangBase.lds @@ -59,6 +59,16 @@ SECTIONS { KEEP (*(.hii)) } =20 + .got : { + *(.got) + } + ASSERT(SIZEOF(.got) =3D=3D 0, "Unexpected GOT entries detected!") + + .got.plt (INFO) : { + *(.got.plt) + } + ASSERT(SIZEOF(.got.plt) =3D=3D 0 || SIZEOF(.got.plt) =3D=3D 0xc || SIZEO= F(.got.plt) =3D=3D 0x18, "Unexpected GOT/PLT entries detected!") + /* * Retain the GNU build id but in a non-allocatable section so GenFw * does not copy it into the PE/COFF image. diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds index 83cebd29d599..9f27e83bb0fc 100644 --- a/BaseTools/Scripts/GccBase.lds +++ b/BaseTools/Scripts/GccBase.lds @@ -59,6 +59,16 @@ SECTIONS { KEEP (*(.hii)) } =20 + .got : { + *(.got) + } + ASSERT(SIZEOF(.got) =3D=3D 0, "Unexpected GOT entries detected!") + + .got.plt (INFO) : { + *(.got.plt) + } + ASSERT(SIZEOF(.got.plt) =3D=3D 0 || SIZEOF(.got.plt) =3D=3D 0xc || SIZEO= F(.got.plt) =3D=3D 0x18, "Unexpected GOT/PLT entries detected!") + /* * Retain the GNU build id but in a non-allocatable section so GenFw * does not copy it into the PE/COFF image. --=20 2.40.0 -=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 (#103345): https://edk2.groups.io/g/devel/message/103345 Mute This Topic: https://groups.io/mt/98404598/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-