From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14854 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Fangrui Song Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] remove remaining traces of __tls_get_new Date: Mon, 21 Oct 2019 17:50:30 -0700 Message-ID: <20191022005030.vcmt2smjyqhcjkfw@gmail.com> References: <20190929130527.GR22009@port70.net> <20190929205639.GK9017@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="80821"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180223-112-0c5bf3 Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-14870-gllmg-musl=m.gmane.org@lists.openwall.com Tue Oct 22 02:50:46 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iMiNq-000Ku3-H9 for gllmg-musl@m.gmane.org; Tue, 22 Oct 2019 02:50:46 +0200 Original-Received: (qmail 23910 invoked by uid 550); 22 Oct 2019 00:50:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 23889 invoked from network); 22 Oct 2019 00:50:43 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=T1kdWQSDUgywRyxsanh434Hn0kzhGtDIgd+BAlmyzzc=; b=TbdIx81VotMwP2at1biog4IQ2kaGA2znY/q1xtuBjaJXqT/4mKa12xxtLhUxUJaDKR 9vywsb66qsFBPGaZGLFQhpDgQtlXBXdiIVvnZxfguQedHr9BRxyfZXl4BlAvvOeCdjZ9 G9rLMbphHnrzdNV8swU5EqELx/2+qckeylq52pyfX7fNEZq9NONbagZKal5MQfqT/AwS NcopwAiUZbNxMbIiiRLp3Tntd02hj1mLgFGcFL86EJATfKLlACxbyGqnwdK+MitKRBJ+ TdduCz1RT8Q0l3NQ1K0kcfxWhFOnDsJ8EjKhEXQBOtgpfvGOvO9R0XP/J/S4Zl/HfHtm cq6A== X-Gm-Message-State: APjAAAWzRv58VS42SLwFjX7G0X4ozC72bzTwGQr4zicdZHv1RXfrbj0M Kp1DQ73djVSrSb6uqvBqwrc= X-Google-Smtp-Source: APXvYqwZ5UXt9FjIQFShLL0WokGCjMKz9ubYfvAdTQe184Ri406JWeLw0Q4QlZQGTrKtwEfa29Sg2Q== X-Received: by 2002:a63:eb52:: with SMTP id b18mr704754pgk.205.1571705431104; Mon, 21 Oct 2019 17:50:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20190929205639.GK9017@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:14854 On 2019-09-29, Rich Felker wrote: >On Sun, Sep 29, 2019 at 03:05:27PM +0200, Szabolcs Nagy wrote: >> reported on irc by malc_ > >> >From 4a7090ab76d81b59f57a83bce9d22582e35a8b2b Mon Sep 17 00:00:00 2001 >> From: Szabolcs Nagy >> Date: Sun, 29 Sep 2019 12:25:39 +0000 >> Subject: [PATCH] remove remaining traces of __tls_get_new >> >> Some declarations of __tls_get_new were left in the code, even >> though the definition got removed in >> >> commit 9d44b6460ab603487dab4d916342d9ba4467e6b9 >> install dynamic tls synchronously at dlopen, streamline access >> >> this can make the build fail with >> >> ld: lib/libc.so: hidden symbol `__tls_get_new' isn't defined >> >> when libc.so is linked without --gc-sections, because a .hidden >> declaration in asm code creates a reference even if the symbol >> is not actually used. > >This is definitely a tooling bug. There is no reference to the symbol, >only declarations of it. I think it's a good idea to cleanup the >spurious mentions of it anyway, though. I think it is hard to simply state that this is a tooling bug. For the visibility attribute of a symbol, it may still be emitted into the symbol table even if it is unused. For example: .protected foo => STV_PROTECTED foo .hidden foo => STV_HIDDEN foo A relocation referencing a symbol may be dropped due to --gc-sections. Shall we consider the symbol unused if all relocations to it are dropped?