From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10210 Path: news.gmane.org!not-for-mail From: weimingz@codeaurora.org Newsgroups: gmane.linux.lib.musl.general Subject: Re: build musl for armv7m Date: Wed, 22 Jun 2016 23:04:18 -0700 Message-ID: <5f0cfaa0d29db9e502d82e0c2a64001a@codeaurora.org> References: <20160614163252.GQ22574@port70.net> <0e13c593-33fa-be67-5e73-cec7d7edfe15@codeaurora.org> <20160620195832.GN10893@brightrain.aerifal.cx> <20160622191940.GS10893@brightrain.aerifal.cx> <34aab271-7305-3376-f5ad-7ae161c93428@codeaurora.org> <20160622232640.GV10893@brightrain.aerifal.cx> <20160623042244.GW10893@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1466661876 12555 80.91.229.3 (23 Jun 2016 06:04:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2016 06:04:36 +0000 (UTC) Cc: Rich Felker , Rich Felker To: musl@lists.openwall.com Original-X-From: musl-return-10223-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 23 08:04:34 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bFxkg-0000tt-Ge for gllmg-musl@m.gmane.org; Thu, 23 Jun 2016 08:04:34 +0200 Original-Received: (qmail 27894 invoked by uid 550); 23 Jun 2016 06:04:31 -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 27874 invoked from network); 23 Jun 2016 06:04:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 In-Reply-To: <20160623042244.GW10893@brightrain.aerifal.cx> X-Sender: weimingz@codeaurora.org User-Agent: Roundcube Webmail/1.1.4 Xref: news.gmane.org gmane.linux.lib.musl.general:10210 Archived-At: If it is not a weak symbol, you may get "multi-def" error. It depends on the obj/lib order on command line. If it is a weak symbol, then a non-weak symbol can override it. Anyway, your comment reminds me that we can use -wrap=exit to override it. So no change is needed. btw, will you commit the change of those .s files for armv7m ? Thanks, Weiming On 2016-06-22 21:22, Rich Felker wrote: > On Wed, Jun 22, 2016 at 05:21:54PM -0700, Zhao, Weiming wrote: >> Fixed. >> >> Btw, can we make exit() weak function? (patch attached) >> >> This allows user code to redefine it because in baremetal >> environment, sometime we want to customize it. For example, some >> code never exits, so we can define a dummy exit() and thus save code >> size. > > No, this is a hack and is not even needed to do what you're asking > for. The way linking an archive works, an object in the archive is > only pulled in to the link process when it satisfies an undefined > symbol reference, and if you defined your own exit, then exit.o would > never have reason to get linked. > > But there are all sorts of things that can break unexpectedly from > redefining standard functions, which is why it's UB and this is not > supported usage. > > Rich