From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2FA69202E617B for ; Wed, 25 Oct 2017 02:51:35 -0700 (PDT) Received: by mail-wm0-x243.google.com with SMTP id b9so768568wmh.0 for ; Wed, 25 Oct 2017 02:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=NMCMwx454SneQ5Qfradu9CLSE5dpGPSwqpJtmmXi77E=; b=RMWw3QaqC3udUMOb8anYA3P5UGY/rHrl5sIMMwy0OnXVWdXBmXqr9N5GGXSVygsgmr FaJzDZldW+hvedPD6+cuvKphu61RF81vEFHG5WTGcr8a+IQLAveApbTDKnBJ/r2JeM5h XuLFd4SBzeQE+b9NZDy3TuvflqUUPYGaArWdE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NMCMwx454SneQ5Qfradu9CLSE5dpGPSwqpJtmmXi77E=; b=EvrIuz52HIdixaV7LwlL1ohjIVYGcgz6Jx8sMDG46gwIxbol596LpQbJtVO9RfaHuq B4nOPgHimocsXq6H3ZVzRfHnyMjzJuTuP0HYrQDTQfCddH+IbgvXxL1wKO5CR1wuCnwj J+dWK4u9xAF/5IomPaS4kGVj2FHqmNbsKfJzYE2zmGpLPhkMvaqtgds3s+aXcwLCvwU1 nR3yY3/6n7DErllMYE5qlNuN1yjXqxYMrVu/MSUM2oBsMFQwtcrN/fwZyc6EPaeDqS97 x/n21f7I4hO+uygJOVq+7i7B21DN53QnPpnUtUemsLdMvmJMjy5Af4XGEOuze4rxK5G4 utSw== X-Gm-Message-State: AMCzsaXIUSnSLzjIoy2dCmGdirNV4txOYv0e1hHbtiYw7xrp9SB5XlZQ 5cb2VfjQM2sQs80hDxGACOTyPELhHU8= X-Google-Smtp-Source: ABhQp+RiuRUV8d4ipdOcc8yxxhW8f0ek3E0cEjh1sZmhgCUtoB4b8fqp7tw48Ve1af6NqsX61gkkdQ== X-Received: by 10.28.69.210 with SMTP id l79mr1212898wmi.117.1508925318920; Wed, 25 Oct 2017 02:55:18 -0700 (PDT) Received: from localhost.localdomain ([160.161.173.60]) by smtp.gmail.com with ESMTPSA id 91sm1927177wre.41.2017.10.25.02.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 02:55:18 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, liming.gao@intel.com, yonghong.zhu@intel.com, Ard Biesheuvel Date: Wed, 25 Oct 2017 10:55:11 +0100 Message-Id: <20171025095511.25751-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [PATCH] BaseTools/tools_def AARCH64: disable PIE linking X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Oct 2017 09:51:36 -0000 Some prebuilt GCC toolchains targeting aarch64 (e.g., the Debian Stretch one) will default to building PIE executables. This has been observed to corrupt ACPI tables built from .aslc sources, so disable PIE linking altogether when using the GCC toolchain to build for AARCH64. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- BaseTools/Conf/tools_def.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index e93c2a0bf1ef..16ef935f5ef9 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -4355,7 +4355,7 @@ DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccB DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u $(IMAGE_ENTRY_POINT) -Wl,-e,$(IMAGE_ENTRY_POINT),-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map DEFINE GCC_ARM_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z common-page-size=0x20 -DEFINE GCC_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z common-page-size=0x20 +DEFINE GCC_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) -z common-page-size=0x20 -no-pie DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEFINE GCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) -- 2.11.0