From nobody Mon Sep 16 19:56:56 2024 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+105250+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+105250+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684937172; cv=none; d=zohomail.com; s=zohoarc; b=FScnxuIOiSqrUelICIkT3CJrtjN633ATN74yESuQwSNhbTYw3MRg9QX1bioW/L2BdFlawGJmVkcxSCaRQUq8sTuViSZ6yXNO4OdMR/ZNXFvGGtEptDTKCACiLj4iPz0Bwq/Xb1G9QM9W8wu4YsydAAkR6UAEVxVPeCITDR8UX0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684937172; 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=ldCFrEsC1fnQ7dKSZG8Ft09NvFe6pjVY9UfOjwxsgoc=; b=jobPyBwZ9iquA9IValqaaUrkTD8YDwuUupq3AX2zmahGpfn8kGgAv8ZjL0aKkRD6o+UnF9UftkLGHMnByMRN8qKwTlFEAZNCoKGodC04JcEcczOSs87NZ4gqV4+thJP+m1rpGrU86gVyDVkY6uV5Q+5fu8qLaf1t9opxNtWZojU= 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+105250+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 1684937172170748.1663894767793; Wed, 24 May 2023 07:06:12 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fGR2YY1788612xa4YaRY34gH; Wed, 24 May 2023 07:06:11 -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.web11.9760.1684937170872561795 for ; Wed, 24 May 2023 07:06:11 -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-620-QoOq-Y75NIyVkNJT4lhHXw-1; Wed, 24 May 2023 10:06:06 -0400 X-MC-Unique: QoOq-Y75NIyVkNJT4lhHXw-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D31591C0ED1A; Wed, 24 May 2023 14:06:02 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0470D407DEC6; Wed, 24 May 2023 14:06:01 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 997F918011F8; Wed, 24 May 2023 16:06:00 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Daniel Schaefer , =?UTF-8?q?Marvin=20H=C3=A4user?= , Rebecca Cran , Oliver Steffen , Liming Gao , Pawel Polawski , Chao Li , Ard Biesheuvel , Bob Feng , Sunil V L , Michael D Kinney , Leif Lindholm , Dongyan Qian , Yuwei Chen , Baoqi Zhang , Zhiguang Liu , Gerd Hoffmann , Ard Biesheuvel Subject: [edk2-devel] [PATCH v6 01/11] BaseTools: make sure the got is empty Date: Wed, 24 May 2023 16:05:50 +0200 Message-Id: <20230524140600.1432056-2-kraxel@redhat.com> In-Reply-To: <20230524140600.1432056-1-kraxel@redhat.com> References: <20230524140600.1432056-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: ue8wnAmy4xXOeU77rJvDXEtUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684937171; bh=17rbeaKGZgZKnlbnS+kUSIl+6BVNoLaSE6LkT3dtTAE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=eQUOytHVQ/Xap6vq0WApi2+rCeluD14FQe9hElfACxmsqoDXEqOTeTDjDlKSu89+0oC 575dR6VYbh5hsjPMDFySrH5xiaGeLJ03ikqjP2dYyi7C+5NkmKxoCshHXEamBibGpzAG5 XRHuwwU/AUVy+MWQRCL19TjCuFt3dSbRMUE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684937173481100001 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 Reviewed-by: Liming Gao Reviewed-by: Rebecca Cran --- 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.1 -=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 (#105250): https://edk2.groups.io/g/devel/message/105250 Mute This Topic: https://groups.io/mt/99109295/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-