mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 22:40:05 +00:00
f566b02852
On x32, the size_t parameter may be passed in the lower 32 bits of a 64-bit register with the non-zero upper 32 bits. The string/memory functions written in assembly can only use the lower 32 bits of a 64-bit register as length or must clear the upper 32 bits before using the full 64-bit register for length. This pach fixes strncat for x32. Tested on x86-64 and x32. On x86-64, libc.so is the same with and without the fix. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
20 lines
731 B
Makefile
20 lines
731 B
Makefile
ifeq ($(subdir),math)
|
|
# Since x32 returns 32-bit long int and 64-bit long long int in the
|
|
# same 64-bit register, we make the 32b-bit lround an alias of the
|
|
# 64-bit llround. Add -fno-builtin-lround to silence the compiler.
|
|
CFLAGS-s_llround.c += -fno-builtin-lround -fno-builtin-lroundf32x \
|
|
-fno-builtin-lroundf64
|
|
endif
|
|
|
|
ifeq ($(subdir),string)
|
|
tests += tst-size_t-memchr tst-size_t-memcmp tst-size_t-memcpy \
|
|
tst-size_t-memrchr tst-size_t-memset tst-size_t-strncasecmp \
|
|
tst-size_t-strncmp tst-size_t-strncpy tst-size_t-strnlen \
|
|
tst-size_t-memcmp-2 tst-size_t-strncat
|
|
endif
|
|
|
|
ifeq ($(subdir),wcsmbs)
|
|
tests += tst-size_t-wmemchr tst-size_t-wmemcmp tst-size_t-wmemset \
|
|
tst-size_t-wcsncmp tst-size_t-wcsnlen
|
|
endif
|