From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.56804.1680273715945101528 for ; Fri, 31 Mar 2023 07:41:56 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NAnM/9+5; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680273715; x=1711809715; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=m2Cra9/3SzIE4wtZsSR/Vu0+pzvhULLD62rjQiJ6jWs=; b=NAnM/9+5WmWKLS02Idodb97fYGzcAooo11gi55wXIiR6wmlxnYaD8gmP /+bb2pwstz8Gqm5LrG8yuJp4I+R9x+3WBuCbhBFFYmoX/t69Gg7MEuuFj kCoV/O5Pk9rXnb8DfxsObldNoeukRYB7rr7AdsBGcPELvnYM/L488GKPu o2mrsdbSeHeBCOqwjEIKJ1+IzpBScpwmyGpQh1cwYXTTyUCQiX/ljE4TA DIL7FBCFAbNoaNSLvmTq0mhJ7oQBO85+79MqSHg1V852EcSQy8f0OfnrG MxH75lMISQSAWGUteieF+p6OLpa2ECsF6WW3bbzVUDSh3MP9T3ps+WkAl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10666"; a="321119333" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="321119333" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2023 07:41:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10666"; a="685137479" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="685137479" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 31 Mar 2023 07:41:46 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 31 Mar 2023 07:41:46 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Fri, 31 Mar 2023 07:41:46 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Fri, 31 Mar 2023 07:41:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sz0FXXwVkV2GBafVqHx0Uwi4Csjkpk9RNl22Sa5RmGAC/Y65nh9f9pYnNwYmtvc03yTuvPf3fHptZhIxkf6UK7S+OXL9dx5Sz2+nq507YrelUupY8AX4/+rxWz3TM7Ts9/5ymNrDtQMrF/W/Yc/fohTNh3gYCsyulfVISfCAiwvgrL9FRSGrHmguHRNBnp7Y79Wc5lcMo6eAbYBM4JP82U0siugqWmMBQCem3kyBFtvEIvLQxHls6PN1pcTpgddzcvUcCpXeU9YO+0ypAolaFO5q5UEfOkKWRZnc7c+tlZkJlyb0cDFJ+lexZk6pRHuLO4Nu9X7jk+YV2UzRtwlABA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w6umGfEXtuMbCP8+qgDaVNpfBSGXDCnp3ch4c8sjSbo=; b=GQOl/JOrtwYOyvHXetRaRoU4b9alsokMu13iJ7Q7iVgL0JrYAy2cLMtfFmNwWefA8ClEPI3auvqlhGo9tTd7GY0COeNDvk6Gdk28YhIDadIdocBkkBR3k3dhTDwOOizoJs+OerEtcl7WOB2q1YN8PdgVt8dxmvg2JTL5EFJD/LrAcHkPnGAu14vDN31C8uVKfRtfAT1sckiB1PhjmyPqW8mYYZdIXUXH+ajdfNYgxK7650LMtQGpVOGHXTkoPJV+qniYlgHNT6xCiT7ulBDJ0Jc0mBWsVX/+9amgiEYBn7e0KUhLS8Ubkxdhi6d1c08s44cAc2quVEV3tO53fU/DYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by DS7PR11MB6248.namprd11.prod.outlook.com (2603:10b6:8:97::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.23; Fri, 31 Mar 2023 14:41:43 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::ae07:e96a:4a24:8a69%8]) with mapi id 15.20.6222.035; Fri, 31 Mar 2023 14:41:43 +0000 From: "Ni, Ray" To: "Rudolph, Patrick" CC: "devel@edk2.groups.io" , "Dong, Guo" , "Guo, Gua" , "Lu, James" , "mhaeuser@posteo.de" , "ardb@kernel.org" Subject: Re: [PATCH 2/3] BaseTools/Conf/tools_def: Fix CLANGDWARF_IA32_X64 Thread-Topic: [PATCH 2/3] BaseTools/Conf/tools_def: Fix CLANGDWARF_IA32_X64 Thread-Index: AQHZWNm+whPjmUY4rUGVTXThlP98768VC/ew Date: Fri, 31 Mar 2023 14:41:42 +0000 Message-ID: References: <20230317140627.1033739-1-patrick.rudolph@9elements.com> <20230317140627.1033739-2-patrick.rudolph@9elements.com> In-Reply-To: <20230317140627.1033739-2-patrick.rudolph@9elements.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|DS7PR11MB6248:EE_ x-ms-office365-filtering-correlation-id: 346337e7-73fd-4261-c92c-08db31f60ba6 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AHZ3CNCsznjxRylJpLuOynTHA2UMtzKweSbsmjT4HwNDAh6TkDTycpgMZ3uPwOJVgQd3GQYwBe1PCVZvUfBhfUIfrY36KiSqjrOuxAhn/fEg5+dGOpv8LRz/v3W42+GkRwIgCMzq6dpEW6hJ8NeUC0YRMavnT/BD6veTPCegWs+UfaSXsmOnZ2mtvavUJLD20m4/CwiUCFmIZkVfQz4dk1yfPLJOsCw/Q3cTn+BOoNQ5LNp118L7n7qwoIQi/0/Lf9yOuvTrkg80C5ZkG9Nnu99Rlg4BTQIOHpRoCebOE8LUKof5ZUz2Rwi831Ohc8zLLA+myFimDd/5HFLsw0lUM8zdmVQELQriwyJpmuSdnat9VILvUBFDU4T/T51Dbcuowb9kSOKKpb/VK7KX3rI19K3d98eYoUI0rnDcJB/lfW39EbSRb6oqShCjD4zCGM8+K8Y8PkDsQlQ7dtAQiZixbQiZHwoNxan7utmjc8lPlqfru6UO/KWq0mw8sUA+nH4Jmz14n3OEeflVkLBvCv19J67cU+lgwH6Ah1/vGfJJoV6tTnTAjnUXRcjoBDEcgTIAZD9kMI4sXbdVRpK+a/3efKcLpsn1+IfogrqA0LAvyl0= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(366004)(396003)(136003)(346002)(376002)(451199021)(55016003)(186003)(6506007)(8936002)(86362001)(38070700005)(5660300002)(9686003)(66556008)(54906003)(66476007)(66946007)(316002)(52536014)(83380400001)(26005)(76116006)(41300700001)(2906002)(82960400001)(33656002)(122000001)(7696005)(71200400001)(966005)(478600001)(64756008)(6916009)(38100700002)(66446008)(4326008)(8676002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?SmddFtvDDtHIGEAOzIhq6p0O1HTWUQcy5tScXc7RjfeGJUCVnpbHUi6Un3XK?= =?us-ascii?Q?Et5kPB4LQrJzccV3IDFh86g+OpFr1LVU0ppLT0dz4po0zd5Qjn7gG7v+Rtyr?= =?us-ascii?Q?NINsl1Wvk1XNlgmjWR/keRnmhARWcI0ythhxZt/OP/zv7FHS9P/RjijiyK/Q?= =?us-ascii?Q?tnjzMJsv24iOaDMD1VNgG8PTmCBRUJOuh0jJ/X7SEjcnFG5ki6gqUT7THTsU?= =?us-ascii?Q?FlR5TpbloiIwFrTsSFTORWosYDTQRNcvExarXECOWvDwznLebZ6Cl+jWl00n?= =?us-ascii?Q?pHnHrXm4GLPZe3Fm+qnmDGrQetMhxtdN3cUibmwk03THh+Z4ZxZvb3kudwgv?= =?us-ascii?Q?kjoUQjeP65EAIrgWriqkUQrZB55FxmfxtSvoO7efNvqeEopsxWMzDJJ67Ae3?= =?us-ascii?Q?vwNer1aif6nH/ei27f7A0iwUY1oKjg5Z2gUCnaZ0IFAIqjNQqQuoDCKBfYh3?= =?us-ascii?Q?MqT1gw16YCyjk0FTPDGjCBJHdGKCb5/ZMjHcr1duNtg++cqIlRxcePfNBtGE?= =?us-ascii?Q?0x/x7Vm3/s9mjrt0ut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R?= =?us-ascii?Q?YU3p1nbEsHJ4YOPl9lGQV434lI5Imw+RrDT2Hh7j8cBIXbPrDcHq0+eEdm7f?= =?us-ascii?Q?TiuFN+QAg23FfEP63jMQrL8pTBGFzrL1S03U6oZLBU/Olwzx021dk433wBHv?= =?us-ascii?Q?KY1BuHKfu4SWGVrTzjo=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 346337e7-73fd-4261-c92c-08db31f60ba6 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2023 14:41:42.9871 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AR12uC9UoKatpBy0BNCenE7WcNXkZVSf0KZK/aVBTi4PWVv+5EQg1JDyKSRi0jeMHoqy1YJEEYQP5d9SlxuA1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB6248 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Why ELF header overflows into .text section? > -----Original Message----- > From: Patrick Rudolph > Sent: Friday, March 17, 2023 10:06 PM > Cc: devel@edk2.groups.io; Dong, Guo ; Guo, Gua > ; Lu, James ; Ni, Ray > ; mhaeuser@posteo.de; ardb@kernel.org > Subject: [PATCH 2/3] BaseTools/Conf/tools_def: Fix > CLANGDWARF_IA32_X64 >=20 > Drop the "-z max-page-size=3D0x40" option as it causes the ELF > header to overflow into the .text section, causing undefined > behaviour. >=20 > With high optimization level it corrupts essential code and > the binary would crash. It might work with low optimization > level though. As the default is to use Oz and LTO, it always > crashes. >=20 > Test: > The ELF generated by > 'python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32' boots. >=20 > Signed-off-by: Patrick Rudolph > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4357 > --- > BaseTools/Conf/tools_def.template | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Conf/tools_def.template > b/BaseTools/Conf/tools_def.template > index 9b59bd75c3..0c584ab390 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -2866,7 +2866,7 @@ DEFINE CLANGDWARF_X64_PREFIX =3D > ENV(CLANG_BIN) >=20 >=20 > # LLVM/CLANG doesn't support -n link option. So, it can't share the same > IA32_X64_DLINK_COMMON flag. >=20 > # LLVM/CLANG doesn't support common page size. So, it can't share the > same GccBase.lds script. >=20 > -DEFINE CLANGDWARF_IA32_X64_DLINK_COMMON =3D -nostdlib -Wl,-q,--gc- > sections -z max-page-size=3D0x40 >=20 > +DEFINE CLANGDWARF_IA32_X64_DLINK_COMMON =3D -nostdlib -Wl,-q,-- > gc-sections >=20 > DEFINE CLANGDWARF_DLINK2_FLAGS_COMMON =3D -Wl,-- > script=3D$(EDK_TOOLS_PATH)/Scripts/ClangBase.lds >=20 > DEFINE CLANGDWARF_IA32_X64_ASLDLINK_FLAGS =3D > DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,-- > defsym=3DPECOFF_HEADER_SIZE=3D0 > DEF(CLANGDWARF_DLINK2_FLAGS_COMMON) -Wl,-- > entry,ReferenceAcpiTable -u ReferenceAcpiTable >=20 > DEFINE CLANGDWARF_IA32_X64_DLINK_FLAGS =3D > DEF(CLANGDWARF_IA32_X64_DLINK_COMMON) -Wl,-- > entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,- > Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive >=20 > -- > 2.39.1