From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.654.1571121091475754152 for ; Mon, 14 Oct 2019 23:31:31 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=019184da0c=abner.chang@hpe.com) Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9F6QfU1021604; Tue, 15 Oct 2019 06:31:30 GMT Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0a-002e3701.pphosted.com with ESMTP id 2vn5d82v0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Oct 2019 06:31:30 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5008.houston.hpe.com (Postfix) with ESMTPS id 4553E66; Tue, 15 Oct 2019 06:31:29 +0000 (UTC) Received: from G9W8674.americas.hpqcorp.net (16.220.49.0) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 06:31:07 +0000 Received: from G4W10205.americas.hpqcorp.net (2002:10cf:520f::10cf:520f) by G9W8674.americas.hpqcorp.net (2002:10dc:3100::10dc:3100) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 06:31:07 +0000 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (15.241.52.12) by G4W10205.americas.hpqcorp.net (16.207.82.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 15 Oct 2019 06:31:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DEuAlb+TOdyDO8g/Kid+ztRI6luKcmMVGTAxeNduRvW3L+I+LlQiBCYb+FPciKpHelwUonNbtsagsRJIvbf71G7zgyfQjy4oHXA70t+xyiVmWoGNBroOb6YjpU1O+/SOqzCOrX/AtNKiod9KKCEukr+saJ63XS3V4s8VnwqlCHIp/Iuf/eN56OfYeCWDQPWuPkf4Zy/g8T7LW2XsxeFmBCrRtXEGZs0lp1Xek/rGApWgbM75fObwYN9HpNxN6AqRA5PEsn7c7Vfd64sHEgITG9OXBWheVFw8/UCTx7mLBd33O+RumqhGiTHJ7pxr1RQkQGVDSczv2PlUxnXk0qdZmg== 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=rOGu47H8M3ATK/aRCzGcUWNhPdbr1LqcT4M8kxi6xOg=; b=I8Ae3/deEAAC880JF5ocGDxjvArqkmay3Kps5nX5r5E3PE9BThaP14+Y/YRI9StqrzrADSIfcXEJdPdNvXuV72d5qYSQy5JDKS0u2Tm909j1x5NqgCMV7046kYZ3yT39nPnWXMr3VWteNWKK6bvP/m9O3Uqe/PQa6X8XVJ+SbBJyoWA/0GSx6UTjgCDujnq227QV0AObCz192pLmV3IxkhTMu0W0iY5/7S4aedxmgk5jLSw8zMRNQanvNvw7B8HIYSn6TGkleIVxYiWdGprdSWTmbcPvVVQrQBpYLAoGWwRDNn1HmYocxwb+GAN8IsUIdk82qHObO+NyQ2EDfgrEUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM (10.169.12.151) by CS1PR8401MB0839.NAMPRD84.PROD.OUTLOOK.COM (10.169.14.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.21; Tue, 15 Oct 2019 06:31:06 +0000 Received: from CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4fb:84b9:76e6:1cde]) by CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM ([fe80::4fb:84b9:76e6:1cde%8]) with mapi id 15.20.2347.023; Tue, 15 Oct 2019 06:31:06 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "leif.lindholm@linaro.org" Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 25/29] BaseTools/Scripts Thread-Topic: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 25/29] BaseTools/Scripts Thread-Index: AQHVcaqwvqnqwtXLzUmP87HpsbOORqc+dMcAgBzrlVA= Date: Tue, 15 Oct 2019 06:31:06 +0000 Message-ID: References: <1569198715-31552-1-git-send-email-abner.chang@hpe.com> <1569198715-31552-27-git-send-email-abner.chang@hpe.com> <20190926205040.GU28454@bivouac.eciton.net> In-Reply-To: <20190926205040.GU28454@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.242.247.131] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b53089aa-201c-4e0c-4730-08d751394273 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: CS1PR8401MB0839: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 01917B1794 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(39860400002)(396003)(376002)(366004)(346002)(189003)(199004)(13464003)(74316002)(6246003)(71200400001)(7696005)(66946007)(33656002)(76176011)(71190400001)(86362001)(76116006)(9686003)(6116002)(66476007)(3846002)(256004)(66556008)(8936002)(14454004)(55016002)(25786009)(8676002)(7736002)(6306002)(81156014)(81166006)(14444005)(305945005)(66446008)(64756008)(99286004)(6436002)(186003)(2501003)(26005)(229853002)(966005)(5660300002)(11346002)(66066001)(476003)(446003)(486006)(478600001)(316002)(2906002)(102836004)(6506007)(110136005)(53546011)(19627235002)(52536014);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR8401MB0839;H:CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k/PDfMuiFgSQR9HeWrc6sYi7f/L4IVrZuqKPpBzfdhfQKtlRJkKu1H45y0y0BbsM3tq6B+l1NVa1LmwOGHasRo/1UxN+Qo7Pc2ATHBAocfNK/c9RfnbidV/Uc2yXXixLZEYOuxM0JEOLNlcN+/1Yqjz/p00eELqALZ8up/9uPT0KrL6GxuFTSSX6TWhch0HSH0mLNySMFo36AueJEaBD6lxqrWlzBwHkgV6C27kbALxgVNkEr4eadSuq47cQmIjz/HuQE9Uf+PYae+qlXlaSqWyLhhS7+hUEYIcpQK3IDZ8caZTgZGlqgkVkDL+YRP1lntaNST6dkOF2hLuuzLV3YYwzr4cm9R0nlBkb0y39wbhdSdOIMQ5p/xkElcc2FUprCEMQE7uIEZMK+zLq3zNczVXHXsyFivtEdgpVNck+6+q2LvFMfmxkmQTKCLmwh2MpLmLa7LBoI8xsQmdYq65f6A== x-ms-exchange-transport-forked: True X-MS-Exchange-CrossTenant-Network-Message-Id: b53089aa-201c-4e0c-4730-08d751394273 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2019 06:31:06.4112 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SoFhN8wnpqLftyuZixYGCh3A0UfT30qmWZ4e8EVhNUp+nN5EA85ugVfCn2V3s08xzXyhevZ2XOdeQJBuN6+F7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0839 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-15_03:2019-10-11,2019-10-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910150057 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Leif Lindholm > Sent: Friday, September 27, 2019 4:51 AM > To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) > > Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 25/29] > BaseTools/Scripts >=20 > On Mon, Sep 23, 2019 at 08:31:51AM +0800, Abner Chang wrote: > > Add RISC-V specific LD scripts. ."rela(INFO)" in the latest > > GccBase.lds causes PE32 relocation error. > > This is the temporaty solution untill we find the root casue. >=20 > I presume you mean that having a separate version for RISCV is temporary= ? I > am OK with this for now. However, the diff is not what I would expect. C= an > you verify that the difference is only what you actually need? Yes. Hope I can remove this change after I figuring out the toolchain issu= e. >=20 > For example: >=20 > > Signed-off-by: Abner Chang > > --- > > BaseTools/Scripts/GccBaseRiscV.lds | 66 > > ++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 66 insertions(+) > > create mode 100644 BaseTools/Scripts/GccBaseRiscV.lds > > > > diff --git a/BaseTools/Scripts/GccBaseRiscV.lds > > b/BaseTools/Scripts/GccBaseRiscV.lds > > new file mode 100644 > > index 0000000..7f9fae6 > > --- /dev/null > > +++ b/BaseTools/Scripts/GccBaseRiscV.lds > > @@ -0,0 +1,66 @@ > > +/** @file > > + > > + Unified linker script for GCC based builds > > + > > + Copyright (c) 2010 - 2015, Intel Corporation. All rights > > + reserved.
Copyright (c) 2015, Linaro Ltd. All rights > > + reserved.
Copyright (c) 2019, Hewlett Packard Enterprise > > + Development LP. All rights reserved.
> > + > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > +**/ > > + > > +SECTIONS { > > + > > + /* > > + * The PE/COFF binary consists of DOS and PE/COFF headers, and a > sequence of > > + * section headers adding up to PECOFF_HEADER_SIZE bytes (which > differs > > + * between 32-bit and 64-bit builds). The actual start of the .text= section > > + * will be rounded up based on its actual alignment. > > + */ > > + . =3D PECOFF_HEADER_SIZE; > > + > > + .text : ALIGN(CONSTANT(COMMONPAGESIZE)) { > > + *(.text .text.* .stub .gnu.linkonce.t.*) > > + *(.rodata .rodata.* .gnu.linkonce.r.*) > > + *(.got .got.*) > > + > > + /* > > + * The contents of AutoGen.c files are constant from the POV of t= he > program, > > + * but most of its contents end up in .data or .bss by default si= nce few of > > + * the variable definitions that get emitted are declared as CONS= T. > > + */ >=20 > The above comment block looks completely different - in GccBase.lds: > /* > * The contents of AutoGen.c files are mostly constant from the POV= of > the > * program, but most of it ends up in .data or .bss by default sinc= e few of > * the variable definitions that get emitted are declared as CONST. > * Unfortunately, we cannot pull it into the .text section entirely= , since > * patchable PCDs are also emitted here, but we can at least move a= ll of > the > * emitted GUIDs here. > */ >=20 > > + *:AutoGen.obj(.data.g*Guid) > > + } > > + > > + /* > > + * The alignment of the .data section should be less than or equal = to the > > + * alignment of the .text section. This ensures that the relative o= ffset > > + * between these sections is the same in the ELF and the PE/COFF > versions of > > + * this binary. > > + */ > > + .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) > { > > + *(.data .data.* .gnu.linkonce.d.*) > > + *(.bss .bss.*) > > + } > > + > > + .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) : { > > + KEEP (*(.eh_frame)) > > + } > > + > > + .rela ALIGN(CONSTANT(COMMONPAGESIZE)) : { >=20 > The above line is, I believe, the only necessary change for your workaro= und? Yes. only this line is necessary. I guess I copied entire lds file from my= old edk2 tree. >=20 > > + *(.rela .rela.*) > > + } > > + >=20 > The original one as the following: > .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) { > KEEP (*(.hii)) > } >=20 > I do not think including this could be the cause of any issues. >=20 > Also, GccBase.lds includes here: > /* > * Retain the GNU build id but in a non-allocatable section so GenFw > * does not copy it into the PE/COFF image. > */ > .build-id (INFO) : { *(.note.gnu.build-id) } >=20 > > + /DISCARD/ : { > > + *(.note.GNU-stack) > > + *(.gnu_debuglink) > > + *(.interp) > > + *(.dynsym) > > + *(.dynstr) > > + *(.dynamic) > > + *(.hash) >=20 > In GccBase.lds: > *(.hash .gnu.hash) >=20 > / > Leif >=20 > > + *(.comment) > > + *(COMMON) > > + } > > +} > > -- > > 2.7.4 > > > > > > > > >=20 >=20