From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web09.10181.1622621530599330979 for ; Wed, 02 Jun 2021 01:12:10 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) IronPort-SDR: C7OcXFztGAoCoxRpt39H7TmUvwp3xY3a80z5+wnbr0WJY6+sAygW815/RbEKgw1EL5/H8CLoE7 e4VUrJqDa1sA== X-IronPort-AV: E=McAfee;i="6200,9189,10002"; a="267609205" X-IronPort-AV: E=Sophos;i="5.83,241,1616482800"; d="scan'208";a="267609205" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 01:12:09 -0700 IronPort-SDR: N9Bm1eEc8IJIKPMaAssC1TZPM2kSTciVnwEgioxaCIw/G6KikJJ+lxmDTkxZsbicDM1nvcbTZz aXbFZodiChYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,241,1616482800"; d="scan'208";a="479617431" Received: from ray-dev.ccr.corp.intel.com ([10.239.158.87]) by orsmga001.jf.intel.com with ESMTP; 02 Jun 2021 01:12:08 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Liming Gao , Feng Bob C Subject: [PATCH v2 1/6] BaseTools: Add ClangBase.lds for CLANG8 tool chain with max-page-size Date: Wed, 2 Jun 2021 16:11:40 +0800 Message-Id: <20210602081145.265-2-ray.ni@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: <20210602081145.265-1-ray.ni@intel.com> References: <20210602081145.265-1-ray.ni@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Liming Gao LLVM LLD linker doesn't support common-page-size option. So, max-page-size is used. To not impact GCC tool chain, new ClangBase.lds is added. Signed-off-by: Liming Gao Reviewed-by: Feng Bob C --- BaseTools/Scripts/ClangBase.lds | 79 +++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 BaseTools/Scripts/ClangBase.lds diff --git a/BaseTools/Scripts/ClangBase.lds b/BaseTools/Scripts/ClangBase.= lds new file mode 100644 index 0000000000..8abd54aee6 --- /dev/null +++ b/BaseTools/Scripts/ClangBase.lds @@ -0,0 +1,79 @@ +/** @file=0D +=0D + Unified linker script for GCC based builds=0D +=0D + Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2015, Linaro Ltd. All rights reserved.
=0D + (C) Copyright 2016 Hewlett Packard Enterprise Development LP
=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +SECTIONS {=0D +=0D + /*=0D + * The PE/COFF binary consists of DOS and PE/COFF headers, and a sequenc= e of=0D + * section headers adding up to PECOFF_HEADER_SIZE bytes (which differs= =0D + * between 32-bit and 64-bit builds). The actual start of the .text sect= ion=0D + * will be rounded up based on its actual alignment.=0D + */=0D + . =3D PECOFF_HEADER_SIZE;=0D +=0D + .text : ALIGN(CONSTANT(MAXPAGESIZE)) {=0D + *(.text .text.* .stub .gnu.linkonce.t.*)=0D + *(.rodata .rodata.* .gnu.linkonce.r.*)=0D + *(.got .got.*)=0D +=0D + /*=0D + * The contents of AutoGen.c files are mostly constant from the POV of= the=0D + * program, but most of it ends up in .data or .bss by default since f= ew of=0D + * the variable definitions that get emitted are declared as CONST.=0D + * Unfortunately, we cannot pull it into the .text section entirely, s= ince=0D + * patchable PCDs are also emitted here, but we can at least move all = of the=0D + * emitted GUIDs here.=0D + */=0D + *:AutoGen.obj(.data.g*Guid)=0D + }=0D +=0D + /*=0D + * The alignment of the .data section should be less than or equal to th= e=0D + * alignment of the .text section. This ensures that the relative offset= =0D + * between these sections is the same in the ELF and the PE/COFF version= s of=0D + * this binary.=0D + */=0D + .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(MAXPAGESIZE)) {=0D + *(.data .data.* .gnu.linkonce.d.*)=0D + *(.bss .bss.*)=0D + }=0D +=0D + .eh_frame ALIGN(CONSTANT(MAXPAGESIZE)) : {=0D + KEEP (*(.eh_frame))=0D + }=0D +=0D + .rela (INFO) : {=0D + *(.rela .rela.*)=0D + }=0D +=0D + .hii : ALIGN(CONSTANT(MAXPAGESIZE)) {=0D + KEEP (*(.hii))=0D + }=0D +=0D + /*=0D + * Retain the GNU build id but in a non-allocatable section so GenFw=0D + * does not copy it into the PE/COFF image.=0D + */=0D + .build-id (INFO) : { *(.note.gnu.build-id) }=0D +=0D + /DISCARD/ : {=0D + *(.note.GNU-stack)=0D + *(.gnu_debuglink)=0D + *(.interp)=0D + *(.dynsym)=0D + *(.dynstr)=0D + *(.dynamic)=0D + *(.hash .gnu.hash)=0D + *(.comment)=0D + *(COMMON)=0D + }=0D +}=0D --=20 2.31.1.windows.1