From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28168 invoked by alias); 1 Feb 2017 09:06:25 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 28118 invoked by uid 89); 1 Feb 2017 09:06:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=browsing, the, doubly, letter X-HELO: smtpo44.poczta.onet.pl Received: from smtpo44.poczta.onet.pl (HELO smtpo44.poczta.onet.pl) (213.180.142.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Feb 2017 09:06:14 +0000 Received: from [192.168.2.253] (83-238-239-138.adsl.inetia.pl [83.238.239.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: freddie_chopin@op.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3vCy0c5WRLzStPwTX for ; Wed, 1 Feb 2017 10:06:08 +0100 (CET) Message-ID: <1485939967.1269.5.camel@op.pl> Subject: Re: [PATCH 3/3, newlib] Allow locking routine to be retargeted From: Freddie Chopin To: newlib@sourceware.org Date: Wed, 01 Feb 2017 09:06:00 -0000 In-Reply-To: <7477136f-dc07-5081-a06f-2144a8ce2251@foss.arm.com> References: <53697464-af87-8917-c5ec-b1a0d06cca00@foss.arm.com> <20170125113934.GD21591@calimero.vinschen.de> <1247899115.19685162.1485376973312.JavaMail.zimbra@redhat.com> <7477136f-dc07-5081-a06f-2144a8ce2251@foss.arm.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00115.txt.bz2 On Tue, 2017-01-31 at 17:19 +0000, Thomas Preudhomme wrote: >  > 1. Why is the lock used by at_quick_exit() not required - I have > no >  > idea. The linking error (when I do not provide storage for this > lock) >  > about multiple definitions is visible only when I actually use the >  > at_quick_exit() function. > > That makes sense. If you don't use at_quick_exit then probably no > symbol in the  > corresponding object file is referenced and therefore the file is not > linked in.  > That's exactly why the "doubly defined error on missing symbol" work > as  > explained in the cover letter: file with dummy symbol is only linked > in if it  > solves an undefined reference. This case seems a bit different, as it applies only to the at_quick_exit() lock. In my code I have no references to "env" or "tz" locks either, but I cannot drop these objects without the "multiple definitions" error. Maybe my test is flawed, but browsing the assembly output does not show any uses of __tz_lock(), __tz_unlock(), __env_lock() or __env_unlock() functions (which are not present in the output file), and these are the only places of newlib which use this particular locks. I'll try later with a simpler project. Regards, FCh