From patchwork Fri Aug 11 02:53:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 800390 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-460213-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="xD0ayvRe"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xT8j312bYz9t3J for ; Fri, 11 Aug 2017 12:53:57 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=DzYfgP91hbS7fi18osV8nezEubn7A03uIRIr4TStrkTNsP2iU+ odx6kzn/lEebKHYP/DkQ0UofOhT7SOPGFHKS3972crUjhfCsVaS/TZn2osuI/Knx Gpm2nP4KD85AQY8ejxeyXtr6+G3zv9cXwuZY1f9mER6NNWMbM6wo2pYyI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=s7+OL73IM89zPtzmgcULlKbnNXw=; b=xD0ayvReTZtp6bMpVYAM FhCA9Jzlsadk3CJOaXfjE7tAHI9Cy76erISwPrfnroIiQyRHnES0gnujdWX3aUzy wYpaaYw3dDe8sq8sVA/rWMENZACbIu7pLCaJSysfYUAVBLL8halHYsdLzJFiwVTg eYOjWbv5OmFH5KxQmCXcn68= Received: (qmail 97786 invoked by alias); 11 Aug 2017 02:53:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 97768 invoked by uid 89); 11 Aug 2017 02:53:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2466 X-HELO: mail-pg0-f43.google.com Received: from mail-pg0-f43.google.com (HELO mail-pg0-f43.google.com) (74.125.83.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Aug 2017 02:53:33 +0000 Received: by mail-pg0-f43.google.com with SMTP id v77so10206215pgb.3 for ; Thu, 10 Aug 2017 19:53:33 -0700 (PDT) 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:mime-version :content-disposition:user-agent; bh=ag3AaNV7HjWWpnaUMz85vLr4TIAwzpN6ICVgfMEfu68=; b=Hst7rAeUxujr4YXEcgx68Ix1w+PGy6Ns3QGGvR/y65qDGG90VVjgVTT6v+CK3w59aU AjiAzRa+3Br4D5i9g6od29hepaSPV6W5/TwAL/byYSHEcj5LtIsZ3B8SS7K1oNVMRZaP ZCv0CVeiy0WqzlzLH1Ko4o1oF8uFghlMOqDgdPYizcv4VwJnLpY7mxrJQwk/sCfaWtER U5ucF75s++inc+uyv50Ua7whxdr2Y2rthGyK96XMr7boDHiN45y7/YLUGnxtw6G3vHqB RNKGLABgx5KE9qE6ekwunssQhOPW6W4P3Jj+ihoIleYI7SfPrClkRB33Un39jRwBtvxX 4HMg== X-Gm-Message-State: AHYfb5j6o5OXiavCmIvAYG6lZTXVyR+dH0ejFot4pioqkjqm2Ay23b6+ zbYxUjatrOApFkkl X-Received: by 10.84.149.139 with SMTP id m11mr15812559pla.376.1502420011886; Thu, 10 Aug 2017 19:53:31 -0700 (PDT) Received: from bubble.grove.modra.org (CPE-58-160-71-80.tyqh2.lon.bigpond.net.au. [58.160.71.80]) by smtp.gmail.com with ESMTPSA id o10sm8947861pgc.81.2017.08.10.19.53.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 19:53:30 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D7B39C04D2; Fri, 11 Aug 2017 12:23:26 +0930 (ACST) Date: Fri, 11 Aug 2017 12:23:26 +0930 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [RS6000] linux startfile/endfile Message-ID: <20170811025326.GL16312@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes These need to match the gnu-user.h definitions to support --enable-default-pie. Otherwise we end up linking the wrong startup files when defaulting to PIE. I've just copied the HAVE_LD_PIE variants as we don't need the !HAVE_LD_PIE variant. (In fact, gnu-user.h doesn't need them either.) Bootstrapped and regression tested powerpc64-linux and powerpc64le-linux. OK? PR target/81170 PR target/81295 * config/rs6000/sysv4.h (STARTFILE_LINUX_SPEC): Upgrade to match gnu-user.h startfile. (ENDFILE_LINUX_SPEC): Similarly. diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index de38629..cbee891 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -757,24 +757,34 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) #define CRTOFFLOADEND "" #endif -#ifdef HAVE_LD_PIE -#define STARTFILE_LINUX_SPEC "\ -%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ -%{mnewlib:ecrti.o%s;:crti.o%s} \ -%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \ -" CRTOFFLOADBEGIN -#else -#define STARTFILE_LINUX_SPEC "\ -%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \ -%{mnewlib:ecrti.o%s;:crti.o%s} \ -%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \ -" CRTOFFLOADBEGIN -#endif - -#define ENDFILE_LINUX_SPEC "\ -%{shared|pie:crtendS.o%s;:crtend.o%s} \ -%{mnewlib:ecrtn.o%s;:crtn.o%s} \ -" CRTOFFLOADEND +/* STARTFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_STARTFILE_SPEC + but with the mnewlib ecrti.o%s selection substituted for crti.o%s. */ +#define STARTFILE_LINUX_SPEC \ + "%{shared:; \ + pg|p|profile:gcrt1.o%s; \ + static:crt1.o%s; \ + " PIE_SPEC ":Scrt1.o%s; \ + :crt1.o%s} \ + %{mnewlib:ecrti.o%s;:crti.o%s} \ + %{static:crtbeginT.o%s; \ + shared|" PIE_SPEC ":crtbeginS.o%s; \ + :crtbegin.o%s} \ + %{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_start_preinit.o%s; \ + fvtable-verify=std:vtv_start.o%s} \ + " CRTOFFLOADBEGIN + +/* ENDFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_ENDFILE_SPEC + but with the mnewlib ecrtn.o%s selection substituted for crtn.o%s. */ +#define ENDFILE_LINUX_SPEC \ + "%{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_end_preinit.o%s; \ + fvtable-verify=std:vtv_end.o%s} \ + %{static:crtend.o%s; \ + shared|" PIE_SPEC ":crtendS.o%s; \ + :crtend.o%s} \ + %{mnewlib:ecrtn.o%s;:crtn.o%s} \ + " CRTOFFLOADEND #define LINK_START_LINUX_SPEC ""