aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-01-15 01:30:32 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-01-15 01:30:32 +0000
commitda8e950a275e5ce315172fd399368116e11d6667 (patch)
tree0f5b563686964329cfd2950d727981ef153ffed7 /libexec/rtld-elf
parenta107ddbb83a7a93d3c4e40f5355e158d6976bf90 (diff)
downloadsrc-da8e950a275e5ce315172fd399368116e11d6667.tar.gz
src-da8e950a275e5ce315172fd399368116e11d6667.zip
rtld: remove hand rolled memset and bzero
They were introduced to take care of ifunc, but right now no architecture provides ifunc'ed variants. Since rtld uses memset extensively this results in a pessmization. Should someone want to use ifunc here they should provide a mandatory symbol (e.g., rtld_memset). See the review for profiling data. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23176
Notes
Notes: svn path=/head/; revision=356741
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r--libexec/rtld-elf/rtld-libc/Makefile.inc6
-rw-r--r--libexec/rtld-elf/rtld.c22
2 files changed, 3 insertions, 25 deletions
diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc
index e2f260bafea0..dc3a1e47da3c 100644
--- a/libexec/rtld-elf/rtld-libc/Makefile.inc
+++ b/libexec/rtld-elf/rtld-libc/Makefile.inc
@@ -40,9 +40,9 @@ CFLAGS.errlst.c+=-I${LIBC_SRCTOP}/include
# Use the string and memory .o files from libc instead of rebuilding them (they
# might be using optimized assembly and duplicating that logic here is awkward).
-_libc_string_objects= bcmp bcopy memchr memcmp memcpy memmove stpncpy strcat \
- strchr strcmp stpcpy strcpy strcspn strdup strlcat strlcpy strlen strncmp \
- strncpy strrchr strsep strspn strstr strtok
+_libc_string_objects= bcmp bcopy bzero memset memchr memcmp memcpy memmove \
+ stpncpy strcat strchr strcmp stpcpy strcpy strcspn strdup strlcat strlcpy \
+ strlen strncmp strncpy strrchr strsep strspn strstr strtok
# Also use all the syscall .o files from libc_nossp_pic:
_libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \
cerror geteuid getegid munmap mprotect sysarch __sysctl issetugid __getcwd \
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 9c8140295412..3e87e53a3158 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -5729,28 +5729,6 @@ rtld_strerror(int errnum)
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;
-}
-
/* malloc */
void *
malloc(size_t nbytes)