From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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-pf1-x434.google.com with SMTP id x26so3709531pfo.8 for ; Thu, 25 Aug 2022 14:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=967zg/qPFUfJiMInw/AqYqPjD8QZoL0AqyYO1F3ChgU=; b=FOhoHre8C+cJeuanuCuCwXDgK/jlbhnYuap0K8X1SDGeGjQ3SxsAcFsvJH7R/VD7QH vQyvBu5RX6B+ym8E0lv3Vl5eLQaGVkaMeMGZSDvldChx2DCpGMay7EKuhMN7o4coCNFM +H2EyQ7AoUgSkD+Kd9SmiD9kZOXEON2Ol+b9B1YOP2mCOr4auCUkkASmBzsPF0tfiaN/ rIQfJqGOod4wC8+naOtOnDozAe3rGGUapmVltaapfZ5ud2KgU/b93HiL+dK1rC9+OZrV FmNO1PxZRH/wtO2yXS8wOyRZdHsENFHDP4DAdv8pVU7AKcyCgJVlgSxedOXpiM7bJyZI LMag== 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) From: Richard Henderson To: libc-alpha@sourceware.org Cc: carlos@redhat.com, fweimer@redhat.com 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 Content-Transfer-Encoding: 8bit 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 List-Id: [ 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 -- 2.34.1