From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.39160.1680211277964705588 for ; Thu, 30 Mar 2023 14:21:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ETX1gUnm; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 717F56219F; Thu, 30 Mar 2023 21:21:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 187A1C4339E; Thu, 30 Mar 2023 21:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680211276; bh=BrrNgU7ihofvTl1YZozTwPJFPe2orGQR/R/j8aiiquY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ETX1gUnm8TMkada20YzvNhlNr722+kmja98MiITSeU+IoPU0YJtTa1p9jAJM2HiDj dXcmtnLv/LReBooLOhch+/7NBZN2JdopTXlwvu2kmTKSPpNidK4kiLRCQ8MKHojOxc Gai5vM9uDMvHdu3rEQO79HrJ35LRiIQhD+3CTSIVHbo+Qd6k8joucpx4JGruX/abar gkzZqD1OeGn68deeNkBOSomUOGnlsmWgKT5fseydgk5M4ZSZLK9DYBtoLSh6/PdxOB 0qcEUtnGncF4tN+LMWQcPuwQOrFRS+VdKtA0IVLL1CQfrB6WnitRhDYxjvVTtq5b6J 2AG/LXH8mn0uA== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Ni, Ray , Andrew Fish , "Kinney, Michael D" , "Liu, Zhiguang" , Rebecca Cran , Tom Lendacky Subject: [RFT PATCH v2 1/6] BaseTools/tools_def XCODE: Link X64 with -read_only_relocs suppress Date: Thu, 30 Mar 2023 23:20:56 +0200 Message-Id: <20230330212101.1566931-2-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230330212101.1566931-1-ardb@kernel.org> References: <20230330212101.1566931-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Earlier XCODE versions did not support the -read_only_relocs suppress linker option, which suppresses errors resulting from absolute relocations emitted into read-only sections when building PIE executables. This requires a rather messy workaround in the CPU exception handler libraries, to permit absolute relocations in code that may get copied from a template in some cases. Fortunately, this seems to be permitted now, so add the option for X64 as well (it was already present for IA32). This will allows us to simplify the CPU exception handler libraries in subsequent patches. Signed-off-by: Ard Biesheuvel --- BaseTools/Conf/tools_def.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate index ae43101853870c6d..1855f1038b1571e4 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -3010,9 +3010,9 @@ RELEASE_XCODE5_IA32_CC_FLAGS =3D -arch i386 -c -= Os -Wall -Werror -inclu ##################=0D # X64 definitions=0D ##################=0D - DEBUG_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D - NOOPT_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D -RELEASE_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map=0D + DEBUG_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(B= ASE_NAME).map=0D + NOOPT_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(B= ASE_NAME).map=0D +RELEASE_XCODE5_X64_DLINK_FLAGS =3D -arch x86_64 -u _$(IMAGE_ENTRY_POI= NT) -e _$(IMAGE_ENTRY_POINT) -preload -segalign 0x20 -pie -all_load -dead_= strip -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(B= ASE_NAME).map=0D =0D *_XCODE5_X64_SLINK_FLAGS =3D -static -o=0D DEBUG_XCODE5_X64_ASM_FLAGS =3D -arch x86_64 -g=0D --=20 2.39.2