From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.1931.1571137443116984248 for ; Tue, 15 Oct 2019 04:04:03 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=019184da0c=abner.chang@hpe.com) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9FB1d1c000817; Tue, 15 Oct 2019 11:04:01 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 2vn8d6ceqt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Oct 2019 11:04:01 +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 g4t3426.houston.hpe.com (Postfix) with ESMTPS id 687B54F; Tue, 15 Oct 2019 11:04:00 +0000 (UTC) Received: from G4W9327.americas.hpqcorp.net (16.208.32.97) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 11:04:00 +0000 Received: from G1W8106.americas.hpqcorp.net (16.193.72.61) by G4W9327.americas.hpqcorp.net (16.208.32.97) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 15 Oct 2019 11:03:59 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (15.241.52.12) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 15 Oct 2019 11:03:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTbX2KD1UDnvtRI33iaur40LmT7bTvtcYLR+nu0DVt48+HxRzfAqDWibDy399uVC5EiQ7hc3SbcJQxcIOXB8ttx0DM0fp7nThkR4ejjihop+1IXcCH4LCsfWUXv9Sz30sxs7WM/qFEMM4dAwnxlairsOAmTgMHYLkGLiNpz1YyXxx9n7wgKg7ncTp9MHKtCZ1A9GxO0F3MJv/AdTxn8PjAxfkNDlZsenJeroerogDc1P5qVvIBvCEznUcWOTLhHati+VM2z0DI0uEk9AhsBr1AvEC8FKhLOuYhvXWyXVTjZofleDqO6dDC30vC84sz9Ks9kfOaTBPvvoav4tVXX0fQ== 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=iVIRv5vrzdEu86Mqy8ZSOoYOq51RhrBTPSotk59xLAc=; b=FvV2Y4Df4Cc6FF4N01vtLEBTZ7CPrkrzV5UxfxT+r0xcVU6G2mNSJpPuTDOY4izbvKKlyi1Fv6TwspmP9Gx6xkVdRT/1Mt7vUv1K5xFtR9BNmBYnOqhXBgMJdrQC3a1SPtWyio53n47RJYyiqnXqqRMb2ZYudRnA7gID05CV5qhOuT3RS6Mpaou01Qon6UiM2WmRkigC7OdCTd+AmCHn8eCuMrxDDUFg/yse+Wh4VGd00DvqoDvHoagOETuTEpp+kVlOeksYX5zYukmefMa3mYF7X4jusPRJMlN4bPxAH4QKkh2iZRG1dj0cyTdTwgtVfmRyEQwwSCzv6oeJiILPhg== 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 CS1PR8401MB0375.NAMPRD84.PROD.OUTLOOK.COM (10.169.97.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.19; Tue, 15 Oct 2019 11:03:58 +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 11:03:58 +0000 From: "Abner Chang" To: Leif Lindholm CC: "devel@edk2.groups.io" 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+dMcAgBzrlVCAAEu5gIAAAPMw Date: Tue, 15 Oct 2019 11:03:58 +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> <20191015110009.GL25504@bivouac.eciton.net> In-Reply-To: <20191015110009.GL25504@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: 4309cefc-2aa2-4afb-8a83-08d7515f60e2 x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: CS1PR8401MB0375: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 01917B1794 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(346002)(136003)(39860400002)(396003)(199004)(189003)(13464003)(229853002)(6246003)(53546011)(486006)(478600001)(476003)(9686003)(55016002)(6506007)(25786009)(6436002)(5660300002)(316002)(86362001)(446003)(2906002)(6116002)(11346002)(3846002)(6916009)(81156014)(14454004)(66946007)(76116006)(8676002)(8936002)(33656002)(19627235002)(14444005)(66476007)(64756008)(66556008)(66446008)(256004)(7736002)(74316002)(99286004)(305945005)(76176011)(102836004)(7696005)(52536014)(81166006)(26005)(186003)(4326008)(66066001)(71200400001)(71190400001);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR8401MB0375;H:CS1PR8401MB1192.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: jItpUZ063ZMcB0lq7ieylE1KMEplqv62XZ2NCxm1+nOpsJOMbA7Nza3rcZKnfhjbgSRGlWqNEId7XmYpPP8BTz0Da1ImP3ydwm9oRatXeEN3HuuWiPc2NlYxXCCwmk4IW7hS7XWtm+Qu8o//+xX4d2ax01hipL8x9vAn/gwVhzsnFM51WjFo8JCXm0aYr1O7vojpeNFUBCr1KHLDKrmRjpa6KhKRJOjykJAkaM/cnWTt2E4PcME0Fi/jLUoF7sHW2MiuSfIp0atfG/S47JfQXyR5n7xy+buYOjW4bXLt2hzQ/Vj0SDIS8EyJy1a6iIGRFghQap2G8QDsO0aL1F3CTsN7nIF4jWBrj0liRNgUOo3a/6e4gFyOXQHAMMf+7R34iurJL1tyubZ6Gv1uvZ5D7BlU7YHQWvwQdWQjvWfCo78= x-ms-exchange-transport-forked: True X-MS-Exchange-CrossTenant-Network-Message-Id: 4309cefc-2aa2-4afb-8a83-08d7515f60e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2019 11:03:58.4227 (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: HwIM3mFgqxpvJQuIIKrXXGzBBhxmQteoTMkIqHRpdEsaZ53oZpXeSYxBGJc11zNBqKU43hexfiUB2/UA9fpUJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0375 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_05:2019-10-15,2019-10-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1910150102 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > Sent: Tuesday, October 15, 2019 7:00 PM > To: Chang, Abner (HPS SW/FW Technologist) > Cc: devel@edk2.groups.io > Subject: Re: [edk2-devel] [edk2-staging/RISC-V-V2 PATCH v2 25/29] > BaseTools/Scripts >=20 > On Tue, Oct 15, 2019 at 06:31:06AM +0000, Chang, Abner (HPS SW/FW > Technologist) wrote: > > > -----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 > > > > > > 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. > > > > > > 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. Can you verify that the difference is only what you > actually need? > > > > Yes. Hope I can remove this change after I figuring out the toolchain = issue. > > > > > For example: > > > > > > > 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 the > > > program, > > > > + * but most of its contents end up in .data or .bss by defaul= t since > few of > > > > + * the variable definitions that get emitted are declared as = CONST. > > > > + */ > > > > > > 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 = since few > of > > > * the variable definitions that get emitted are declared as CO= NST. > > > * Unfortunately, we cannot pull it into the .text section enti= rely, since > > > * patchable PCDs are also emitted here, but we can at least > > > move all of the > > > * emitted GUIDs here. > > > */ > > > > > > > + *:AutoGen.obj(.data.g*Guid) > > > > + } > > > > + > > > > + /* > > > > + * The alignment of the .data section should be less than or eq= ual to > the > > > > + * alignment of the .text section. This ensures that the relati= ve offset > > > > + * 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)) : { > > > > > > The above line is, I believe, the only necessary change for your > workaround? > > > > Yes. only this line is necessary. I guess I copied entire lds file fro= m my old > edk2 tree. >=20 > Yeah, that makes sense. > If you can provide an updated version based on the current common .lds, = I'm > OK for that to go into the -staging branch. It will be in the v3. >=20 > / > Leif >=20 > > > > > > > + *(.rela .rela.*) > > > > + } > > > > + > > > > > > The original one as the following: > > > .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) { > > > KEEP (*(.hii)) > > > } > > > > > > I do not think including this could be the cause of any issues. > > > > > > Also, GccBase.lds includes here: > > > /* > > > * Retain the GNU build id but in a non-allocatable section so Gen= Fw > > > * does not copy it into the PE/COFF image. > > > */ > > > .build-id (INFO) : { *(.note.gnu.build-id) } > > > > > > > + /DISCARD/ : { > > > > + *(.note.GNU-stack) > > > > + *(.gnu_debuglink) > > > > + *(.interp) > > > > + *(.dynsym) > > > > + *(.dynstr) > > > > + *(.dynamic) > > > > + *(.hash) > > > > > > In GccBase.lds: > > > *(.hash .gnu.hash) > > > > > > / > > > Leif > > > > > > > + *(.comment) > > > > + *(COMMON) > > > > + } > > > > +} > > > > -- > > > > 2.7.4 > > > > > > > > > > > > > > > > > > > > > >=20 > >