From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::243; helo=mail-io0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::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 8F47B2034C085 for ; Wed, 25 Oct 2017 11:08:25 -0700 (PDT) Received: by mail-io0-x243.google.com with SMTP id 134so1971688ioo.0 for ; Wed, 25 Oct 2017 11:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Nr7tjuoSees0QZg9W6NhSVyvR4wDxn5hMf/nhPgWXw8=; b=Tu0eng8eL+dxgJ9bXPNDLZGpNRfDZThxitwe0rQlSJAKU92BmZXpQnfwWON5IAvHav 60dckHXR/7ogmwoiwxMx/3npP8Jk4uGttH5/rKvgiEM6y2aub7LXYBlnuZHBYKhRMjUJ adpeZKmK3JKI+pupHMD/hdJ40vTy3O4lS90C0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Nr7tjuoSees0QZg9W6NhSVyvR4wDxn5hMf/nhPgWXw8=; b=GYw9AbbaTlmi9RtAKUnejRQoR7xZ/evLAMZBz7/cSEZLPqg31e+8GSl6lKPOGyHdrW geC8hrmCHJn08Qs2D2MlF42tAb4yAMeIjn6+boV4ZHTO90BQbBrt9KFdaxVyFV47TccP cAohKqWlWr54Wn70qu8irGmMF67RQvPtGvKsHcUOWWHXa2UFFOAq4Du+KdPfhLLOJnmz wEijfgy6npZIHwRMEy3Mp3ocOnvkD0YC5usvfbFXzhlBGM8VcwxJyYT5qVtQgZ+7CXk9 OtWlOcoCQb1kJeXmBtTwf556dZ0KXHscKYCpxL9tY4Lnf/53sWKCZpX+eo60mEc/0JIL ruJQ== X-Gm-Message-State: AMCzsaXK0YcwiaJAhLsQbhr4RY6sVjlbYDtQVAcpPMRuTLfRTdGZ4JC9 mZuFVPQGiC5hFkmR3QaxGrJcsopAWFfSXUtNasgecA== X-Google-Smtp-Source: ABhQp+RLjDGCZy4kr/rjz2gxpce3XLAQIVRm9ggg0h2atxySCygl7ftMhLXEDy2n8zcOgK/iB8NgUY7Y1NbGIb4KPNo= X-Received: by 10.107.133.91 with SMTP id h88mr25903292iod.52.1508955130018; Wed, 25 Oct 2017 11:12:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Wed, 25 Oct 2017 11:12:09 -0700 (PDT) In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E170AEF@SHSMSX104.ccr.corp.intel.com> References: <20171025095511.25751-1-ard.biesheuvel@linaro.org> <4A89E2EF3DFEDB4C8BFDE51014F606A14E170AEF@SHSMSX104.ccr.corp.intel.com> From: Ard Biesheuvel Date: Wed, 25 Oct 2017 19:12:09 +0100 Message-ID: To: "Gao, Liming" Cc: "edk2-devel@lists.01.org" , "leif.lindholm@linaro.org" Subject: Re: [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 18:08:25 -0000 Content-Type: text/plain; charset="UTF-8" On 25 October 2017 at 15:41, Gao, Liming wrote: > Ard: > I see ARM and AARCH64 CC flag have -fno-pie. Does it work on the prebuilt GCC binary? Which pre-built GCC binary is that? > And, if this change is required, why not add it for ARM_DLINK? > It depends on whether the pie-by-default policy applies to any ARM toolchains, although we could simply add it to both once I confirm that GCC v4.6 (or whichever version of binutils that shipped with) does not choke on the -no-pie option. >> -----Original Message----- >> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] >> Sent: Wednesday, October 25, 2017 5:55 PM >> To: edk2-devel@lists.01.org >> Cc: leif.lindholm@linaro.org; Gao, Liming ; Zhu, Yonghong ; Ard Biesheuvel >> >> Subject: [PATCH] BaseTools/tools_def AARCH64: disable PIE linking >> >> 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 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel