Provide naive but self-contained implementations of memset(3) and
bzero(3) for rtld. This again reduces rtld dependency on libc, and in future, avoid ifunc relocations when the functions are converted to ifuncs in libc. Reported by: mjg Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18400
This commit is contained in:
@@ -5618,3 +5618,25 @@ rtld_strerror(int errnum)
|
||||
return ("Unknown error");
|
||||
return (sys_errlist[errnum]);
|
||||
}
|
||||
|
||||
/*
|
||||
* No ifunc relocations.
|
||||
*/
|
||||
void *
|
||||
memset(void *dest, int c, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
((char *)dest)[i] = c;
|
||||
return (dest);
|
||||
}
|
||||
|
||||
void
|
||||
bzero(void *dest, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
((char *)dest)[i] = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user