From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5994 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 3/8] use weak symbols for the POSIX functions that will be used by C threads Date: Sat, 30 Aug 2014 20:17:01 -0400 Message-ID: <20140831001701.GM12888@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1409444242 1038 80.91.229.3 (31 Aug 2014 00:17:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2014 00:17:22 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6001-gllmg-musl=m.gmane.org@lists.openwall.com Sun Aug 31 02:17:16 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XNspW-0002W4-RL for gllmg-musl@plane.gmane.org; Sun, 31 Aug 2014 02:17:14 +0200 Original-Received: (qmail 11270 invoked by uid 550); 31 Aug 2014 00:17:14 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 10238 invoked from network); 31 Aug 2014 00:17:14 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5994 Archived-At: On Sat, Aug 30, 2014 at 08:46:49PM +0200, Jens Gustedt wrote: > diff --git a/src/mman/mprotect.c b/src/mman/mprotect.c > index f488486..535787b 100644 > --- a/src/mman/mprotect.c > +++ b/src/mman/mprotect.c > @@ -2,10 +2,12 @@ > #include "libc.h" > #include "syscall.h" > > -int mprotect(void *addr, size_t len, int prot) > +int __mprotect(void *addr, size_t len, int prot) > { > size_t start, end; > start = (size_t)addr & -PAGE_SIZE; > end = (size_t)((char *)addr + len + PAGE_SIZE-1) & -PAGE_SIZE; > return syscall(SYS_mprotect, start, end-start, prot); > } > + > +weak_alias(__mprotect, mprotect); I'll go ahead and eliminate this one from pthread_create.c like I had mentioned so we can omit it. Doing so should be a size reduction too, both locally (syscall is generally cheaper than function call) and for static linking (since mprotect.o won't get pulled in). Rich