From owner-svn-src-all@FreeBSD.ORG Thu Jan 5 10:32:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A52106566B; Thu, 5 Jan 2012 10:32:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A61578FC15; Thu, 5 Jan 2012 10:32:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q05AWrkh027260; Thu, 5 Jan 2012 10:32:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q05AWriJ027252; Thu, 5 Jan 2012 10:32:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201051032.q05AWriJ027252@svn.freebsd.org> From: Ed Schouten Date: Thu, 5 Jan 2012 10:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229571 - in head/lib/libc: i386/string mips/string string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 10:32:53 -0000 Author: ed Date: Thu Jan 5 10:32:53 2012 New Revision: 229571 URL: http://svn.freebsd.org/changeset/base/229571 Log: Change index() and rindex() to a weak alias. This allows people to still write statically linked applications that call strchr() or strrchr() and have a local variable or function called index. Discussed with: bde@ Modified: head/lib/libc/i386/string/strchr.S head/lib/libc/i386/string/strrchr.S head/lib/libc/mips/string/strchr.S head/lib/libc/mips/string/strrchr.S head/lib/libc/string/strchr.c head/lib/libc/string/strrchr.c Modified: head/lib/libc/i386/string/strchr.S ============================================================================== --- head/lib/libc/i386/string/strchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/i386/string/strchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -63,6 +63,6 @@ L2: ret END(strchr) -STRONG_ALIAS(index, strchr) +WEAK_ALIAS(index, strchr) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/string/strrchr.S ============================================================================== --- head/lib/libc/i386/string/strrchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/i386/string/strrchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -64,6 +64,6 @@ L2: ret END(strrchr) -STRONG_ALIAS(rindex, strrchr) +WEAK_ALIAS(rindex, strrchr) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/mips/string/strchr.S ============================================================================== --- head/lib/libc/mips/string/strchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/mips/string/strchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -58,4 +58,4 @@ fnd: j ra END(strchr) -STRONG_ALIAS(index, strchr) +WEAK_ALIAS(index, strchr) Modified: head/lib/libc/mips/string/strrchr.S ============================================================================== --- head/lib/libc/mips/string/strrchr.S Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/mips/string/strrchr.S Thu Jan 5 10:32:53 2012 (r229571) @@ -56,4 +56,4 @@ LEAF(strrchr) j ra END(strrchr) -STRONG_ALIAS(rindex, strrchr) +WEAK_ALIAS(rindex, strrchr) Modified: head/lib/libc/string/strchr.c ============================================================================== --- head/lib/libc/string/strchr.c Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/string/strchr.c Thu Jan 5 10:32:53 2012 (r229571) @@ -51,4 +51,4 @@ strchr(const char *p, int ch) /* NOTREACHED */ } -__strong_reference(strchr, index); +__weak_reference(strchr, index); Modified: head/lib/libc/string/strrchr.c ============================================================================== --- head/lib/libc/string/strrchr.c Thu Jan 5 10:24:06 2012 (r229570) +++ head/lib/libc/string/strrchr.c Thu Jan 5 10:32:53 2012 (r229571) @@ -52,4 +52,4 @@ strrchr(const char *p, int ch) /* NOTREACHED */ } -__strong_reference(strrchr, rindex); +__weak_reference(strrchr, rindex);