[BZ #6794]
Following Joseph comments about bug 6794, here is a proposed fix. It turned out
to be a large fix mainly because I had to move some file along to follow libm
files/names conventions.
Basically I have added wrappers (w_ilogb.c, w_ilogbf.c, w_ilogbl.c) that now calls
the symbol '__ieee754_ilogb'. The wrappers checks for '__ieee754_ilogb' output and
set the errno and raise exceptions as expected.
The '__ieee754_ilogb' is implemented in sysdeps. I have moved the 's_ilogb[f|l]' files
to e_ilogb[f|l] and renamed the '__ilogb[f|l]' to '__ieee754_ilogb[f|l]'.
I also found out a bug in i386 and x86-64 assembly coded ilogb implementation where
it raises a FE_DIVBYZERO when argument is '0.0'. I corrected this issue as well.
Finally I added the errno and FE_INVALID tests for 0.0, NaN and +-InF argument. Tested
on i386, x86-64, ppc32 and ppc64.
It may sometimes be desirable to make the dynamic linker only pick up
libraries from the library path and rpath and not look at the
ld.so.cache that ldconfig generates. An example of such a use case is
the glibc testsuite where the dynamic linker must not be influenced by
any external paths or caches.
This change adds a new option --inhibit-ldcache that when used, tells
the dynamic linker to not use ld.so.cache even if it is available.
The proper define to check "am I in a shared lib" is "SHARED", not "PIC".
The two new memset_chk functions incorrectly depend on "PIC".
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
[BZ #13592]
There are several signed compares of the size argument, whereas
it really is unsigned. Depending on situations e.g. a "memset(ptr, 0,
-1)" segfault (but for the wrong reasons, because jumping into nirvana)
or succeeds even.
In normal use this is harmless, as a size with signbit set indicates
more than half the address space which on x86_64 is impossible to
allocate, but as the size is used to index some jump tables this
potentially could have other unwanted side effects.
[BZ#13926]
Currently __bswap_64 is not defined at all for non-GCC compilers.
Define it but guard it with __GLIBC_HAVE_LONG_LONG.
endian.h uses __bswap_64, make the functions only available
if __GLIBC_HAVE_LONG_LONG is defined.
I've improved the following implementation of memcpy:
"sysdeps/i386/i686/multiarch/memcpy-ssse3.S".
The patch includes some minor style fixes, but the important part is
just using prefetch loops for the case:
DATA_CACHE_SIZE_HALF <= len < SHARED_CACHE_SIZE_HALF and
src and dst pointers have unequal 16 byte alignments.
This gives from 6% - 50% performance boost on the atom machine, about
24,73% in geometric mean.
* sysdeps/sparc/sparc64/multiarch/memcpy.S: Provide a hidden def to
the IFUNC routine in the libc case.
* sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise.
* sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c: New file.
* sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c: New file.
* sysdeps/sparc/sparc32/sparcv9/rtld-memset.c: New file.
* sysdeps/sparc/sparc32/sparcv9/rtld-memcpy.c: New file.
* sysdeps/sparc/sparc64/multiarch/rtld-memset.c: New file.
* sysdeps/sparc/sparc64/multiarch/rtld-memcpy.c: New file.
* sysdeps/sparc/sparc64/rtld-memset.c: New file.
* sysdeps/sparc/sparc64/rtld-memcpy.c: New file.
* sysdeps/sparc/Makefile: Add -fPIC to ASFLAGS-.os here....
* sysdeps/sparc/sparc32/Makefile: rather than here...
* sysdeps/sparc/sparc64/Makefile: and here.
* sysdeps/s390/s390-64/elf/bsd-_setjmp.S: Moved to ...
* sysdeps/s390/s390-64/bsd-_setjmp.S: ... here.
* sysdeps/s390/s390-64/elf/bsd-setjmp.S: Moved to ...
* sysdeps/s390/s390-64/bsd-setjmp.S: ... here.
* sysdeps/s390/s390-64/elf/setjmp.S: Moved to ...
* sysdeps/s390/s390-64/setjmp.S: ... here.
* sysdeps/s390/s390-64/elf/configure.in: Moved to ...
* sysdeps/s390/s390-64/configure.in: ... here
* sysdeps/s390/s390-64/elf/configure: Delete file.
* sysdeps/s390/s390-64/elf/start.S: Moved to ...
* sysdeps/s390/s390-64/start.S: ... here.
* sysdeps/s390/s390-64/elf/configure: Delete.
* sysdeps/s390/s390-32/elf/bsd-_setjmp.S: Moved to ...
* sysdeps/s390/s390-32/bsd-_setjmp.S: ... here.
* sysdeps/s390/s390-32/elf/bsd-setjmp.S: Moved to ...
* sysdeps/s390/s390-32/bsd-setjmp.S: ... here.
* sysdeps/s390/s390-32/elf/setjmp.S: Moved to ...
* sysdeps/s390/s390-32/setjmp.S: ... here.
* sysdeps/s390/s390-32/elf/configure.in: Moved to ...
* sysdeps/s390/s390-32/configure.in: ... here.
* sysdeps/s390/s390-32/elf/configure: Delete file.
* sysdeps/s390/s390-32/elf/start.S: Moved to ...
* sysdeps/s390/s390-32/start.S: ... here.
* sysdeps/powerpc/elf/ifunc-sel.h: Moved to ...
* sysdeps/powerpc/ifunc-sel.h: ... here.
* sysdeps/powerpc/elf/rtld-global-offsets.sym: Moved to ...
* sysdeps/powerpc/rtld-global-offsets.sym: ... here.