From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.7344.1622855993023396536 for ; Fri, 04 Jun 2021 18:19:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=fgP5ZDk/; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: ray.ni@intel.com) IronPort-SDR: FEoWfmb/h9oHq/4B3qjQK3ykDv8aV2dpQErzBFEmZBWtgVPJUr5Bj7raYSKcXqU94qNphQsmtm p0BRPFoTORvQ== X-IronPort-AV: E=McAfee;i="6200,9189,10005"; a="201376921" X-IronPort-AV: E=Sophos;i="5.83,249,1616482800"; d="scan'208";a="201376921" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2021 18:19:51 -0700 IronPort-SDR: qIgxte7a2AAXYtuJzptelY3sAX84cXGd+DjNJXPSjN2FzUGRL63UAaLp99j7+GJEJ7QoqPuJaF j0MGN3JfGEsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,249,1616482800"; d="scan'208";a="618434917" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga005.jf.intel.com with ESMTP; 04 Jun 2021 18:19:51 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 4 Jun 2021 18:19:50 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Fri, 4 Jun 2021 18:19:50 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Fri, 4 Jun 2021 18:19:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iFMXAj6ygR6CqtleZcjFFor2boTyU4gt8U7hWGMjSG5FzDmhaoOHZB8KzSokhnnk8X+2FZHHw3zq+vyadAfC1ob9epY2mVOgoPhkR/GWunY9kZ6sQW1JzJ6zCg17wRMCkZSLfI+msAlaEuSq9U0Ym8q09oKaMEo39ufRI8bcRTypwAo1jj6EqsM8NdAUam/cv6QQpMNFs0aBv7AT/v17UrYz2kn7YNq0aPgEGGOJcrE4V7PIUdacyiLuTLzANEJsbIH2eOuPDEAn0S+NbxEhQFHBWEBinJxYiLWTed13LpWPbJyHj9/wG6xjspNg/Bdr8Uf/KiA8ww2w7y3l0iLxWw== 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-SenderADCheck; bh=gO38Wj43L4f1qqNSA4mA4VXipCk9jQhNZKymanPAJXk=; b=UKa//drNqupmv5+jvTPr2mYBASiJQYYWkOVXRrnXcud/m6roIXISXBjSRDMEdz+0JLdFn0A2VntoIGGNV27wgAvko9/ad+Yp3ie4N+sKASLPbayqKyXwvfM0llGN1Pn0tMkKMlhc0SqTIGvjb7J19u15H52BjhCLB2lAITCzUidA+vj1zgtTmWCPlMe31CRuBETKwaqitkU3fnc6AX1N3vw5Teu5UaOUzVIV44O8p8p+rqblWzOfOGQ9UicZdpNP9hkga6IrrsxqCtoY8Mm5s53IjV4EpE7vZsUCnxFJwMkMSD/EYTs1RA69dq9QolGaOGBNf7iSRlf5Dy3vmbZkdw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gO38Wj43L4f1qqNSA4mA4VXipCk9jQhNZKymanPAJXk=; b=fgP5ZDk/WMsENQzVUN33C7ItL5tYxqbGDwHt+bplgTt1bq161iHbBfef94zwBlm/wUEhCyKSu2RmnW4KVmwE/EXJQbAq4fNvpRNa+K0TMvOvaabeAxGiG4eNAeBw0AA1EhYYzDHTvaCfT6N/vHPfRFgQoUrPBvQ+yhpz/tvsr0s= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by MW3PR11MB4521.namprd11.prod.outlook.com (2603:10b6:303:55::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Sat, 5 Jun 2021 01:19:49 +0000 Received: from CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::a439:f8ae:4699:718f]) by CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::a439:f8ae:4699:718f%6]) with mapi id 15.20.4195.024; Sat, 5 Jun 2021 01:19:49 +0000 From: "Ni, Ray" To: Leif Lindholm , "devel@edk2.groups.io" CC: Liming Gao , "Feng, Bob C" Subject: Re: [edk2-devel] [PATCH v2 2/6] BaseTools GenFw: Support CLANG8ELF with conversion ELF to PE/COFF image Thread-Topic: [edk2-devel] [PATCH v2 2/6] BaseTools GenFw: Support CLANG8ELF with conversion ELF to PE/COFF image Thread-Index: AQHXWUXptraZMLC3oUS4qrTuCjLZl6sEiinwgAAGC3A= Date: Sat, 5 Jun 2021 01:19:49 +0000 Message-ID: References: <20210602081145.265-1-ray.ni@intel.com> <20210602081145.265-3-ray.ni@intel.com> <20210604133124.knyesmliadsvvb5v@leviathan> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [124.77.195.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6e672bbd-35b6-41dd-8257-08d927c00362 x-ms-traffictypediagnostic: MW3PR11MB4521: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1360; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SMLf/gOls8N7a3rnIM3MrWDODX6i87tNf8egHDc0REiVmhiAmEi7M4saDNgqGi1tyitrAW3MKrI4Fjf4N1d5fBT1Wxb1/dO5/VweZohqS8ksOsudi1qGmM2MsCVFmLq3AaLcOiXXgXKWQtnEnTy8WPO+OpZyjrsBwMkfy36hZpHE4f3C9zwJ7IbwLCtjlGrMhhSoLCDFrKj6K/55ylbYCXSnkTQXUdqcaaQyhAqw7JThcU6TpDOkkowj2tM2sYfCG9yjyc/Y0ccUA/7N7ZxYs9mYxVWTM8cpH0hX3zren47ifDtyTk6k+JCV1I5HbxQzeRX/y2zfpCOtXXYXdBAIr+FwPSEuJimmwoBGmPbjEfRbyKWsCDQ1VfA2PwBWxEYoOAVI6iO+Gtv/2xSsxWSlVgYA1MG92ZZYS8x5ugqj6BATwKizdrcLDygvFdSwpTi8wrDJbidIUjeOCiFIUSRc2QgdOcp4duWWZyNYmU4QgX//HUoMvoPak5Pn5YFpPXQuONKCZ2Vme4SQxp19VBWo0AHZi1GQ6fCv9SQW1surpsRmH5vKfb3KkdzCxjynV3SXaFsTSrhzcxlBffAvgO1nH6QC3RD/CVvzsRF6UMq3AwgY9G9Zq/GQU3yzeUWMImadvYYz+7vKXVlnGG0GvGTJG4UtgJP8YI9DC/ga/jialkJhTWTKPE5h5gmbM4UZ/vovHHvtu1L731wnmNW3b7/aK1RkXleF4gdwyxl9SvVD4ByJBuwFiVOnNmBNytNUGVyQuZwXS1EYFPNzr+0RUyNro6sUSs9kx/pm6KWwwlcZDagCD4OsXXzDM48aaj/YhcqL x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4930.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(396003)(39860400002)(376002)(346002)(136003)(966005)(71200400001)(33656002)(4326008)(54906003)(83380400001)(478600001)(7696005)(110136005)(86362001)(8936002)(8676002)(6506007)(53546011)(52536014)(5660300002)(9686003)(64756008)(186003)(26005)(316002)(2940100002)(55016002)(38100700002)(122000001)(2906002)(19627235002)(66446008)(66556008)(66946007)(66476007)(76116006)(107886003)(32563001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?/3MFiq7bsA2qshHNqs5064R4tDiDEcQIHLpfTsre1U86IY18o7x2bU3XSQHi?= =?us-ascii?Q?691ANNxP3ksJodIlLT3hZbRJI/cliz9kdT1d88wNwdWUBKRk/tWUQsNk8fVO?= =?us-ascii?Q?x5FIU/izUT7N0psNt+4+F8G/Q30QaAlJY5BYdeIekgtk8vD5kNNOPLIJiJMO?= =?us-ascii?Q?cGw4tm/XwsVrvNwrKEtNSbWJ3/ucviD6w3lNb3ZBpuIaOtPYnwytMrKMs+Md?= =?us-ascii?Q?21FzXEn/zurXR6+uy5CiCP3TjjjTcEd2LMRrvjg8WvlWU5X/0AYCL8V+lRTG?= =?us-ascii?Q?u9fGNlmDwToMVR5l1H26/Qt5jzITz064KZOg7xrlnVlVhtSrFRhlBRd89FYz?= =?us-ascii?Q?o4Ai4F3eoOFaVX2kSE1pLTR0+rWPK6qFBthtCYCF4rwXZ6W275YsgHwRpqzF?= =?us-ascii?Q?EcVw8fihDge1qm1ifshX0cY/wYu4RmY6/DDJCFnmO7yhYK/sMucMF1+nqMUV?= =?us-ascii?Q?rrXipALYiN6lsBcPI2XJdk+NWFMs5bS9/3s511UMzJdp3JVeOnJYDFJfCdWv?= =?us-ascii?Q?fWvWMHxh1a9irPXHygJ8tXQNHrkx3M3JFzhkObzmvQ6Kd2av+OTm47YZ0jlx?= =?us-ascii?Q?IR2QtzREvJsMrUEEOZmzY+wKy1k9NG90PriUw1FQ+K/frDCRDewQuHeYE7bs?= =?us-ascii?Q?Si+roiAI8f+7+yRZKOMz30jyx3XwgLMTymdGWFVsagoHZgCGCuX/9BhpmBZ4?= =?us-ascii?Q?0NO3iJAjA6IiXC6/fYp8QZ5FQU1SR/Uj+8GlyE4eSkuhV4GfwS2XW05yy/Hw?= =?us-ascii?Q?diVaQr791+FxU7WUE9uchKxwIWz0/9YMrjWYqjTyTZuYPv5ut/n6p7G/HB0/?= =?us-ascii?Q?Tx38oP6rt/zCI5GgqDOaifGEMGAqG72Gmo9hOzCXNxBTSehjetqOp80uy+Js?= =?us-ascii?Q?7267TJn1h5CCpsSs05INjG8sIxAzspuwgFAWnyUjH0KXnXfTsHlAxTBciwop?= =?us-ascii?Q?O1FoZvo6PYxvgKSI82zR2ZUZ1JAO9u3QTz+3xVx+gjIh8bdsRKv7DOXOirCs?= =?us-ascii?Q?ybCrRxHt6xS51nL7lddhRcB6IQWKnlbMKTLQM3sFNgRY182UQRCaEW+LGxd8?= =?us-ascii?Q?8SA6DW78mW8np1BWpG+UBrrkxKJhWAC033B3C+UTTTWpAzxBeuSk8ai/ApO/?= =?us-ascii?Q?fWmt9P6edZF758nfkjLcrPT3tT3iyGhYIHBSoRRJkpGylDgQhaeZCgThPla9?= =?us-ascii?Q?UX1nA4etFLrk/WU3accyCgV1JlwiBI6yuxrQy5Te2pcG38nZQc79fYkzpa9p?= =?us-ascii?Q?eCk0DpE+5qZnMuVdM19yeQGn7uOa69k3NkVx9ZtkyKx7owvdZVUpeWUd/22f?= =?us-ascii?Q?JoyaeBcqyHT42v8HAR6Zr9sV?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4930.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e672bbd-35b6-41dd-8257-08d927c00362 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2021 01:19:49.0949 (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: ftQQidLPK2R+mpkTsDXXUiPtz8dZnTT5cMUy/kWyTMZuSn4fMWenl3XR8KEUqElsng+4E0g36ndIPDUeh+kUZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4521 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 Leif, OVMF Bhyve GCC build succeeds without GenFW assertion issue. I dumped the ELF image generated for OvmfPkg/Bhyve/AcpiTables/AcpiTables. Below output shows that .text does have "AX" set: --- $ readelf -S Hpet.dll ... [ 1] .text PROGBITS 0000000000000000 00000140 000000000000000c 0000000000000000 AX 0 0 64 --- It matches IsTextShdr() logic: return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) =3D=3D = (SHF_EXECINSTR | SHF_ALLOC)); Can you please check the .text attributes in your ARM build? ( I did try to build an ARM platform but failed with following errors: gcc: error: unrecognized command line option '-mcmodel=3Dsmall' I downloaded "arm-none-eabi-gcc" in Ubuntu: lrwxrwxrwx 1 root root 25 Jun 5 09:18 /usr/bin/gcc -> /usr/bin/arm-non-= eabi-gcc ) > -----Original Message----- > From: Ni, Ray > Sent: Saturday, June 5, 2021 8:07 AM > To: Leif Lindholm ; devel@edk2.groups.io > Cc: Liming Gao ; Feng, Bob C > Subject: RE: [edk2-devel] [PATCH v2 2/6] BaseTools GenFw: Support CLANG8= ELF with conversion ELF to PE/COFF image >=20 > Leif, > Sorry to hear that. It seems a CI gap that doesn't capture such errors. > It looks like the logic update to detect .text section doesn't work in y= our case. >=20 > I am trying to build the OVMF Bhyve because I saw it contains an AcpiTab= les module that has .aslc file. >=20 > Thanks, > Ray >=20 >=20 > > -----Original Message----- > > From: Leif Lindholm > > Sent: Friday, June 4, 2021 9:31 PM > > To: devel@edk2.groups.io; Ni, Ray > > Cc: Liming Gao ; Feng, Bob C > > Subject: Re: [edk2-devel] [PATCH v2 2/6] BaseTools GenFw: Support CLAN= G8ELF with conversion ELF to PE/COFF image > > > > Hi Ray, > > > > On Wed, Jun 02, 2021 at 16:11:41 +0800, Ni, Ray wrote: > > > From: Liming Gao > > > > > > CLANG8ELF tool chain generated ELF image with the different attribut= es > > > in section. Update GenFw to handle them. > > > 1. .text section with writable attribute (support) > > > 2. .reloc section has the symbol for *ABS* (skip) > > > > > > Signed-off-by: Liming Gao > > > Reviewed-by: Feng Bob C > > > > This commit breaks many of the ARM platforms. > > > > I end up seeing > > > > GenFw: Elf64Convert.c:719: ScanSections64: Assertion `FALSE' failed. > > > > when generating certain ACPI tables. > > > > Note: this applies to both GCC5 and CLANG38 - it is not isolated to > > CLANG8ELF. > > > > Reverting to commit c1aa3bab1259 makes these builds work again. > > > > / > > Leif > > > > > --- > > > BaseTools/Source/C/GenFw/Elf32Convert.c | 12 +++--------- > > > BaseTools/Source/C/GenFw/Elf64Convert.c | 5 +++-- > > > 2 files changed, 6 insertions(+), 11 deletions(-) > > > > > > diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c b/BaseTools/Sou= rce/C/GenFw/Elf32Convert.c > > > index 2485b2cb7a..7c8a065678 100644 > > > --- a/BaseTools/Source/C/GenFw/Elf32Convert.c > > > +++ b/BaseTools/Source/C/GenFw/Elf32Convert.c > > > @@ -238,7 +238,7 @@ IsTextShdr ( > > > Elf_Shdr *Shdr > > > ) > > > { > > > - return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D= =3D SHF_ALLOC); > > > + return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) = = =3D=3D (SHF_EXECINSTR | SHF_ALLOC)); > > > } > > > > > > STATIC > > > @@ -261,7 +261,7 @@ IsDataShdr ( > > > if (IsHiiRsrcShdr(Shdr)) { > > > return FALSE; > > > } > > > - return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D= =3D (SHF_ALLOC | SHF_WRITE); > > > + return (BOOLEAN) (Shdr->sh_flags & (SHF_EXECINSTR | SHF_WRITE | S= HF_ALLOC)) =3D=3D (SHF_ALLOC | SHF_WRITE); > > > } > > > > > > STATIC > > > @@ -749,13 +749,7 @@ WriteSections32 ( > > > if (SymName =3D=3D NULL) { > > > SymName =3D (const UINT8 *)""; > > > } > > > - > > > - Error (NULL, 0, 3000, "Invalid", > > > - "%s: Bad definition for symbol '%s'@%#x or unsuppo= rted symbol type. " > > > - "For example, absolute and undefined symbols are n= ot supported.", > > > - mInImageName, SymName, Sym->st_value); > > > - > > > - exit(EXIT_FAILURE); > > > + continue; > > > } > > > SymShdr =3D GetShdrByIndex(Sym->st_shndx); > > > > > > diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Sou= rce/C/GenFw/Elf64Convert.c > > > index d097db8632..8fe672e984 100644 > > > --- a/BaseTools/Source/C/GenFw/Elf64Convert.c > > > +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c > > > @@ -246,7 +246,7 @@ IsTextShdr ( > > > Elf_Shdr *Shdr > > > ) > > > { > > > - return (BOOLEAN) ((Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D= =3D SHF_ALLOC); > > > + return (BOOLEAN) ((Shdr->sh_flags & (SHF_EXECINSTR | SHF_ALLOC)) = = =3D=3D (SHF_EXECINSTR | SHF_ALLOC)); > > > } > > > > > > STATIC > > > @@ -269,7 +269,7 @@ IsDataShdr ( > > > if (IsHiiRsrcShdr(Shdr)) { > > > return FALSE; > > > } > > > - return (BOOLEAN) (Shdr->sh_flags & (SHF_WRITE | SHF_ALLOC)) =3D= =3D (SHF_ALLOC | SHF_WRITE); > > > + return (BOOLEAN) (Shdr->sh_flags & (SHF_EXECINSTR | SHF_WRITE | S= HF_ALLOC)) =3D=3D (SHF_ALLOC | SHF_WRITE); > > > } > > > > > > STATIC > > > @@ -1060,6 +1060,7 @@ WriteSections64 ( > > > > > > exit(EXIT_FAILURE); > > > } > > > + continue; > > > } > > > SymShdr =3D GetShdrByIndex(Sym->st_shndx); > > > > > > -- > > > 2.31.1.windows.1 > > > > > > > > > > > >=20 > > > > > >