This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #16004] Check overlaps in memcpy_chk.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sat, 26 Oct 2013 07:42:53 +0200
- Subject: Re: [PATCH][BZ #16004] Check overlaps in memcpy_chk.
- Authentication-results: sourceware.org; auth=none
- References: <20131005133423 dot GA8405 at domone> <20131025212640 dot C4A49746B6 at topped-with-meat dot com>
On Fri, Oct 25, 2013 at 02:26:40PM -0700, Roland McGrath wrote:
> > Hi, this adds a overlap check to memcpy. As these are not performance
> > critical I deleted ifuncs and we instead do jump to memcpy.
>
> I don't think it's at all clear that _FORTIFY_SOURCE wrappers are not
> performance critical. Lots of systems nowadays are compiling most of
> their stuff this way (e.g. Ubuntu and Gentoo the compiler does it by
> default; Fedora et al the package system builds do it by default).
A checked now strcpy is four times slower than normal one. This has much
bigger effect than few extra cycles from overlap checking.
Most of other *_chk functions are also slow but we did not measured how.