On 11/29/2010 01:46 PM, Kevin Kofler wrote: > John Reiser wrote: >> This patch (with .rpms for x86_64 and i686) enables glibc optionally >> to detect, diagnose, and work around overlap in memcpy/mempcpy: >> http://bitwagon.com/glibc-memlap/glibc-memlap.html >> The option to check is controlled by an environment variable >> MEMCPY_CHECK_ which influences choices made by __init_cpu_features >> and the STT_GNU_IFUNC mechanism for choosing alternate implementations >> at runtime. > > This does not work where the memcpy is inlined (which glibc can do in > several cases). Right. However, specifying the flag -fno-builtin-memcpy at compilation disables gcc inlining of memcpy, thus exposing calls to memcpy that can be checked. Also, a survey of recent versions of gcc indicates that the inlining always copies in ascending address order (of both source and destination.) While the details of inlining are subject to change, copying in ascending address order is the order that is assumed by all violators of the no-overlap requirement. -- -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel