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@
As I looked through the C library, I noticed the FreeBSD MIPS port has a
hand-written version of index(). This is nice, if it weren't for the
fact that most applications call strchr() instead.
Also, on the other architectures index() and strchr() are identical,
meaning we have two identical pieces of code in the C library and
statically linked applications.
Solve this by naming the actual file strchr.[cS] and let it use
__strong_reference()/STRONG_ALIAS() to provide the index() routine. Do
the same for rindex()/strrchr().
This seems to make the C libraries and static binaries slightly smaller,
but this reduction in size seems negligible.
The existing implementation of bzero incorrectly clears bytes when the
start address is not word aligned. Fix it by using REG_SHI macro which
works on both 32 and 64 bit.
Submitted by: Artem Belevich (fbsdlist at src cx)
Update libc assembly code to use macros that work on both o32 and n64.
Merge string functions from NetBSD.
The changes are from http://svn.freebsd.org/base/user/jmallett/octeon
Approved by: rrs (mentor), jmallett