From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43587 invoked by alias); 7 Nov 2016 16:03:55 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 43342 invoked by uid 89); 7 Nov 2016 16:03:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=hazard, cheating X-HELO: mx1.redhat.com Subject: Re: [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750] To: "H.J. Lu" References: <20161104174739.GA5880@intel.com> Cc: libc-alpha@sourceware.org From: Florian Weimer Message-ID: <1129b1b2-5f7a-26c3-76a7-727a14fdadfb@redhat.com> Date: Mon, 07 Nov 2016 16:03:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2016-11/txt/msg00240.txt.bz2 On 11/04/2016 08:25 PM, H.J. Lu wrote: > On Fri, Nov 4, 2016 at 12:03 PM, Florian Weimer wrote: >> On 11/04/2016 06:47 PM, H.J. Lu wrote: >>> >>> There is no need to use PLT nor GOT in libc.a to branch to a function, >>> regardless whether libc.a is compiled with PIC or not. >>> >>> Tested on x86-64. OK for master? >> >> >> Isn't this header file used outside of libc as well? > > It is used for other .a files. If they aren't used to create static binaries, > PLT/GOT may be used. The resulting executable will work correctly. You mean because “name” is automatically mapped to “name@plt”? I find this comment not very illuminating: +/* For libc.a, we want to branch to target directly. */ # define JUMPTARGET(name) name And cheating the static linker in this way seems like a future maintenance hazard. Thanks, Florian