mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-09 23:58:37 +08:00
Compare commits
28
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02b1a8f866 | ||
|
|
c3e44c4872 | ||
|
|
add6d67730 | ||
|
|
7d68c743ae | ||
|
|
6427ccf5a0 | ||
|
|
e9586e58a5 | ||
|
|
c972bcc9eb | ||
|
|
02eff8c4f8 | ||
|
|
043c748cfa | ||
|
|
14b77c0bbb | ||
|
|
3b145207c8 | ||
|
|
68b6636fdc | ||
|
|
c3b96f90c9 | ||
|
|
a5cfcf08ff | ||
|
|
cbc43bc538 | ||
|
|
6c62f10874 | ||
|
|
bbe53ed2c3 | ||
|
|
5b489807f7 | ||
|
|
da1f431963 | ||
|
|
6db8f73723 | ||
|
|
a7ef7b6735 | ||
|
|
95e039785a | ||
|
|
56935d3944 | ||
|
|
40f29908c6 | ||
|
|
66412080e2 | ||
|
|
593dafca33 | ||
|
|
902c25a1d2 | ||
|
|
849e3c4660 |
@@ -1,3 +1,194 @@
|
||||
2014-06-03 Guo Yixuan <culu.gyx@gmail.com>
|
||||
|
||||
[BZ #16882]
|
||||
* nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
|
||||
(pthread_spin_lock): Branch out of spin loop to proper location.
|
||||
* nptl/sysdeps/sparc/sparc64/pthread_spin_lock.S
|
||||
(pthread_spin_lock): Likewise.
|
||||
|
||||
* nptl/tst-spin4.c: New test.
|
||||
* nptl/Makefile (tests): Add tst-spin4.
|
||||
|
||||
2014-05-16 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
[BZ #16943]
|
||||
* sysdeps/unix/sysv/linux/sparc/bits/resource.h: Declare prlimit
|
||||
and prlimit64.
|
||||
|
||||
2014-05-06 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
[BZ# 16916]
|
||||
* sysdeps/unix/sysv/linux/sparc/bits/eventfd.h (EFD_SEMAPHORE):
|
||||
Define.
|
||||
|
||||
2014-05-01 David S. Miller <davem@davemloft.net>
|
||||
|
||||
[BZ #16885]
|
||||
* sysdeps/sparc/sparc64/strcmp.S: Fix end comparison handling when
|
||||
multiple zero bytes exist at the end of a string.
|
||||
Reported by Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
* string/test-strcmp.c (check): Add explicit test for situations where
|
||||
there are multiple zero bytes after the first.
|
||||
|
||||
2014-01-29 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
[BZ #16510]
|
||||
* sysdeps/x86/fpu/bits/mathinline.h: Check __SSE2_MATH__ instead
|
||||
of __x86_64__ when disabling x87 inline functions.
|
||||
|
||||
2014-01-04 Maxim Kuvyrkov <maxim@kugelworks.com>
|
||||
Ondřej Bílka <neleai@seznam.cz>
|
||||
|
||||
[BZ #15073]
|
||||
* malloc/malloc.c (_int_free): Perform sanity check only if we
|
||||
have_lock.
|
||||
|
||||
2012-11-20 Thomas Schwinge <thomas@codesourcery.com>
|
||||
|
||||
* sysdeps/sh/dl-machine.h (ELF_MACHINE_RUNTIME_FIXUP_PARAMS): New
|
||||
macro.
|
||||
|
||||
2012-11-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
[BZ #14831]
|
||||
* elf/Makefile (tests): Add tst-audit8.
|
||||
($(objpfx)tst-audit8): Also depend on $(common-objpfx)math/libm.so.
|
||||
($(objpfx)tst-audit8.out): New target.
|
||||
(tst-audit8-ENV): New variable.
|
||||
* elf/dl-runtime.c (_dl_profile_fixup): Call _dl_fixup to skip
|
||||
audit if l_reloc_result is NULL.
|
||||
(ELF_MACHINE_RUNTIME_FIXUP_PARAMS): Issue an error if it isn't
|
||||
defined and ELF_MACHINE_RUNTIME_FIXUP_ARGS is defined.
|
||||
* elf/tst-audit8.c: New file.
|
||||
|
||||
2012-10-04 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
[BZ #14648]
|
||||
* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
|
||||
Set bit_FMA_Usable if FMA is supported.
|
||||
* sysdeps/x86_64/multiarch/init-arch.h (bit_FMA_Usable): New
|
||||
macro.
|
||||
(bit_FMA4_Usable): Updated.
|
||||
(index_FMA_Usable): New macro.
|
||||
(CPUID_FMA): Likewise
|
||||
(HAS_FMA): Defined with bit_FMA_Usable.
|
||||
|
||||
2012-09-28 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
[BZ #6530]
|
||||
* stdio-common/vfprintf.c (process_string_arg): Revert
|
||||
2000-07-22 change.
|
||||
|
||||
2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
[BZ #14042]
|
||||
* sysdeps/powerpc/powerpc32/ppc-mcount.S [SHARED]: Don't use PLT
|
||||
for call to __mcount_internal.
|
||||
* sysdeps/powerpc/powerpc32/Makefile (sysdep_routines)
|
||||
(shared-only-routines) [$(subdir) = gmon]: Add compat-ppc-mcount.
|
||||
* sysdeps/powerpc/powerpc32/compat-ppc-mcount.S: New file.
|
||||
|
||||
2011-09-28 Jonathan Nieder <jrnieder@gmail.com>
|
||||
|
||||
* stdio-common/Makefile (tst-sprintf-ENV): Set environment
|
||||
for testcase.
|
||||
* stdio-common/tst-sprintf.c: Include <locale.h>
|
||||
(main): Test sprintf's handling of incomplete multibyte
|
||||
characters.
|
||||
|
||||
2012-09-25 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
[BZ #14621]
|
||||
* posix/glob.c (next_brace_sub): Use size_t instead of unsigned
|
||||
int as type of variable DEPTH.
|
||||
(glob): Use size_t instead of int as type of variables NEWCOUNT
|
||||
and OLD_PATHC.
|
||||
|
||||
2012-09-24 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
[BZ #14562]
|
||||
* malloc/arena.c (heap_trim): Properly get fencepost and adjust
|
||||
new chunk size with MALLOC_ALIGN_MASK.
|
||||
|
||||
2012-08-29 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
[BZ #14476]
|
||||
* Makefile (install): Also pass LD_SO=$(ld.so-version) to
|
||||
scripts/test-installation.pl.
|
||||
* scripts/test-installation.pl: Use LD_SO to get $ld_so_name
|
||||
and $ld_so_version if it is set.
|
||||
|
||||
2012-08-27 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
[BZ #14459]
|
||||
* stdlib/strtod_l.c: Include <stdint.h>.
|
||||
(NDEBUG): Do not define.
|
||||
(round_and_return): Change EXPONENT parameter to type intmax_t.
|
||||
Rearrange calculations to avoid internal overflow possibilities.
|
||||
(str_to_mpn): Change EXPONENT parameter to type intmax_t *.
|
||||
Rearrange calculations to avoid internal overflow possibilities.
|
||||
Assert that number fits inside MPNSIZE limbs.
|
||||
(____STRTOF_INTERNAL): Change EXPONENT variable to type intmax_t.
|
||||
Change DIG_NO, INT_NO and LEAD_ZERO to type size_t. Rearrange
|
||||
calculations and add assertions to avoid internal overflow
|
||||
possibilities. Add casts to avoid signed/unsigned operations.
|
||||
* stdlib/tst-strtod-overflow.c: New file.
|
||||
* stdlib/Makefile (tests): Add tst-strtod-overflow.
|
||||
|
||||
2012-08-15 Liubov Dmitrieva <liubov.dmitrieva@gmail.com>
|
||||
|
||||
[BZ #14195]
|
||||
* sysdeps/i386/i686/multiarch/strcmp-sssse3.S: Fix
|
||||
segmentation fault for a case of two empty input strings.
|
||||
* string/test-strncasecmp.c (check1): Renamed to...
|
||||
(bz12205): ...this.
|
||||
(bz14195): Add new testcase for two empty input strings and N > 0.
|
||||
(test_main): Call new testcase, adapt for renamed function.
|
||||
|
||||
2012-07-06 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* sunrpc/rpc_clntout.c: Change <rpc/types.h> to "rpc/types.h".
|
||||
|
||||
2012-07-16 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* po/ru.po: Update from translation team.
|
||||
|
||||
2012-07-13 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* po/fr.po: Update from translation team.
|
||||
|
||||
2012-07-11 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* po/fr.po: Update from translation team.
|
||||
|
||||
* po/sv.po: Update from translation team
|
||||
* po/fr.po: Another update from translation team.
|
||||
|
||||
2012-07-04 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* catgets/Makefile ($(objpfx)de.msg): Use xopen-msg.awk instead of
|
||||
xopen-msg.sed.
|
||||
* catgets/xopen-msg.awk: New file.
|
||||
* catgets/xopen-msg.sed: Removed.
|
||||
|
||||
2012-07-04 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* intl/Makefile ($(objpfx)msgs.h): Use po2test.awk instead of
|
||||
po2text.sed.
|
||||
* intl/po2test.awk: New file.
|
||||
* intl/po2test.sed: Removed.
|
||||
|
||||
2012-07-03 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* po/bg.po: Update from translation team.
|
||||
* po/cs.po: Likewise.
|
||||
* po/de.po: Likewise.
|
||||
* po/hr.po: Likewise.
|
||||
* po/nl.pl: Likewise.
|
||||
* po/pl.po: Likewise.
|
||||
* po/vi.po: Likewise.
|
||||
|
||||
2012-06-30 Carlos O'Donell <carlos_odonell@mentor.com>
|
||||
|
||||
* NEWS: Update copyright. Remove last-updated date.
|
||||
|
||||
@@ -111,7 +111,7 @@ install:
|
||||
ifneq (no,$(PERL))
|
||||
ifeq (/usr,$(prefix))
|
||||
ifeq (,$(install_root))
|
||||
CC="$(CC)" $(PERL) scripts/test-installation.pl $(common-objpfx)
|
||||
LD_SO=$(ld.so-version) CC="$(CC)" $(PERL) scripts/test-installation.pl $(common-objpfx)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -5,6 +5,13 @@ See the end for copying conditions.
|
||||
Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/>
|
||||
using `glibc' in the "product" field.
|
||||
|
||||
Version 2.16.1
|
||||
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
6530, 14195, 14459, 14476, 14562, 14621, 14648, 14756, 14831, 15073,
|
||||
16510, 16885, 16916, 16943.
|
||||
|
||||
Version 2.16
|
||||
|
||||
* The following bugs are resolved with this release:
|
||||
@@ -15,23 +22,23 @@ Version 2.16
|
||||
4822, 5077, 5461, 5805, 5993, 6471, 6486, 6578, 6649, 6730, 6770, 6794,
|
||||
6884, 6890, 6894, 6895, 6907, 6911, 6959, 7064, 9739, 9902, 10110, 10135,
|
||||
10140, 10153, 10210, 10254, 10346, 10375, 10545, 10716, 10846, 11174,
|
||||
11322, 11365, 11451, 11494, 11521, 11677, 11837, 11959, 12047, 12097,
|
||||
12193, 12194, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058,
|
||||
13223, 13361, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532,
|
||||
13533, 13547, 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566,
|
||||
13576, 13579, 13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658,
|
||||
13673, 13691, 13695, 13704, 13705, 13706, 13718, 13726, 13738, 13739,
|
||||
13743, 13750, 13758, 13760, 13761, 13775, 13786, 13787, 13792, 13806,
|
||||
13824, 13840, 13841, 13844, 13846, 13848, 13851, 13852, 13854, 13871,
|
||||
13872, 13873, 13879, 13882, 13883, 13884, 13885, 13886, 13892, 13895,
|
||||
13908, 13910, 13911, 13912, 13913, 13914, 13915, 13916, 13917, 13918,
|
||||
13919, 13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938,
|
||||
13941, 13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973,
|
||||
13979, 13983, 13986, 13996, 14012, 14027, 14033, 14034, 14036, 14040,
|
||||
14043, 14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075,
|
||||
14080, 14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134,
|
||||
14153, 14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273, 14277,
|
||||
14278
|
||||
11261, 11322, 11365, 11451, 11494, 11521, 11677, 11837, 11959, 12047,
|
||||
12097, 12193, 12194, 12297, 12298, 12301, 12340, 12354, 12416, 12495,
|
||||
13058, 13223, 13361, 13525, 13526, 13527, 13528, 13529, 13530, 13531,
|
||||
13532, 13533, 13547, 13551, 13552, 13553, 13555, 13556, 13559, 13563,
|
||||
13566, 13576, 13579, 13583, 13592, 13594, 13613, 13618, 13637, 13656,
|
||||
13658, 13673, 13691, 13695, 13704, 13705, 13706, 13718, 13726, 13738,
|
||||
13739, 13743, 13750, 13758, 13760, 13761, 13775, 13786, 13787, 13792,
|
||||
13806, 13824, 13840, 13841, 13844, 13846, 13848, 13851, 13852, 13854,
|
||||
13871, 13872, 13873, 13879, 13882, 13883, 13884, 13885, 13886, 13892,
|
||||
13895, 13908, 13910, 13911, 13912, 13913, 13914, 13915, 13916, 13917,
|
||||
13918, 13919, 13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928,
|
||||
13938, 13941, 13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970,
|
||||
13973, 13979, 13983, 13986, 13996, 14012, 14027, 14033, 14034, 14036,
|
||||
14040, 14043, 14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064,
|
||||
14075, 14080, 14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123,
|
||||
14134, 14153, 14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273,
|
||||
14277, 14278, 16882
|
||||
|
||||
* Support for the x32 ABI on x86-64 added. The x32 target is selected by
|
||||
configuring glibc with:
|
||||
|
||||
+2
-2
@@ -70,8 +70,8 @@ $(objpfx)de/libc.cat: $(objpfx)de.msg $(objpfx)gencat
|
||||
$(objpfx)tst-catgets.out: $(objpfx)de/libc.cat
|
||||
|
||||
# Generate a non-simple input file.
|
||||
$(objpfx)de.msg: $(..)po/de.po
|
||||
LC_ALL=C sed -f xopen-msg.sed $< > $@
|
||||
$(objpfx)de.msg: xopen-msg.awk $(..)po/de.po
|
||||
LC_ALL=C $(AWK) -f $^ $< > $@
|
||||
|
||||
$(objpfx)test-gencat.out: test-gencat.sh $(objpfx)test-gencat \
|
||||
$(objpfx)sample.SJIS.cat
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
# xopen-msg.awk - Convert Uniforum style .po file to X/Open style .msg file
|
||||
# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
# The first directive in the .msg should be the definition of the
|
||||
# message set number. We use always set number 1.
|
||||
#
|
||||
BEGIN {
|
||||
print "$set 1 # Automatically created by xopen-msg.awk"
|
||||
num = 0
|
||||
}
|
||||
|
||||
#
|
||||
# The .msg file contains, other then the .po file, only the translations
|
||||
# but each given a unique ID. Starting from 1 and incrementing by 1 for
|
||||
# each message we assign them to the messages.
|
||||
# It is important that the .po file used to generate the ../intl/msg.h file
|
||||
# (with po2test.awk) is the same as the one used here. (At least the order
|
||||
# of declarations must not be changed.)
|
||||
#
|
||||
function output_message() {
|
||||
# Ignore messages containing <PRI.*> which would have to be replaced
|
||||
# by the correct format depending on the word size
|
||||
if (msg && msg !~ /<PRI.*>/) {
|
||||
if (msgtype == "msgid") {
|
||||
# We copy the original message as a comment into the .msg file.
|
||||
gsub(/\n/, "\n$ ", msg)
|
||||
printf "$ Original Message: %s\n", msg
|
||||
} else {
|
||||
gsub(/\n/, "\\\n", msg)
|
||||
printf "%d %s\n", ++num, msg
|
||||
}
|
||||
}
|
||||
msg = 0
|
||||
}
|
||||
|
||||
$1 ~ "msg(id|str)" {
|
||||
# Output collected message
|
||||
output_message()
|
||||
# Collect next message
|
||||
msgtype = $1
|
||||
sub(/^msg(id|str)[ \t]*"/, "", $0)
|
||||
sub(/"$/, "", $0)
|
||||
msg = $0
|
||||
next
|
||||
}
|
||||
|
||||
/^".*"/ {
|
||||
# Append to current message
|
||||
sub(/^"/, "", $0)
|
||||
sub(/"$/, "", $0)
|
||||
msg = msg "\n" $0
|
||||
next
|
||||
}
|
||||
|
||||
END {
|
||||
# Output last collected message
|
||||
output_message()
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
|
||||
# Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
# The first directive in the .msg should be the definition of the
|
||||
# message set number. We use always set number 1.
|
||||
#
|
||||
1 {
|
||||
i\
|
||||
$set 1 # Automatically created by po2msg.sed
|
||||
h
|
||||
s/.*/0/
|
||||
x
|
||||
}
|
||||
#
|
||||
# We copy all comments into the .msg file. Perhaps they can help.
|
||||
#
|
||||
/^#/ s/^#[ ]*/$ /p
|
||||
#
|
||||
# We copy the original message as a comment into the .msg file.
|
||||
#
|
||||
/^msgid/ {
|
||||
# Does not work now
|
||||
# /"$/! {
|
||||
# s/\\$//
|
||||
# s/$/ ... (more lines following)"/
|
||||
# }
|
||||
s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/
|
||||
p
|
||||
}
|
||||
#
|
||||
# The .msg file contains, other then the .po file, only the translations
|
||||
# but each given a unique ID. Starting from 1 and incrementing by 1 for
|
||||
# each message we assign them to the messages.
|
||||
# It is important that the .po file used to generate the cat-id-tbl.c file
|
||||
# (with po-to-tbl) is the same as the one used here. (At least the order
|
||||
# of declarations must not be changed.)
|
||||
#
|
||||
/^msgstr/ {
|
||||
s/msgstr[ ]*"\(.*\)"/\1/
|
||||
x
|
||||
# The following nice solution is by
|
||||
# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
|
||||
td
|
||||
# Increment a decimal number in pattern space.
|
||||
# First hide trailing `9' digits.
|
||||
:d
|
||||
s/9\(_*\)$/_\1/
|
||||
td
|
||||
# Assure at least one digit is available.
|
||||
s/^\(_*\)$/0\1/
|
||||
# Increment the last digit.
|
||||
s/8\(_*\)$/9\1/
|
||||
s/7\(_*\)$/8\1/
|
||||
s/6\(_*\)$/7\1/
|
||||
s/5\(_*\)$/6\1/
|
||||
s/4\(_*\)$/5\1/
|
||||
s/3\(_*\)$/4\1/
|
||||
s/2\(_*\)$/3\1/
|
||||
s/1\(_*\)$/2\1/
|
||||
s/0\(_*\)$/1\1/
|
||||
# Convert the hidden `9' digits to `0's.
|
||||
s/_/0/g
|
||||
x
|
||||
# Bring the line in the format `<number> <message>'
|
||||
G
|
||||
s/^[^\n]*$/& /
|
||||
s/\(.*\)\n\([0-9]*\)/\2 \1/
|
||||
# Clear flag from last substitution.
|
||||
tb
|
||||
# Append the next line.
|
||||
:b
|
||||
N
|
||||
# Look whether second part is a continuation line.
|
||||
s/\(.*\n\)"\(.*\)"/\1\2/
|
||||
# Yes, then branch.
|
||||
ta
|
||||
P
|
||||
D
|
||||
# Note that `D' includes a jump to the start!!
|
||||
# We found a continuation line. But before printing insert '\'.
|
||||
:a
|
||||
s/\(.*\)\(\n.*\)/\1\\\2/
|
||||
P
|
||||
# We cannot use the sed command `D' here
|
||||
s/.*\n\(.*\)/\1/
|
||||
tb
|
||||
}
|
||||
d
|
||||
+5
-1
@@ -138,7 +138,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
|
||||
tst-dlmodcount tst-dlopenrpath tst-deep1 \
|
||||
tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
|
||||
unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
|
||||
tst-audit1 tst-audit2 \
|
||||
tst-audit1 tst-audit2 tst-audit8 \
|
||||
tst-stackguard1 tst-addr1 tst-thrlock \
|
||||
tst-unique1 tst-unique2 tst-unique3 tst-unique4 \
|
||||
tst-initorder tst-initorder2 tst-relsort1
|
||||
@@ -1024,6 +1024,10 @@ $(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
|
||||
$(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
|
||||
tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
|
||||
|
||||
$(objpfx)tst-audit8: $(common-objpfx)math/libm.so
|
||||
$(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so
|
||||
tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
|
||||
|
||||
$(objpfx)tst-global1: $(libdl)
|
||||
$(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
|
||||
|
||||
|
||||
+21
-1
@@ -1,5 +1,5 @@
|
||||
/* On-demand PLT fixup for shared objects.
|
||||
Copyright (C) 1995-2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -168,6 +168,26 @@ _dl_profile_fixup (
|
||||
{
|
||||
void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = INTUSE(_dl_mcount);
|
||||
|
||||
if (l->l_reloc_result == NULL)
|
||||
{
|
||||
/* BZ #14843: ELF_DYNAMIC_RELOCATE is called before l_reloc_result
|
||||
is allocated. We will get here if ELF_DYNAMIC_RELOCATE calls a
|
||||
resolver function to resolve an IRELATIVE relocation and that
|
||||
resolver calls a function that is not yet resolved (lazy). For
|
||||
example, the resolver in x86-64 libm.so calls __get_cpu_features
|
||||
defined in libc.so. Skip audit and resolve the external function
|
||||
in this case. */
|
||||
*framesizep = -1;
|
||||
return _dl_fixup (
|
||||
# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
|
||||
# ifndef ELF_MACHINE_RUNTIME_FIXUP_PARAMS
|
||||
# error Please define ELF_MACHINE_RUNTIME_FIXUP_PARAMS.
|
||||
# endif
|
||||
ELF_MACHINE_RUNTIME_FIXUP_PARAMS,
|
||||
# endif
|
||||
l, reloc_arg);
|
||||
}
|
||||
|
||||
/* This is the address in the array where we store the result of previous
|
||||
relocations. */
|
||||
struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index];
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "../io/pwd.c"
|
||||
+2
-2
@@ -83,9 +83,9 @@ $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6
|
||||
endif
|
||||
endif
|
||||
|
||||
$(objpfx)msgs.h: po2test.sed ../po/de.po
|
||||
$(objpfx)msgs.h: po2test.awk ../po/de.po
|
||||
$(make-target-directory)
|
||||
LC_ALL=C sed -f $^ > $@
|
||||
LC_ALL=C $(AWK) -f $^ > $@
|
||||
|
||||
CFLAGS-tst-gettext.c = -DTESTSTRS_H=\"$(objpfx)msgs.h\"
|
||||
CFLAGS-tst-translit.c = -DOBJPFX=\"$(objpfx)\"
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# po2test.awk - Convert Uniforum style .po file to C code for testing.
|
||||
# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Output current message (in msg) as argument of the INPUT or OUTPUT macro,
|
||||
# depending on msgtype
|
||||
function output_message() {
|
||||
# Ignore messages containing <PRI.*> markers which would have to be
|
||||
# replaced by the correct format depending on the word size
|
||||
if (msg && msg !~ /<PRI.*>/)
|
||||
printf ("%s(%s)\n", msgtype == "msgid" ? "INPUT" : "OUTPUT", msg)
|
||||
msg = 0
|
||||
}
|
||||
|
||||
$1 ~ /msg(id|str)/ {
|
||||
# Output collected message
|
||||
output_message()
|
||||
# Collect next message
|
||||
msgtype = $1
|
||||
sub(/^msg(id|str)[ \t]*/, "", $0)
|
||||
msg = $0
|
||||
next
|
||||
}
|
||||
|
||||
/^".*"/ {
|
||||
# Append to current message
|
||||
msg = msg "\n" $0
|
||||
}
|
||||
|
||||
END {
|
||||
# Output last collected message
|
||||
output_message()
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
# po2test.sed - Convert Uniforum style .po file to C code for testing.
|
||||
# Copyright (C) 2000,2003 Free Software Foundation, Inc.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 2000.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#
|
||||
# We copy the original message as a comment into the .msg file. But enclose
|
||||
# them with INPUT ( ).
|
||||
#
|
||||
s/^msgid[ ]*"\(.*\)"/INPUT ("\1")/
|
||||
# Clear flag from last substitution and jump if matching
|
||||
tb
|
||||
|
||||
#
|
||||
# Copy the translations as well and enclose them with OUTPUT ( ).
|
||||
#
|
||||
s/^msgstr[ ]*"\(.*\)"/OUTPUT ("\1")/
|
||||
# Clear flag from last substitution and jump if matching
|
||||
tb
|
||||
|
||||
d
|
||||
|
||||
:b
|
||||
# Append the next line.
|
||||
$!N
|
||||
# Check whether second part is a continuation line. If so, before printing
|
||||
# insert '\'.
|
||||
s/\(.*\)")\(\n\)"\(.*\)"/\1\\\2\3")/
|
||||
P
|
||||
ta
|
||||
# No, go to the top and process it. Note that `D' includes a jump to the start!!
|
||||
D
|
||||
# Yes, we found a continuation line.
|
||||
:a
|
||||
# We cannot use the sed command `D' here
|
||||
s/[^\n]*\n//
|
||||
# Clear the substitution flag and do the next line.
|
||||
tb
|
||||
+7
-3
@@ -652,15 +652,19 @@ heap_trim(heap_info *heap, size_t pad)
|
||||
unsigned long pagesz = GLRO(dl_pagesize);
|
||||
mchunkptr top_chunk = top(ar_ptr), p, bck, fwd;
|
||||
heap_info *prev_heap;
|
||||
long new_size, top_size, extra;
|
||||
long new_size, top_size, extra, prev_size, misalign;
|
||||
|
||||
/* Can this heap go away completely? */
|
||||
while(top_chunk == chunk_at_offset(heap, sizeof(*heap))) {
|
||||
prev_heap = heap->prev;
|
||||
p = chunk_at_offset(prev_heap, prev_heap->size - (MINSIZE-2*SIZE_SZ));
|
||||
prev_size = prev_heap->size - (MINSIZE-2*SIZE_SZ);
|
||||
p = chunk_at_offset(prev_heap, prev_size);
|
||||
/* fencepost must be properly aligned. */
|
||||
misalign = ((long) p) & MALLOC_ALIGN_MASK;
|
||||
p = chunk_at_offset(prev_heap, prev_size - misalign);
|
||||
assert(p->size == (0|PREV_INUSE)); /* must be fencepost */
|
||||
p = prev_chunk(p);
|
||||
new_size = chunksize(p) + (MINSIZE-2*SIZE_SZ);
|
||||
new_size = chunksize(p) + (MINSIZE-2*SIZE_SZ) + misalign;
|
||||
assert(new_size>0 && new_size<(long)(2*MINSIZE));
|
||||
if(!prev_inuse(p))
|
||||
new_size += p->prev_size;
|
||||
|
||||
+12
-8
@@ -3868,25 +3868,29 @@ _int_free(mstate av, mchunkptr p, int have_lock)
|
||||
unsigned int idx = fastbin_index(size);
|
||||
fb = &fastbin (av, idx);
|
||||
|
||||
mchunkptr fd;
|
||||
mchunkptr old = *fb;
|
||||
/* Atomically link P to its fastbin: P->FD = *FB; *FB = P; */
|
||||
mchunkptr old = *fb, old2;
|
||||
unsigned int old_idx = ~0u;
|
||||
do
|
||||
{
|
||||
/* Another simple check: make sure the top of the bin is not the
|
||||
record we are going to add (i.e., double free). */
|
||||
/* Check that the top of the bin is not the record we are going to add
|
||||
(i.e., double free). */
|
||||
if (__builtin_expect (old == p, 0))
|
||||
{
|
||||
errstr = "double free or corruption (fasttop)";
|
||||
goto errout;
|
||||
}
|
||||
if (old != NULL)
|
||||
/* Check that size of fastbin chunk at the top is the same as
|
||||
size of the chunk that we are adding. We can dereference OLD
|
||||
only if we have the lock, otherwise it might have already been
|
||||
deallocated. See use of OLD_IDX below for the actual check. */
|
||||
if (have_lock && old != NULL)
|
||||
old_idx = fastbin_index(chunksize(old));
|
||||
p->fd = fd = old;
|
||||
p->fd = old2 = old;
|
||||
}
|
||||
while ((old = catomic_compare_and_exchange_val_rel (fb, p, fd)) != fd);
|
||||
while ((old = catomic_compare_and_exchange_val_rel (fb, p, old2)) != old2);
|
||||
|
||||
if (fd != NULL && __builtin_expect (old_idx != idx, 0))
|
||||
if (have_lock && old != NULL && __builtin_expect (old_idx != idx, 0))
|
||||
{
|
||||
errstr = "invalid fastbin entry (free)";
|
||||
goto errout;
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ tests = tst-typesizes \
|
||||
tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \
|
||||
tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a tst-mutexpi8 \
|
||||
tst-mutexpi9 \
|
||||
tst-spin1 tst-spin2 tst-spin3 \
|
||||
tst-spin1 tst-spin2 tst-spin3 tst-spin4 \
|
||||
tst-cond1 tst-cond2 tst-cond3 tst-cond4 tst-cond5 tst-cond6 tst-cond7 \
|
||||
tst-cond8 tst-cond9 tst-cond10 tst-cond11 tst-cond12 tst-cond13 \
|
||||
tst-cond14 tst-cond15 tst-cond16 tst-cond17 tst-cond18 tst-cond19 \
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
|
||||
.text
|
||||
ENTRY(pthread_spin_lock)
|
||||
ldstub [%o0], %g1
|
||||
1: ldstub [%o0], %g1
|
||||
orcc %g1, 0x0, %g0
|
||||
bne,a 2f
|
||||
ldub [%o0], %g1
|
||||
1: retl
|
||||
retl
|
||||
mov 0, %o0
|
||||
2: orcc %g1, 0x0, %g0
|
||||
bne,a 2b
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
.text
|
||||
ENTRY(pthread_spin_lock)
|
||||
ldstub [%o0], %g1
|
||||
1: ldstub [%o0], %g1
|
||||
brnz,pn %g1, 2f
|
||||
membar #StoreLoad | #StoreStore
|
||||
1: retl
|
||||
retl
|
||||
mov 0, %o0
|
||||
2: ldub [%o0], %g1
|
||||
brnz,pt %g1, 2b
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int count = 0;
|
||||
|
||||
static void *
|
||||
thread_add_one (void *arg)
|
||||
{
|
||||
int tmp;
|
||||
pthread_spinlock_t *lock = (pthread_spinlock_t *) arg;
|
||||
|
||||
/* When do_test holds the lock for 1 sec, the two thread will be
|
||||
in contention for the lock. */
|
||||
if (pthread_spin_lock (lock) != 0)
|
||||
{
|
||||
puts ("thread_add_one(): spin_lock failed");
|
||||
pthread_exit ((void *) 1l);
|
||||
}
|
||||
|
||||
/* sleep 1s before modifying count */
|
||||
tmp = count;
|
||||
sleep (1);
|
||||
count = tmp + 1;
|
||||
|
||||
if (pthread_spin_unlock (lock) != 0)
|
||||
{
|
||||
puts ("thread_add_one(): spin_unlock failed");
|
||||
pthread_exit ((void *) 1l);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
pthread_t thr1, thr2;
|
||||
pthread_spinlock_t lock;
|
||||
int tmp;
|
||||
|
||||
if (pthread_spin_init (&lock, PTHREAD_PROCESS_PRIVATE) != 0)
|
||||
{
|
||||
puts ("spin_init failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (pthread_spin_lock (&lock) != 0)
|
||||
{
|
||||
puts ("1st spin_lock failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (pthread_create (&thr1, NULL, thread_add_one, (void *) &lock) != 0)
|
||||
{
|
||||
puts ("1st pthread_create failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (pthread_create (&thr2, NULL, thread_add_one, (void *) &lock) != 0)
|
||||
{
|
||||
puts ("2nd pthread_create failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* sleep 1s before modifying count */
|
||||
tmp = count;
|
||||
sleep (1);
|
||||
count = tmp + 1;
|
||||
|
||||
if (pthread_spin_unlock (&lock) != 0)
|
||||
{
|
||||
puts ("1st spin_unlock failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
void *status;
|
||||
if (pthread_join (thr1, &status) != 0)
|
||||
{
|
||||
puts ("1st pthread_join failed");
|
||||
return 1;
|
||||
}
|
||||
if (status != NULL)
|
||||
{
|
||||
puts ("failure in the 1st thread");
|
||||
return 1;
|
||||
}
|
||||
if (pthread_join (thr2, &status) != 0)
|
||||
{
|
||||
puts ("2nd pthread_join failed");
|
||||
return 1;
|
||||
}
|
||||
if (status != NULL)
|
||||
{
|
||||
puts ("failure in the 2nd thread");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (count != 3)
|
||||
{
|
||||
printf ("count is %d, should be 3\n", count);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TIMEOUT 5
|
||||
#define TEST_FUNCTION do_test ()
|
||||
#include "../test-skeleton.c"
|
||||
+5
-5
@@ -217,7 +217,7 @@ static int collated_compare (const void *, const void *) __THROW;
|
||||
static const char *
|
||||
next_brace_sub (const char *cp, int flags)
|
||||
{
|
||||
unsigned int depth = 0;
|
||||
size_t depth = 0;
|
||||
while (*cp != '\0')
|
||||
if ((flags & GLOB_NOESCAPE) == 0 && *cp == '\\')
|
||||
{
|
||||
@@ -960,7 +960,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
&& S_ISDIR (st.st_mode))
|
||||
: (__stat64 (dirname, &st64) == 0 && S_ISDIR (st64.st_mode)))))
|
||||
{
|
||||
int newcount = pglob->gl_pathc + pglob->gl_offs;
|
||||
size_t newcount = pglob->gl_pathc + pglob->gl_offs;
|
||||
char **new_gl_pathv;
|
||||
|
||||
if (newcount > UINTPTR_MAX - (1 + 1)
|
||||
@@ -1059,7 +1059,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
appending the results to PGLOB. */
|
||||
for (i = 0; i < dirs.gl_pathc; ++i)
|
||||
{
|
||||
int old_pathc;
|
||||
size_t old_pathc;
|
||||
|
||||
#ifdef SHELL
|
||||
{
|
||||
@@ -1114,7 +1114,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
/* No matches. */
|
||||
if (flags & GLOB_NOCHECK)
|
||||
{
|
||||
int newcount = pglob->gl_pathc + pglob->gl_offs;
|
||||
size_t newcount = pglob->gl_pathc + pglob->gl_offs;
|
||||
char **new_gl_pathv;
|
||||
|
||||
if (newcount > UINTPTR_MAX - 2
|
||||
@@ -1158,7 +1158,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
}
|
||||
else
|
||||
{
|
||||
int old_pathc = pglob->gl_pathc;
|
||||
size_t old_pathc = pglob->gl_pathc;
|
||||
int orig_flags = flags;
|
||||
|
||||
if (meta & 2)
|
||||
|
||||
@@ -25,6 +25,11 @@ if ($ENV{CC}) {
|
||||
} else {
|
||||
$CC= "gcc";
|
||||
}
|
||||
if ($ENV{LD_SO}) {
|
||||
$LD_SO = $ENV{LD_SO};
|
||||
} else {
|
||||
$LD_SO = "";
|
||||
}
|
||||
|
||||
sub usage {
|
||||
print "Usage: test-installation [soversions.mk]\n";
|
||||
@@ -112,6 +117,8 @@ while (<SOVERSIONS>) {
|
||||
$link_libs .= " -l$name";
|
||||
$versions{$name} = $version;
|
||||
}
|
||||
} elsif ($LD_SO ne "") {
|
||||
($ld_so_name, $ld_so_version) = split ('\.so\.', $LD_SO);
|
||||
} else {
|
||||
if (/^ld\.so/) {
|
||||
($ld_so_name, $ld_so_version)= /=(.*)\.so\.(.*)$/;
|
||||
|
||||
@@ -116,6 +116,7 @@ CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
|
||||
|
||||
# We know the test has a format string problem.
|
||||
CFLAGS-tst-sprintf.c = -Wno-format
|
||||
tst-sprintf-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
tst-swprintf-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
test-vfprintf-ENV = LOCPATH=$(common-objpfx)localedata
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -58,5 +59,17 @@ main (void)
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
|
||||
{
|
||||
puts ("cannot set locale");
|
||||
result = 1;
|
||||
}
|
||||
else if (sprintf (buf, "%.8s\n", "Foo: \277") != 7
|
||||
|| strcmp (buf, "Foo: \277\n") != 0)
|
||||
{
|
||||
printf ("sprintf (buf, \"%%.8s\\n\", \"Foo: \\277\") produced '%s' output\n", buf);
|
||||
result = 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+3
-36
@@ -1168,42 +1168,9 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
else if (!is_long && spec != L_('S')) \
|
||||
{ \
|
||||
if (prec != -1) \
|
||||
{ \
|
||||
/* Search for the end of the string, but don't search past \
|
||||
the length (in bytes) specified by the precision. Also \
|
||||
don't use incomplete characters. */ \
|
||||
if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX) == 1) \
|
||||
len = __strnlen (string, prec); \
|
||||
else \
|
||||
{ \
|
||||
/* In case we have a multibyte character set the \
|
||||
situation is more complicated. We must not copy \
|
||||
bytes at the end which form an incomplete character. */\
|
||||
size_t ignore_size = (unsigned) prec > 1024 ? 1024 : prec;\
|
||||
wchar_t ignore[ignore_size]; \
|
||||
const char *str2 = string; \
|
||||
const char *strend = string + prec; \
|
||||
if (strend < string) \
|
||||
strend = (const char *) UINTPTR_MAX; \
|
||||
\
|
||||
mbstate_t ps; \
|
||||
memset (&ps, '\0', sizeof (ps)); \
|
||||
\
|
||||
while (str2 != NULL && str2 < strend) \
|
||||
if (__mbsnrtowcs (ignore, &str2, strend - str2, \
|
||||
ignore_size, &ps) == (size_t) -1) \
|
||||
{ \
|
||||
/* Conversion function has set errno. */ \
|
||||
done = -1; \
|
||||
goto all_done; \
|
||||
} \
|
||||
\
|
||||
if (str2 == NULL) \
|
||||
len = strlen (string); \
|
||||
else \
|
||||
len = str2 - string - (ps.__count & 7); \
|
||||
} \
|
||||
} \
|
||||
/* Search for the end of the string, but don't search past \
|
||||
the length (in bytes) specified by the precision. */ \
|
||||
len = __strnlen (string, prec); \
|
||||
else \
|
||||
len = strlen (string); \
|
||||
} \
|
||||
|
||||
+2
-1
@@ -68,7 +68,8 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
|
||||
tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
|
||||
tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2 \
|
||||
tst-makecontext2 tst-strtod6 tst-unsetenv1 \
|
||||
tst-makecontext3 bug-getcontext bug-fmtmsg1
|
||||
tst-makecontext3 bug-getcontext bug-fmtmsg1 \
|
||||
tst-strtod-overflow
|
||||
|
||||
include ../Makeconfig
|
||||
|
||||
|
||||
+111
-31
@@ -60,6 +60,7 @@ extern unsigned long long int ____strtoull_l_internal (const char *, char **,
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* The gmp headers need some configuration frobs. */
|
||||
#define HAVE_ALLOCA 1
|
||||
@@ -72,7 +73,6 @@ extern unsigned long long int ____strtoull_l_internal (const char *, char **,
|
||||
#include "longlong.h"
|
||||
#include "fpioconst.h"
|
||||
|
||||
#define NDEBUG 1
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
@@ -174,19 +174,19 @@ extern const mp_limb_t _tens_in_limb[MAX_DIG_PER_LIMB + 1];
|
||||
/* Return a floating point number of the needed type according to the given
|
||||
multi-precision number after possible rounding. */
|
||||
static FLOAT
|
||||
round_and_return (mp_limb_t *retval, int exponent, int negative,
|
||||
round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
|
||||
mp_limb_t round_limb, mp_size_t round_bit, int more_bits)
|
||||
{
|
||||
if (exponent < MIN_EXP - 1)
|
||||
{
|
||||
mp_size_t shift = MIN_EXP - 1 - exponent;
|
||||
|
||||
if (shift > MANT_DIG)
|
||||
if (exponent < MIN_EXP - 1 - MANT_DIG)
|
||||
{
|
||||
__set_errno (ERANGE);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
mp_size_t shift = MIN_EXP - 1 - exponent;
|
||||
|
||||
more_bits |= (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0;
|
||||
if (shift == MANT_DIG)
|
||||
/* This is a special case to handle the very seldom case where
|
||||
@@ -233,6 +233,9 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
|
||||
__set_errno (ERANGE);
|
||||
}
|
||||
|
||||
if (exponent > MAX_EXP)
|
||||
goto overflow;
|
||||
|
||||
if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0
|
||||
&& (more_bits || (retval[0] & 1) != 0
|
||||
|| (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0))
|
||||
@@ -258,6 +261,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
|
||||
}
|
||||
|
||||
if (exponent > MAX_EXP)
|
||||
overflow:
|
||||
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
|
||||
|
||||
return MPN2FLOAT (retval, exponent, negative);
|
||||
@@ -271,7 +275,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
|
||||
factor for the resulting number (see code) multiply by it. */
|
||||
static const STRING_TYPE *
|
||||
str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
|
||||
int *exponent
|
||||
intmax_t *exponent
|
||||
#ifndef USE_WIDE_CHAR
|
||||
, const char *decimal, size_t decimal_len, const char *thousands
|
||||
#endif
|
||||
@@ -301,6 +305,7 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
|
||||
cy += __mpn_add_1 (n, n, *nsize, low);
|
||||
if (cy != 0)
|
||||
{
|
||||
assert (*nsize < MPNSIZE);
|
||||
n[*nsize] = cy;
|
||||
++(*nsize);
|
||||
}
|
||||
@@ -335,7 +340,7 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
|
||||
}
|
||||
while (--digcnt > 0);
|
||||
|
||||
if (*exponent > 0 && cnt + *exponent <= MAX_DIG_PER_LIMB)
|
||||
if (*exponent > 0 && *exponent <= MAX_DIG_PER_LIMB - cnt)
|
||||
{
|
||||
low *= _tens_in_limb[*exponent];
|
||||
start = _tens_in_limb[cnt + *exponent];
|
||||
@@ -355,7 +360,10 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
|
||||
cy = __mpn_mul_1 (n, n, *nsize, start);
|
||||
cy += __mpn_add_1 (n, n, *nsize, low);
|
||||
if (cy != 0)
|
||||
n[(*nsize)++] = cy;
|
||||
{
|
||||
assert (*nsize < MPNSIZE);
|
||||
n[(*nsize)++] = cy;
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
@@ -413,7 +421,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
{
|
||||
int negative; /* The sign of the number. */
|
||||
MPN_VAR (num); /* MP representation of the number. */
|
||||
int exponent; /* Exponent of the number. */
|
||||
intmax_t exponent; /* Exponent of the number. */
|
||||
|
||||
/* Numbers starting `0X' or `0x' have to be processed with base 16. */
|
||||
int base = 10;
|
||||
@@ -435,7 +443,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
/* Points at the character following the integer and fractional digits. */
|
||||
const STRING_TYPE *expp;
|
||||
/* Total number of digit and number of digits in integer part. */
|
||||
int dig_no, int_no, lead_zero;
|
||||
size_t dig_no, int_no, lead_zero;
|
||||
/* Contains the last character read. */
|
||||
CHAR_TYPE c;
|
||||
|
||||
@@ -767,7 +775,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
are all or any is really a fractional digit will be decided
|
||||
later. */
|
||||
int_no = dig_no;
|
||||
lead_zero = int_no == 0 ? -1 : 0;
|
||||
lead_zero = int_no == 0 ? (size_t) -1 : 0;
|
||||
|
||||
/* Read the fractional digits. A special case are the 'american
|
||||
style' numbers like `16.' i.e. with decimal point but without
|
||||
@@ -789,12 +797,13 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
(base == 16 && ({ CHAR_TYPE lo = TOLOWER (c);
|
||||
lo >= L_('a') && lo <= L_('f'); })))
|
||||
{
|
||||
if (c != L_('0') && lead_zero == -1)
|
||||
if (c != L_('0') && lead_zero == (size_t) -1)
|
||||
lead_zero = dig_no - int_no;
|
||||
++dig_no;
|
||||
c = *++cp;
|
||||
}
|
||||
}
|
||||
assert (dig_no <= (uintmax_t) INTMAX_MAX);
|
||||
|
||||
/* Remember start of exponent (if any). */
|
||||
expp = cp;
|
||||
@@ -817,24 +826,80 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
|
||||
if (c >= L_('0') && c <= L_('9'))
|
||||
{
|
||||
int exp_limit;
|
||||
intmax_t exp_limit;
|
||||
|
||||
/* Get the exponent limit. */
|
||||
if (base == 16)
|
||||
exp_limit = (exp_negative ?
|
||||
-MIN_EXP + MANT_DIG + 4 * int_no :
|
||||
MAX_EXP - 4 * int_no + 4 * lead_zero + 3);
|
||||
{
|
||||
if (exp_negative)
|
||||
{
|
||||
assert (int_no <= (uintmax_t) (INTMAX_MAX
|
||||
+ MIN_EXP - MANT_DIG) / 4);
|
||||
exp_limit = -MIN_EXP + MANT_DIG + 4 * (intmax_t) int_no;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (int_no)
|
||||
{
|
||||
assert (lead_zero == 0
|
||||
&& int_no <= (uintmax_t) INTMAX_MAX / 4);
|
||||
exp_limit = MAX_EXP - 4 * (intmax_t) int_no + 3;
|
||||
}
|
||||
else if (lead_zero == (size_t) -1)
|
||||
{
|
||||
/* The number is zero and this limit is
|
||||
arbitrary. */
|
||||
exp_limit = MAX_EXP + 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert (lead_zero
|
||||
<= (uintmax_t) (INTMAX_MAX - MAX_EXP - 3) / 4);
|
||||
exp_limit = (MAX_EXP
|
||||
+ 4 * (intmax_t) lead_zero
|
||||
+ 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
exp_limit = (exp_negative ?
|
||||
-MIN_10_EXP + MANT_DIG + int_no :
|
||||
MAX_10_EXP - int_no + lead_zero + 1);
|
||||
{
|
||||
if (exp_negative)
|
||||
{
|
||||
assert (int_no
|
||||
<= (uintmax_t) (INTMAX_MAX + MIN_10_EXP - MANT_DIG));
|
||||
exp_limit = -MIN_10_EXP + MANT_DIG + (intmax_t) int_no;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (int_no)
|
||||
{
|
||||
assert (lead_zero == 0
|
||||
&& int_no <= (uintmax_t) INTMAX_MAX);
|
||||
exp_limit = MAX_10_EXP - (intmax_t) int_no + 1;
|
||||
}
|
||||
else if (lead_zero == (size_t) -1)
|
||||
{
|
||||
/* The number is zero and this limit is
|
||||
arbitrary. */
|
||||
exp_limit = MAX_10_EXP + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert (lead_zero
|
||||
<= (uintmax_t) (INTMAX_MAX - MAX_10_EXP - 1));
|
||||
exp_limit = MAX_10_EXP + (intmax_t) lead_zero + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (exp_limit < 0)
|
||||
exp_limit = 0;
|
||||
|
||||
do
|
||||
{
|
||||
exponent *= 10;
|
||||
exponent += c - L_('0');
|
||||
|
||||
if (__builtin_expect (exponent > exp_limit, 0))
|
||||
if (__builtin_expect ((exponent > exp_limit / 10
|
||||
|| (exponent == exp_limit / 10
|
||||
&& c - L_('0') > exp_limit % 10)), 0))
|
||||
/* The exponent is too large/small to represent a valid
|
||||
number. */
|
||||
{
|
||||
@@ -843,7 +908,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
/* We have to take care for special situation: a joker
|
||||
might have written "0.0e100000" which is in fact
|
||||
zero. */
|
||||
if (lead_zero == -1)
|
||||
if (lead_zero == (size_t) -1)
|
||||
result = negative ? -0.0 : 0.0;
|
||||
else
|
||||
{
|
||||
@@ -862,6 +927,9 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
exponent *= 10;
|
||||
exponent += c - L_('0');
|
||||
|
||||
c = *++cp;
|
||||
}
|
||||
while (c >= L_('0') && c <= L_('9'));
|
||||
@@ -930,7 +998,14 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
}
|
||||
#endif
|
||||
startp += lead_zero + decimal_len;
|
||||
exponent -= base == 16 ? 4 * lead_zero : lead_zero;
|
||||
assert (lead_zero <= (base == 16
|
||||
? (uintmax_t) INTMAX_MAX / 4
|
||||
: (uintmax_t) INTMAX_MAX));
|
||||
assert (lead_zero <= (base == 16
|
||||
? ((uintmax_t) exponent
|
||||
- (uintmax_t) INTMAX_MIN) / 4
|
||||
: ((uintmax_t) exponent - (uintmax_t) INTMAX_MIN)));
|
||||
exponent -= base == 16 ? 4 * (intmax_t) lead_zero : (intmax_t) lead_zero;
|
||||
dig_no -= lead_zero;
|
||||
}
|
||||
|
||||
@@ -972,7 +1047,10 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
}
|
||||
|
||||
/* Adjust the exponent for the bits we are shifting in. */
|
||||
exponent += bits - 1 + (int_no - 1) * 4;
|
||||
assert (int_no <= (uintmax_t) (exponent < 0
|
||||
? (INTMAX_MAX - bits + 1) / 4
|
||||
: (INTMAX_MAX - exponent - bits + 1) / 4));
|
||||
exponent += bits - 1 + ((intmax_t) int_no - 1) * 4;
|
||||
|
||||
while (--dig_no > 0 && idx >= 0)
|
||||
{
|
||||
@@ -1024,13 +1102,15 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
really integer digits or belong to the fractional part; i.e. we normalize
|
||||
123e-2 to 1.23. */
|
||||
{
|
||||
register int incr = (exponent < 0 ? MAX (-int_no, exponent)
|
||||
: MIN (dig_no - int_no, exponent));
|
||||
register intmax_t incr = (exponent < 0
|
||||
? MAX (-(intmax_t) int_no, exponent)
|
||||
: MIN ((intmax_t) dig_no - (intmax_t) int_no,
|
||||
exponent));
|
||||
int_no += incr;
|
||||
exponent -= incr;
|
||||
}
|
||||
|
||||
if (__builtin_expect (int_no + exponent > MAX_10_EXP + 1, 0))
|
||||
if (__builtin_expect (exponent > MAX_10_EXP + 1 - (intmax_t) int_no, 0))
|
||||
{
|
||||
__set_errno (ERANGE);
|
||||
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
|
||||
@@ -1215,7 +1295,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
digits we should have enough bits for the result. The remaining
|
||||
decimal digits give us the information that more bits are following.
|
||||
This can be used while rounding. (Two added as a safety margin.) */
|
||||
if (dig_no - int_no > (MANT_DIG - bits + 2) / 3 + 2)
|
||||
if ((intmax_t) dig_no > (intmax_t) int_no + (MANT_DIG - bits + 2) / 3 + 2)
|
||||
{
|
||||
dig_no = int_no + (MANT_DIG - bits + 2) / 3 + 2;
|
||||
more_bits = 1;
|
||||
@@ -1223,7 +1303,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
|
||||
else
|
||||
more_bits = 0;
|
||||
|
||||
neg_exp = dig_no - int_no - exponent;
|
||||
neg_exp = (intmax_t) dig_no - (intmax_t) int_no - exponent;
|
||||
|
||||
/* Construct the denominator. */
|
||||
densize = 0;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/* Test for integer/buffer overflow in strtod.
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define EXPONENT "e-2147483649"
|
||||
#define SIZE 214748364
|
||||
|
||||
static int
|
||||
do_test (void)
|
||||
{
|
||||
char *p = malloc (1 + SIZE + sizeof (EXPONENT));
|
||||
if (p == NULL)
|
||||
{
|
||||
puts ("malloc failed, cannot test for overflow");
|
||||
return 0;
|
||||
}
|
||||
p[0] = '1';
|
||||
memset (p + 1, '0', SIZE);
|
||||
memcpy (p + 1 + SIZE, EXPONENT, sizeof (EXPONENT));
|
||||
double d = strtod (p, NULL);
|
||||
if (d != 0)
|
||||
{
|
||||
printf ("strtod returned wrong value: %a\n", d);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define TEST_FUNCTION do_test ()
|
||||
#include "../test-skeleton.c"
|
||||
@@ -348,6 +348,34 @@ check (void)
|
||||
FOR_EACH_IMPL (impl, 0)
|
||||
check_result (impl, s1 + i1, s2 + i2, exp_result);
|
||||
}
|
||||
|
||||
/* Test cases where there are multiple zero bytes after the first. */
|
||||
|
||||
for (size_t i = 0; i < 16 + 1; i++)
|
||||
{
|
||||
s1[i] = 0x00;
|
||||
s2[i] = 0x00;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < 16; i++)
|
||||
{
|
||||
int exp_result;
|
||||
|
||||
for (int val = 0x01; val < 0x100; val++)
|
||||
{
|
||||
for (size_t j = 0; j < i; j++)
|
||||
{
|
||||
s1[j] = val;
|
||||
s2[j] = val;
|
||||
}
|
||||
|
||||
s2[i] = val;
|
||||
|
||||
exp_result = SIMPLE_STRCMP (s1, s2);
|
||||
FOR_EACH_IMPL (impl, 0)
|
||||
check_result (impl, s1, s2, exp_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Test and measure strncasecmp functions.
|
||||
Copyright (C) 1999, 2002, 2003, 2005, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
|
||||
|
||||
@@ -251,9 +251,9 @@ do_random_tests (void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Regression test for BZ #12205 */
|
||||
static void
|
||||
check1 (void)
|
||||
bz12205 (void)
|
||||
{
|
||||
static char cp [4096+16] __attribute__ ((aligned(4096)));
|
||||
static char gotrel[4096] __attribute__ ((aligned(4096)));
|
||||
@@ -270,6 +270,15 @@ check1 (void)
|
||||
check_result (impl, s1, s2, n, exp_result);
|
||||
}
|
||||
|
||||
/* Regression test for BZ #14195 */
|
||||
static void
|
||||
bz14195 (void)
|
||||
{
|
||||
const char *empty_string = "";
|
||||
FOR_EACH_IMPL (impl, 0)
|
||||
check_result (impl, empty_string, "", 5, 0);
|
||||
}
|
||||
|
||||
int
|
||||
test_main (void)
|
||||
{
|
||||
@@ -277,7 +286,8 @@ test_main (void)
|
||||
|
||||
test_init ();
|
||||
|
||||
check1 ();
|
||||
bz12205 ();
|
||||
bz14195 ();
|
||||
|
||||
printf ("%23s", "");
|
||||
FOR_EACH_IMPL (impl, 0)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <rpc/types.h>
|
||||
#include "rpc/types.h"
|
||||
#include "rpc_parse.h"
|
||||
#include "rpc_util.h"
|
||||
#include "proto.h"
|
||||
|
||||
@@ -2445,7 +2445,7 @@ L(less16bytes_sncmp):
|
||||
# endif
|
||||
jne L(neq_sncmp)
|
||||
test %cl, %cl
|
||||
je L(eq)
|
||||
je L(eq_sncmp)
|
||||
|
||||
cmp $1, REM
|
||||
je L(eq_sncmp)
|
||||
|
||||
@@ -6,8 +6,9 @@ sysdep-LDFLAGS += -msoft-float
|
||||
endif
|
||||
|
||||
ifeq ($(subdir),gmon)
|
||||
sysdep_routines += ppc-mcount
|
||||
sysdep_routines += ppc-mcount compat-ppc-mcount
|
||||
static-only-routines += ppc-mcount
|
||||
shared-only-routines += compat-ppc-mcount
|
||||
endif
|
||||
|
||||
ifeq ($(subdir),misc)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <shlib-compat.h>
|
||||
|
||||
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_15)
|
||||
|
||||
compat_text_section
|
||||
# define _mcount __compat_mcount
|
||||
# include "ppc-mcount.S"
|
||||
# undef _mcount
|
||||
|
||||
compat_symbol (libc, __compat_mcount, _mcount, GLIBC_2_0)
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* PowerPC-specific implementation of profiling support.
|
||||
Copyright (C) 1997, 1999, 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -57,7 +57,11 @@ ENTRY(_mcount)
|
||||
stw r4, 44(r1)
|
||||
cfi_offset (lr, -4)
|
||||
stw r5, 8(r1)
|
||||
#ifndef SHARED
|
||||
bl JUMPTARGET(__mcount_internal)
|
||||
#else
|
||||
bl __mcount_internal@local
|
||||
#endif
|
||||
/* Restore the registers... */
|
||||
lwz r6, 8(r1)
|
||||
lwz r0, 44(r1)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* Machine-dependent ELF dynamic relocation inline functions. SH version.
|
||||
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2011
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -116,6 +115,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
||||
}
|
||||
|
||||
#define ELF_MACHINE_RUNTIME_FIXUP_ARGS int plt_type
|
||||
#define ELF_MACHINE_RUNTIME_FIXUP_PARAMS plt_type
|
||||
|
||||
/* Mask identifying addresses reserved for the user program,
|
||||
where the dynamic linker should not map anything. */
|
||||
|
||||
@@ -121,6 +121,37 @@ ENTRY(strcmp)
|
||||
movleu %xcc, -1, %o0
|
||||
srlx rTMP1, 7, rTMP1
|
||||
|
||||
/* In order not to be influenced by bytes after the zero byte, we
|
||||
* have to retain only the highest bit in the mask for the comparison
|
||||
* with rSTRXOR to work properly.
|
||||
*/
|
||||
mov 0, rTMP2
|
||||
andcc rTMP1, 0x0100, %g0
|
||||
|
||||
movne %xcc, 8, rTMP2
|
||||
sllx rTMP1, 63 - 16, %o1
|
||||
|
||||
movrlz %o1, 16, rTMP2
|
||||
sllx rTMP1, 63 - 24, %o1
|
||||
|
||||
movrlz %o1, 24, rTMP2
|
||||
sllx rTMP1, 63 - 32, %o1
|
||||
|
||||
movrlz %o1, 32, rTMP2
|
||||
sllx rTMP1, 63 - 40, %o1
|
||||
|
||||
movrlz %o1, 40, rTMP2
|
||||
sllx rTMP1, 63 - 48, %o1
|
||||
|
||||
movrlz %o1, 48, rTMP2
|
||||
sllx rTMP1, 63 - 56, %o1
|
||||
|
||||
movrlz %o1, 56, rTMP2
|
||||
|
||||
srlx rTMP1, rTMP2, rTMP1
|
||||
|
||||
sllx rTMP1, rTMP2, rTMP1
|
||||
|
||||
cmp rTMP1, rSTRXOR
|
||||
retl
|
||||
movgu %xcc, 0, %o0
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
/* Flags for eventfd. */
|
||||
enum
|
||||
{
|
||||
EFD_SEMAPHORE = 0x000001,
|
||||
#define EFD_SEMAPHORE EFD_SEMAPHORE
|
||||
EFD_CLOEXEC = 0x400000,
|
||||
#define EFD_CLOEXEC EFD_CLOEXEC
|
||||
EFD_NONBLOCK = 0x004000
|
||||
|
||||
@@ -253,3 +253,30 @@ enum __priority_which
|
||||
PRIO_USER = 2 /* WHO is a user ID. */
|
||||
#define PRIO_USER PRIO_USER
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Modify and return resource limits of a process atomically. */
|
||||
# ifndef __USE_FILE_OFFSET64
|
||||
extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
|
||||
const struct rlimit *__new_limit,
|
||||
struct rlimit *__old_limit) __THROW;
|
||||
# else
|
||||
# ifdef __REDIRECT_NTH
|
||||
extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
|
||||
enum __rlimit_resource __resource,
|
||||
const struct rlimit *__new_limit,
|
||||
struct rlimit *__old_limit), prlimit64);
|
||||
# else
|
||||
# define prlimit prlimit64
|
||||
# endif
|
||||
# endif
|
||||
# ifdef __USE_LARGEFILE64
|
||||
extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
|
||||
const struct rlimit64 *__new_limit,
|
||||
struct rlimit64 *__old_limit) __THROW;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Inline math functions for i387 and SSE.
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2014 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -382,7 +382,7 @@ __END_NAMESPACE_C99
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef __x86_64__
|
||||
#ifndef __SSE2_MATH__
|
||||
# if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
|
||||
&& defined __OPTIMIZE__)
|
||||
|
||||
@@ -965,4 +965,4 @@ __inline_mathcode2 (__ieee754_atan2, __y, __x,
|
||||
return __value;)
|
||||
# endif
|
||||
|
||||
#endif /* !__x86_64__ */
|
||||
#endif /* !__SSE2_MATH__ */
|
||||
|
||||
@@ -156,6 +156,9 @@ __init_cpu_features (void)
|
||||
/* Determine if AVX is usable. */
|
||||
if (CPUID_AVX)
|
||||
__cpu_features.feature[index_AVX_Usable] |= bit_AVX_Usable;
|
||||
/* Determine if FMA is usable. */
|
||||
if (CPUID_FMA)
|
||||
__cpu_features.feature[index_FMA_Usable] |= bit_FMA_Usable;
|
||||
/* Determine if FMA4 is usable. */
|
||||
if (CPUID_FMA4)
|
||||
__cpu_features.feature[index_FMA4_Usable] |= bit_FMA4_Usable;
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
#define bit_Fast_Unaligned_Load (1 << 4)
|
||||
#define bit_Prefer_PMINUB_for_stringop (1 << 5)
|
||||
#define bit_AVX_Usable (1 << 6)
|
||||
#define bit_FMA4_Usable (1 << 7)
|
||||
#define bit_FMA_Usable (1 << 7)
|
||||
#define bit_FMA4_Usable (1 << 8)
|
||||
|
||||
/* CPUID Feature flags. */
|
||||
#define bit_SSE2 (1 << 26)
|
||||
@@ -56,6 +57,7 @@
|
||||
# define index_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE
|
||||
# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE
|
||||
# define index_AVX_Usable FEATURE_INDEX_1*FEATURE_SIZE
|
||||
# define index_FMA_Usable FEATURE_INDEX_1*FEATURE_SIZE
|
||||
# define index_FMA4_Usable FEATURE_INDEX_1*FEATURE_SIZE
|
||||
|
||||
#else /* __ASSEMBLER__ */
|
||||
@@ -131,6 +133,8 @@ extern const struct cpu_features *__get_cpu_features (void)
|
||||
HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_OSXSAVE)
|
||||
# define CPUID_AVX \
|
||||
HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_AVX)
|
||||
# define CPUID_FMA \
|
||||
HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_FMA)
|
||||
# define CPUID_FMA4 \
|
||||
HAS_CPUID_FLAG (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4)
|
||||
|
||||
@@ -140,7 +144,6 @@ extern const struct cpu_features *__get_cpu_features (void)
|
||||
# define HAS_SSSE3 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSSE3)
|
||||
# define HAS_SSE4_1 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_1)
|
||||
# define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_2)
|
||||
# define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_FMA)
|
||||
|
||||
# define index_Fast_Rep_String FEATURE_INDEX_1
|
||||
# define index_Fast_Copy_Backward FEATURE_INDEX_1
|
||||
@@ -148,6 +151,7 @@ extern const struct cpu_features *__get_cpu_features (void)
|
||||
# define index_Prefer_SSE_for_memop FEATURE_INDEX_1
|
||||
# define index_Fast_Unaligned_Load FEATURE_INDEX_1
|
||||
# define index_AVX_Usable FEATURE_INDEX_1
|
||||
# define index_FMA_Usable FEATURE_INDEX_1
|
||||
# define index_FMA4_Usable FEATURE_INDEX_1
|
||||
|
||||
# define HAS_ARCH_FEATURE(name) \
|
||||
@@ -159,6 +163,7 @@ extern const struct cpu_features *__get_cpu_features (void)
|
||||
# define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
|
||||
# define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load)
|
||||
# define HAS_AVX HAS_ARCH_FEATURE (AVX_Usable)
|
||||
# define HAS_FMA HAS_ARCH_FEATURE (FMA_Usable)
|
||||
# define HAS_FMA4 HAS_ARCH_FEATURE (FMA4_Usable)
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
Reference in New Issue
Block a user