From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1661 invoked by alias); 2 Sep 2012 20:06:54 -0000 Received: (qmail 1589 invoked by uid 22791); 2 Sep 2012 20:06:42 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 Sep 2012 20:06:29 +0000 Received: by vcbfl13 with SMTP id fl13so5522293vcb.0 for ; Sun, 02 Sep 2012 13:06:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.17.75 with SMTP id m11mr8332209vdd.106.1346616388980; Sun, 02 Sep 2012 13:06:28 -0700 (PDT) Received: by 10.58.234.39 with HTTP; Sun, 2 Sep 2012 13:06:28 -0700 (PDT) In-Reply-To: <5043B674.1030108@twiddle.net> References: <503E009B.3080302@linux.vnet.ibm.com> <503E3930.5040603@linux.vnet.ibm.com> <20120829.125208.824114683359549094.davem@davemloft.net> <503F14A3.8070801@linux.vnet.ibm.com> <5040CCC6.4030809@twiddle.net> <50423CF8.7000309@twiddle.net> <50427D29.1010205@twiddle.net> <5043B674.1030108@twiddle.net> Date: Sun, 02 Sep 2012 20:06:00 -0000 Message-ID: Subject: Re: [PATCH] S/390: Fix two issues with the IFUNC optimized mem* routines From: "H.J. Lu" To: Richard Henderson Cc: Andreas Krebbel , David Miller , aj@suse.com, libc-alpha@sourceware.org, Binutils Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00016.txt.bz2 On Sun, Sep 2, 2012 at 12:41 PM, Richard Henderson wrote: > On 2012-09-02 07:50, H.J. Lu wrote: >> A relax pass won't work properly for x86 without some surgery >> since lang_relax_sections is called after bfd_elf_size_dynamic_sections >> which calls elf_x86_64_allocate_dynrelocs to allocate GOT entries >> and dynamic relocations. After it is done, it is not to easy to undo >> the damage. > > Other targets keep usage counts of GOT entries live throughout relaxation. > It becomes easy to adjust the GOT *after* bfd_elf_size_dynamic_sections > has been called. Indeed, many targets require this ordering since some > of the optimizations applied are true relaxations, and require knowledge > of true displacements. And indeed, the reduction in GOT size may enable > another relaxation pass, enabling further optimizations to succeed. That is true. IA64 needs more than one pass to do it properly. >> This is a separate issue. X86 backends also optimize >> TLS relocations. Some compilers generate bad TLS >> sequences which lead to corrupted output: >> >> http://sourceware.org/bugzilla/show_bug.cgi?id=4928 >> >> But there is no way to turn off the TLS optimization. > > ... because it was done in the wrong place. An excellent opportunity > to move the TLS relaxations to a relaxation pass, wouldn't you agree? > I think it is overkill for x86 since all relocations targets can be reached. I don't want to make big changes in relaxation codes for this. -- H.J.