From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id 459023853801 for ; Wed, 4 Aug 2021 22:03:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 459023853801 Received: by mail-pj1-x1035.google.com with SMTP id o44-20020a17090a0a2fb0290176ca3e5a2fso5638586pjo.1 for ; Wed, 04 Aug 2021 15:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aK3rjsaAxORcGfYom3lWiZq1ZOzr79jLsFJlV3SSY4s=; b=ZRa6QLDwgd3ys3/wCnoP/096sINvwm/B/MJOc7BjpaMzAO5v5BxK9SM6bsxRimHeIw E/hCyQEi7bZ5uILanMHbA223YWjIHKjC5Do+YUCnThM4nq7M2ZxaVNh2S+Cm7pj6+t8Z jMcMUij+kWwNJ6fAVwmX+KcBUO3V9YLQnbT3pYC7Xl2/shShzPDu53cNcfKlw2pkaccn 1KRmxqB4spZzJIa1V5q6SRI21nAnv6hcKm12nUC/0uw2NgJZVx8s1fL5IOmgUHQJBsY8 cv60LyQEWsbURB4W6rveKAQrXONOAQ/82ngtRObAFuFjxwVyRl8KsHg15j+zHjoOlX33 zKLA== X-Gm-Message-State: AOAM532QuAPrW/uQoReFFTw9BRM9EnV6abD0JTaqAbx/kXkKXA9VY6Nj LiWgRGBCOeXefUR9g8lIOBhk0ss/lRR3UlzoMzE= X-Google-Smtp-Source: ABdhPJx32l5D7koX5WOOU93OZwgycpr5d86OBbPVcgWGV8Tr6En5W4VHGAwwA8HsNYI9a5iBGhUvfKSFc0M7XyOxVZw= X-Received: by 2002:a17:903:1cb:b029:12c:d398:d85d with SMTP id e11-20020a17090301cbb029012cd398d85dmr1430339plh.4.1628114626273; Wed, 04 Aug 2021 15:03:46 -0700 (PDT) MIME-Version: 1.0 References: <20210709145014.1350564-1-hjl.tools@gmail.com> <20210709145014.1350564-2-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 4 Aug 2021 15:03:10 -0700 Message-ID: Subject: PING^1 [PATCH v3 1/2] Add -f[no-]direct-extern-access To: Richard Biener , Richard Sandiford Cc: GCC Patches , Uros Bizjak , Jakub Jelinek Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3025.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 22:03:48 -0000 On Mon, Jul 12, 2021 at 5:13 AM H.J. Lu wrote: > > On Sun, Jul 11, 2021 at 11:13 PM Richard Biener > wrote: > > > > On Fri, Jul 9, 2021 at 4:50 PM H.J. Lu wrote: > > > > > > -fdirect-extern-access is the default. With -fno-direct-extern-access: > > > > > > 1. Always use GOT to access undefined data and function symbols, > > > including in PIE and non-PIE. These will avoid copy relocations > > > in executables. This is compatible with existing executables and > > > shared libraries. > > > 2. In executable and shared library, bind symbols with the STV_PROTECTED > > > visibility locally: > > > a. The address of data symbol is the address of data body. > > > b. For systems without function descriptor, the function pointer is > > > the address of function body. > > > c. The resulting shared libraries may not be incompatible with > > > executables which have copy relocations on protected symbols or > > > use executable PLT entries as function addresses for protected > > > functions in shared libraries. > > > 3. Update asm_preferred_eh_data_format to select PC relative EH encoding > > > format with -fno-direct-extern-access to avoid copy relocation. > > > 4. Add ix86_reloc_rw_mask for TARGET_ASM_RELOC_RW_MASK to avoid copy > > > relocation with -fno-direct-extern-access. > > > > Did you check how relocations in .debug_info behave? I don't remember whether > > Yes, I did. I added ix86_reloc_rw_mask and use PC-relative format for > EH pointer encodings to avoid copy relocation for -fno-direct-extern-access > in read-only sections. PING: https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574846.html > > we're doing anything special there or if we just copy how we emit > > relocs in .text > > > > Richard. -- H.J.