From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id BEB453857BB2 for ; Tue, 24 May 2022 21:58:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BEB453857BB2 Received: by mail-pl1-x62a.google.com with SMTP id n18so16980987plg.5 for ; Tue, 24 May 2022 14:58:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ym7/P5bBNpKy/Alpn1AyVHDFKnCxor+7N3FN12dsY+I=; b=KhvoPKMXSZDvV8Onh/oKsv269g6cZrPsuOYx+zDfIi75TVI+x6pdGGJ4GJiD9mMjCE UNMrflsX8Xtm3tNFNQrC101wIQ9I7eP8Hbi/viNBSJIB4jqmJcBg6QZIcl90Snq50kkL JwxUOwfAI4lIdO2Ry9r7URo35VX70Hxq0aIH0TRB3nmQemrOuDgTVjjEfaHTZRecVZry 1aj9eaMEl+1LaYHf1V001TZpw+zbwEI7ABsqqZ9vfQtasLtPfq3bpaMN3KBE4dH0XW2V fSTqsvVvvj4Hl9qqUUSIonQjTnMxgTWWSsOJec6v95sVmKNxwb5X9seScp6cM2AWiu62 CuZA== X-Gm-Message-State: AOAM533VVuwY18w7csDtSSNs/8ljNZPd8rFaTT6Nib0VKhOry7CAr1LM 4xYhJUyTfAokA8krcPDaJN+H4WiydKEDfqgKFQkvvMuroVk= X-Google-Smtp-Source: ABdhPJxqEoklcrCPPVuyPmlXzGTKGpWS0qRJ6ZNdFUDKUIoHvdzue60KN2K9FVDJBY+LAmvUkzT7e84/W1ypi6yQbLA= X-Received: by 2002:a17:903:28d:b0:162:1eae:bb0e with SMTP id j13-20020a170903028d00b001621eaebb0emr12850280plr.38.1653429528781; Tue, 24 May 2022 14:58:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "H.J. Lu" Date: Tue, 24 May 2022 14:58:12 -0700 Message-ID: Subject: Re: [PATCH 2/3] Revert "[AArch64][BZ #17711] Fix extern protected data handling" To: Wilco Dijkstra Cc: Szabolcs Nagy , "maskray@google.com" , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3019.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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-List-Received-Date: Tue, 24 May 2022 21:58:51 -0000 On Tue, May 24, 2022 at 6:47 AM Wilco Dijkstra via Libc-alpha wrote: > > Hi, > > >> * Clang code generation treats STV_PROTECTED the same way as STV_HIDDEN: > >> no GOT-generating relocation in the first place. > > We should change GCC's behaviour to match this - is this something that > applies to all targets? > > >> * gold and lld reject copy relocation on a STV_PROTECTED symbol. > >> * Nowadays -fpie/-fpic modes are popular. GCC/Clang's codegen uses > >> GOT-generating relocation when accessing an default visibility > >> external symbol which avoids copy relocation. > > Would it be reasonable to add a way to override settings for binaries? > For example if all imported symbols are marked with the correct visibility, > PIE binaries could avoid using GOT for default visibility external symbols to > get better performance. And non-PIE binaries could force GOT accesses for > non-default visibility to avoid copy relocations and support protected visibility. All imported symbols can be marked with the default visibility and all exported symbols, in both executables and shared libraries, can be marked with the protected visibility. These require code changes. -- H.J.