Date: Wed, 15 Jan 2020 01:30:32 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356741 - in head/libexec/rtld-elf: . rtld-libc Message-ID: <202001150130.00F1UWk0043791@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Wed Jan 15 01:30:32 2020 New Revision: 356741 URL: https://svnweb.freebsd.org/changeset/base/356741 Log: 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 Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/rtld-libc/Makefile.inc Wed Jan 15 00:45:05 2020 (r356740) +++ head/libexec/rtld-elf/rtld-libc/Makefile.inc Wed Jan 15 01:30:32 2020 (r356741) @@ -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 \ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Jan 15 00:45:05 2020 (r356740) +++ head/libexec/rtld-elf/rtld.c Wed Jan 15 01:30:32 2020 (r356741) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001150130.00F1UWk0043791>