From patchwork Thu Aug 25 21:01:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 1670385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=sCjz3JQF; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MDFkY42Rcz1ygw for ; Fri, 26 Aug 2022 07:01:25 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A0253851AA2 for ; Thu, 25 Aug 2022 21:01:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A0253851AA2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661461281; bh=967zg/qPFUfJiMInw/AqYqPjD8QZoL0AqyYO1F3ChgU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=sCjz3JQF+iq1JIzyd+L2NPaVbumBVVjID//a/+Pqqqg1AxHbfLyHMX9BwhVpuetYD XK2CZeBQxK7SZ5Rkymrf52VxisML2k8DUxJdxrPj5cwDcoqtqu0RzukVXuzu0ic/Cf mZ2F9MRO+uLU0rWgD+961vAGcOCej/Qgg82YdaSY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id D6D5A385F015 for ; Thu, 25 Aug 2022 21:01:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D6D5A385F015 Received: by mail-pf1-x434.google.com with SMTP id x26so3709531pfo.8 for ; Thu, 25 Aug 2022 14:01:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=967zg/qPFUfJiMInw/AqYqPjD8QZoL0AqyYO1F3ChgU=; b=7832dViiCYxOXSWIRPk+nqEdJp7Udpwx09IDPiNB1YV/JuNa5y3TqheUbfgba3aEaY 1g14xFjeWoLFc4DPNKVvz3d+fnbwbycgxdt8Pd6Z4DSv6XUxPXXr1m43p0F0bEsOyQh7 exeiJDy5EoCIEtrYjIvZb7zbU3v/63i3UYRP6VH919KxavZNLDtn2VwNszu72peu+h6F F7j0tzywGre2CU6AZI75ZslZyXtoTDONOvj1dZbcHU66ak2pdcHLX2aIruPfyPWvBkGx 3TY7vouO2xFO5q4W5xhOwKm7IJeDVu4Nn86eXxVeuzUXsORmhw+fGvot8Ena6sQ7uY/t QvQg== X-Gm-Message-State: ACgBeo2qjme6q/btLnDTMIUkTkbJr5dsKOaoInm6MSkvA0pt4P73ODht KRmRWh2hzZFzu5MPE2khsGuy9kjKsN+6aw== X-Google-Smtp-Source: AA6agR6U3GZLPa0IpurD5EpgYCbJYWvTBYpAM+k7O//sZDQ6ZDcKiYOPSeRXsgryiavrF/hnaCxjtw== X-Received: by 2002:a63:4c:0:b0:42b:2673:2180 with SMTP id 73-20020a63004c000000b0042b26732180mr706248pga.491.1661461264809; Thu, 25 Aug 2022 14:01:04 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:345c:4a6c:31b:1fca]) by smtp.gmail.com with ESMTPSA id d27-20020a634f1b000000b0042a59ecdbdfsm21256pgb.84.2022.08.25.14.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 14:01:04 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [RESEND PATCH] Makeconfig: Set pie-ccflag to -fPIE by default Date: Thu, 25 Aug 2022 14:01:03 -0700 Message-Id: <20220825210103.2259134-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Henderson via Libc-alpha From: Richard Henderson Reply-To: Richard Henderson Cc: fweimer@redhat.com Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" [ 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~ --- 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