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@
This commit is contained in:
Ed Schouten 2012-01-05 10:32:53 +00:00
parent 30b42655cf
commit 19c262fe87
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229571
6 changed files with 6 additions and 6 deletions

View File

@ -63,6 +63,6 @@ L2:
ret
END(strchr)
STRONG_ALIAS(index, strchr)
WEAK_ALIAS(index, strchr)
.section .note.GNU-stack,"",%progbits

View File

@ -64,6 +64,6 @@ L2:
ret
END(strrchr)
STRONG_ALIAS(rindex, strrchr)
WEAK_ALIAS(rindex, strrchr)
.section .note.GNU-stack,"",%progbits

View File

@ -58,4 +58,4 @@ fnd:
j ra
END(strchr)
STRONG_ALIAS(index, strchr)
WEAK_ALIAS(index, strchr)

View File

@ -56,4 +56,4 @@ LEAF(strrchr)
j ra
END(strrchr)
STRONG_ALIAS(rindex, strrchr)
WEAK_ALIAS(rindex, strrchr)

View File

@ -51,4 +51,4 @@ strchr(const char *p, int ch)
/* NOTREACHED */
}
__strong_reference(strchr, index);
__weak_reference(strchr, index);

View File

@ -52,4 +52,4 @@ strrchr(const char *p, int ch)
/* NOTREACHED */
}
__strong_reference(strrchr, rindex);
__weak_reference(strrchr, rindex);