Date: Thu, 5 Jan 2012 10:32:53 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r229571 - in head/lib/libc: i386/string mips/string string Message-ID: <201201051032.q05AWriJ027252@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201051032.q05AWriJ027252>