From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) by sourceware.org (Postfix) with ESMTPS id B13203858C74 for ; Fri, 26 Aug 2022 12:32:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B13203858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oo1-xc30.google.com with SMTP id d63-20020a4a5242000000b0044880019622so249620oob.13 for ; Fri, 26 Aug 2022 05:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc; bh=bIFSV94rGQcaCIycya3qeqY1SYCbRbCw3u+35yEzIZY=; b=Jg1Nbpky23KIOMqxBqTULj1wRxma8RFRL84YtNqvEaeD/dzPARDLDErBk4oUcjW3EX 5PnduIBbTp2M8IIObCph14Ibf2rtiwH1lJLw8p5CY9YrwC2J6D7f2ohUeDOGRjIA2do5 rYFAp+lN6J0bmLEWxq5Lmt/amP5jC92PIkXf5ny7OruVnJ4gA6XpsvDpiD6l4HtXanS2 wluGf/k9hyaquOs8fTc7NLiXVmPhaZzP9i1EFu6AjtmoZ9c4GFnMCVNCvalN/GZW+NnD Ca6U95+Bp3xTtF3FGJ+MczYlBGAsFkTdjCTZ+OqYiJh/wdaJNL5IIyvyj5u7f5RhKMw0 ET1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc; bh=bIFSV94rGQcaCIycya3qeqY1SYCbRbCw3u+35yEzIZY=; b=fj7XkvZxUe47SvWMhoJd2U4e0YM6AaGJoQjtSYj3txoxpMeJ2g5+oxFFuL/5uEsUYG WVTvR17RaNTfxQk+zKBvNj+jZ1FnT58ztJTVYNmIM4RQUxbciWaKtnTACSJm9v0IXdKT L5Gi1uwk6v8VDaxPasExxciIfPpkxdF/+jjErjOv/cRwKxzsJzBrmff/s2Dt0eaTfAuX hUNObaUsGEnYu95hDND2OgNlEUBRzQf+O+LNWEBkM+xXywplxUTAoWppynaB+pL2GmJf EyI1+SUSeKSV1PPiK3IdWsM7ZVgg6v+8gOdHpj9McvIajYTt1Iz6HygdEfrPbxQ+qeDA 8/Sg== X-Gm-Message-State: ACgBeo0TWAV1qHXcufgBGyvHYp94i4bBCKZ7jO4ZlsHSfch5TUeRJUWg S0F8AgxuAGX6MxNPesrSiGRBCw== X-Google-Smtp-Source: AA6agR6Lkd0dGQbAlsgicXeFF0nY2EDtM81WnvuCvG48wbQdDnEhf/nwjrAQU7Ic/ePZWmxUntkIRA== X-Received: by 2002:a4a:334f:0:b0:44b:460b:9a27 with SMTP id q76-20020a4a334f000000b0044b460b9a27mr1145725ooq.46.1661517166830; Fri, 26 Aug 2022 05:32:46 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:745e:29d4:72eb:77d8:14cb? ([2804:1b3:a7c0:745e:29d4:72eb:77d8:14cb]) by smtp.gmail.com with ESMTPSA id j26-20020a4adf5a000000b00441b98453d8sm1018749oou.8.2022.08.26.05.32.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Aug 2022 05:32:46 -0700 (PDT) Message-ID: <43f24a1f-6237-2f45-ec0e-2fea9367f0b3@linaro.org> Date: Fri, 26 Aug 2022 09:32:44 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [RESEND PATCH] Makeconfig: Set pie-ccflag to -fPIE by default Content-Language: en-US To: Richard Henderson , libc-alpha@sourceware.org Cc: fweimer@redhat.com References: <20220825210103.2259134-1-richard.henderson@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20220825210103.2259134-1-richard.henderson@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 25/08/22 18:01, Richard Henderson via Libc-alpha wrote: > [ I never saw this arrive in the list archives. > Trying again with my linaro address subscribed. ] > > We should default to the larger code model, in order to support > larger applications built with -static -pie. This should be > consistent with pic-ccflag, which defaults to -fPIC. > > Remove the now redundant override from sysdeps/sparc/Makefile. > Note that -fno-pie and -fno-PIE have the same effect. > > --- > > In the case of AArch64, the code changes are small but significant: > > 0000000000000000 <__libc_init_first>: > 0: a9bd7bfd stp x29, x30, [sp, #-48]! > - 4: 90000003 adrp x3, 0 <_GLOBAL_OFFSET_TABLE_> > - 4: R_AARCH64_ADR_PREL_PG_HI21 _GLOBAL_OFFSET_TABLE_ > + 4: 90000003 adrp x3, 0 <__environ> > + 4: R_AARCH64_ADR_GOT_PAGE __environ > 8: 90000004 adrp x4, 0 <__libc_init_first> > 8: R_AARCH64_ADR_PREL_PG_HI21 .bss > c: 910003fd mov x29, sp > 10: f9400063 ldr x3, [x3] > - 10: R_AARCH64_LD64_GOTPAGE_LO15 __environ > + 10: R_AARCH64_LD64_GOT_LO12_NC __environ > > In the small model, we are constrained to 15 bits of GOT, with a > single shared base, _GLOBAL_OFFSET_TABLE_. In the large model, > each symbol has a page + offset pair. For small functions like > this, where there are no other variable references to share the > common GOT pointer, there is no actual code change. > > r~ I recall that powerpc wanted to use -mcmodel=large, but it would require to adjust a lot of assembly implementations. Are we sure this change does not trigger any regression with current glibc code? > --- > Makeconfig | 2 +- > sysdeps/sparc/Makefile | 3 --- > 2 files changed, 1 insertion(+), 4 deletions(-) > > diff --git a/Makeconfig b/Makeconfig > index e78cf220af..f8164a0025 100644 > --- a/Makeconfig > +++ b/Makeconfig > @@ -1052,7 +1052,7 @@ pic-ccflag = -fPIC > PIC-ccflag = -fPIC > endif > # This can be changed by a sysdep makefile > -pie-ccflag = -fpie > +pie-ccflag = -fPIE > no-pie-ccflag = -fno-pie > # This one should always stay like this unless there is a very good reason. > PIE-ccflag = -fPIE > diff --git a/sysdeps/sparc/Makefile b/sysdeps/sparc/Makefile > index 12c2c1b085..26b4a84606 100644 > --- a/sysdeps/sparc/Makefile > +++ b/sysdeps/sparc/Makefile > @@ -1,9 +1,6 @@ > # The Sparc `long double' is a distinct type we support. > long-double-fcts = yes > > -pie-ccflag = -fPIE > -no-pie-ccflag = -fno-PIE > - > ifeq ($(subdir),gmon) > sysdep_routines += sparc-mcount > endif