From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web10.26774.1574355395155009097 for ; Thu, 21 Nov 2019 08:56:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=lD+NKDC7; spf=pass (domain: linaro.org, ip: 209.85.128.66, mailfrom: leif.lindholm@linaro.org) Received: by mail-wm1-f66.google.com with SMTP id x26so4245882wmk.4 for ; Thu, 21 Nov 2019 08:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yb1yM0NAU7T+Aogj2lAol9JGsOId6QspHmN0jxjlgPI=; b=lD+NKDC7JKmMqozyso7MFEK/Z4HyVT7LvmsIWi2H30iB7dK7c7fsg5ZttYRpt1yrYN +928uvO8s766wn/OsGw60owCQ8lptTXhZhWK7jrUMTazEStckoFuViVyeq/biJIjo+ne LSXRA0L6M42gch2lJzJ9dsNBuVfWK94UbgidH1Az+KP2u2Df5hQgwqSvw3bzCBabLYH0 O2bkvjawS5Z2U7Ut4KMmF9HAQmRG9uRq7DXYpLklLzkAvdrWZrMdfNnWUitkgl7adIyP ypnpL7vj3hWeM6iDYwRBkhxuNpjm4utV09sHGfw9zHKjuv0JK9ZiTvKoNAf+o6+ki+dn wLvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Yb1yM0NAU7T+Aogj2lAol9JGsOId6QspHmN0jxjlgPI=; b=T4oTWE0WiKaM2IZXYMIl2fPN7bnNAjC2qOzlZSBWbbdjScLwcPs0cfvHOTyw8rsJyL OMUTxI5Is6/IZUG1K242d8ek/q6HpfkPFhrQOCwh2vj0b7hrtH1LrOXaTFxXhnPfD8aX yOIamNkWDG1A7F7xLoBD5YqpoBKcU9ME8AL2az5SdJxRqleZn9TtDShOXlqGykZvFBfo KxF3aWP7RZO7Zocz9pZzoo8mPlqKkDBjJ9QK7amR7chhk7Vw4q3FyLS/tDkWNsWY3oci KXRfbICF6GDTxDu3T4f6jnS8kJCrzHlYbqwManx/KlJP9zGB1Vkv2zfDXgCGT+Z/2lBN FIsw== X-Gm-Message-State: APjAAAXnIn1qOAGUxmH8bhjgR58sP+6A8V5ZIyWCIIPe0ZXFY3pKjgR1 Cf/rsLzKwgXGJ4PRx/ye/eEGVg== X-Google-Smtp-Source: APXvYqwlYoOh819M5k2hk8XB6Y4xGskQdYmF+GZv6kEW3HK0O2HTUkgk+eQIzRhm9uTYTdqvBt8cOg== X-Received: by 2002:a1c:2e0f:: with SMTP id u15mr11173428wmu.47.1574355393610; Thu, 21 Nov 2019 08:56:33 -0800 (PST) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id r2sm211415wma.44.2019.11.21.08.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 08:56:32 -0800 (PST) Date: Thu, 21 Nov 2019 16:56:31 +0000 From: "Leif Lindholm" To: Abner Chang Cc: devel@edk2.groups.io, Bob Feng , Liming Gao , Gilbert Chen Subject: Re: [edk2-staging/RISC-V-V2 PATCH v3 25/39] BaseTools/Scripts Message-ID: <20191121165631.GN7359@bivouac.eciton.net> References: <1572227957-13169-1-git-send-email-abner.chang@hpe.com> <1572227957-13169-26-git-send-email-abner.chang@hpe.com> MIME-Version: 1.0 In-Reply-To: <1572227957-13169-26-git-send-email-abner.chang@hpe.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 28, 2019 at 09:59:03 +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. And it can go now, right? / Leif > Signed-off-by: Abner Chang > > Cc: Bob Feng > Cc: Liming Gao > Cc: Leif Lindholm > Cc: Gilbert Chen > --- > BaseTools/Scripts/GccBaseRiscV.lds | 79 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 79 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..91937aa > --- /dev/null > +++ b/BaseTools/Scripts/GccBaseRiscV.lds > @@ -0,0 +1,79 @@ > +/** @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. > + */ > + . = 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 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 CONST. > + * Unfortunately, we cannot pull it into the .text section entirely, 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 equal to the > + * alignment of the .text section. This ensures that the relative 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)) : { > + *(.rela .rela.*) > + } > + > + .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) { > + KEEP (*(.hii)) > + } > + > + /* > + * 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) } > + > + /DISCARD/ : { > + *(.note.GNU-stack) > + *(.gnu_debuglink) > + *(.interp) > + *(.dynsym) > + *(.dynstr) > + *(.dynamic) > + *(.hash .gnu.hash) > + *(.comment) > + *(COMMON) > + } > +} > -- > 2.7.4 >