From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5281 invoked by alias); 7 Nov 2016 17:14:01 -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 5260 invoked by uid 89); 7 Nov 2016 17:14:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1224 X-HELO: mail-qk0-f195.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0D9wIReVgEaYeushAII9yAmMA/xW05IbnjS6MlRtvTk=; b=ZrySSsfqtS26Orf8bZPDoyyq2lijhOMnhC0dBdMAEPEqmBpLRiqhwX+gY7UDj3/qUz Bjv1XpOfavbwBv/+u4uondGyyDjO3A4M/jcH8U2sRckLx/a2mL5H7jP9+O2zmbpLO4Tt Oc0Nf6Vq8THqwLQT9YVu82p3+BKxtXAtKuai/cXyV5EVlOdCxXNMOngjsiMJIa7OwF8l iyutWO6AZ8SbOGvqQ0JBiQtgjKR0RlO6ZXKsyVN7hmBlAyjRH9ZvfgvQszLP90AcarhO 2d48aRTyLCDGKv3MD6EP4R2s2IvbI+tFCVqQOOqoHVLTK4q1Zge/nw1wymfs/qmDzb/t LjpA== X-Gm-Message-State: ABUngvdTPEqTfcwRVT7pGDbGmz8xc4e1CzQXWYoWZM5FwBH9u5BHmzXnQivzrecRJ/DHMN7fANsl3eBc95n+Qg== X-Received: by 10.55.169.202 with SMTP id s193mr8506072qke.231.1478538836592; Mon, 07 Nov 2016 09:13:56 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1129b1b2-5f7a-26c3-76a7-727a14fdadfb@redhat.com> References: <20161104174739.GA5880@intel.com> <1129b1b2-5f7a-26c3-76a7-727a14fdadfb@redhat.com> From: "H.J. Lu" Date: Mon, 07 Nov 2016 17:14:00 -0000 Message-ID: Subject: Re: [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750] To: Florian Weimer Cc: GNU C Library Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-11/txt/msg00246.txt.bz2 On Mon, Nov 7, 2016 at 8:03 AM, Florian Weimer wrote: > 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 =E2=80=9Cname=E2=80=9D is automatically mapped to =E2=80= =9Cname@plt=E2=80=9D? No. There is no "@plt". Linker will create a PLT entry if the function is defined in a shared object. > 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. > It is ok as long as those static archives aren't used to create shared objects. --=20 H.J.