From d436a9f71094ec7fc8e946058af20a1c167df791 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 23 Feb 2001 20:29:25 +0000 Subject: [PATCH] Update. 2001-02-23 Andreas Jaeger * string/tester.c (test_strtok_r): Add testcase. (test_strtok_r): Always initialize cp for proper checking. * sysdeps/generic/strtok.c (strtok): Handle case of first strtok returning NULL correctly. Patch by Fumitoshi UKAI . * sysdeps/generic/strtok_r.c (__strtok_r): Likewise. 2001-02-23 Ulrich Drepper * sysdeps/unix/sysv/aix/bits/types.h: Define __need_NULL before including . * sysdeps/unix/sysv/aix/write.c: Define alias __libc_write. * include/libc-symbols.h (weak_alias): Don't use .weak if HAVE_ASM_GLOBAL_DOT_NAME is defined. Patches by Michael Keezer . * sysdeps/generic/ftime.c: Don't include at all. Patch by Michael Keezer . * sysdeps/unix/sysv/aix/Dist: Remove restf.S and savef.S. * sysdeps/unix/sysv/aix/Makefile [$(subdir) == misc] (sysdep_routines): Remove restf.S and savef.S. * sysdeps/unix/sysv/aix/restf.S. Removed. * sysdeps/unix/sysv/aix/savef.S. Removed. * sysdeps/powerpc/fprrest.S: Use C_TEXT to define label. Also define alternative names used on some platforms. * sysdeps/powerpc/fprsave.S: Likewise. * sysdeps/powerpc/gprrest0.S: Likewise. * sysdeps/powerpc/gprrest1.S: Likewise. * sysdeps/powerpc/gprsave0.S: Likewise. * sysdeps/powerpc/gprsave1.S: Likewise. Patch by Michael Keezer . --- ChangeLog | 36 +++++++++++++++++++++++ include/libc-symbols.h | 4 +-- string/tester.c | 37 +++++++++++++++--------- sysdeps/generic/ftime.c | 3 +- sysdeps/generic/strtok.c | 7 +++-- sysdeps/generic/strtok_r.c | 7 +++-- sysdeps/unix/sysv/aix/Dist | 2 -- sysdeps/unix/sysv/aix/Makefile | 2 +- sysdeps/unix/sysv/aix/bits/types.h | 1 + sysdeps/unix/sysv/aix/restf.S | 58 -------------------------------------- sysdeps/unix/sysv/aix/savef.S | 58 -------------------------------------- sysdeps/unix/sysv/aix/write.c | 3 +- 12 files changed, 77 insertions(+), 141 deletions(-) delete mode 100644 sysdeps/unix/sysv/aix/restf.S delete mode 100644 sysdeps/unix/sysv/aix/savef.S diff --git a/ChangeLog b/ChangeLog index 78eecd6..b723a67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2001-02-23 Andreas Jaeger + + * string/tester.c (test_strtok_r): Add testcase. + (test_strtok_r): Always initialize cp for proper checking. + + * sysdeps/generic/strtok.c (strtok): Handle case of first strtok + returning NULL correctly. + Patch by Fumitoshi UKAI . + * sysdeps/generic/strtok_r.c (__strtok_r): Likewise. + +2001-02-23 Ulrich Drepper + + * sysdeps/unix/sysv/aix/bits/types.h: Define __need_NULL before + including . + * sysdeps/unix/sysv/aix/write.c: Define alias __libc_write. + * include/libc-symbols.h (weak_alias): Don't use .weak if + HAVE_ASM_GLOBAL_DOT_NAME is defined. + Patches by Michael Keezer . + + * sysdeps/generic/ftime.c: Don't include at all. + Patch by Michael Keezer . + + * sysdeps/unix/sysv/aix/Dist: Remove restf.S and savef.S. + * sysdeps/unix/sysv/aix/Makefile [$(subdir) == misc] + (sysdep_routines): Remove restf.S and savef.S. + * sysdeps/unix/sysv/aix/restf.S. Removed. + * sysdeps/unix/sysv/aix/savef.S. Removed. + * sysdeps/powerpc/fprrest.S: Use C_TEXT to define label. Also define + alternative names used on some platforms. + * sysdeps/powerpc/fprsave.S: Likewise. + * sysdeps/powerpc/gprrest0.S: Likewise. + * sysdeps/powerpc/gprrest1.S: Likewise. + * sysdeps/powerpc/gprsave0.S: Likewise. + * sysdeps/powerpc/gprsave1.S: Likewise. + Patch by Michael Keezer . + 2001-02-22 Ulrich Drepper * sysdeps/i386/elf/start.S (_fp_hw): Actually define label. diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 6cac04b..3016adf 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -1,6 +1,6 @@ /* Support macros for making weak and strong aliases for symbols, and for using symbol sets and linker warnings with GNU ld. - Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1995,1996,1997,1998,2000,2001 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 @@ -154,7 +154,7 @@ # define weak_alias(original, alias) \ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \ - .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ + ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original) # else # define weak_alias(original, alias) \ diff --git a/string/tester.c b/string/tester.c index 1369b21..38a7580 100644 --- a/string/tester.c +++ b/string/tester.c @@ -1,5 +1,5 @@ /* Tester for string functions. - Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1995-2000, 2001 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 @@ -759,23 +759,28 @@ test_strtok_r (void) { it = "strtok_r"; (void) strcpy(one, "first, second, third"); + cp = NULL; /* Always initialize cp to make sure it doesn't point to some old data. */ equal(strtok_r(one, ", ", &cp), "first", 1); /* Basic test. */ equal(one, "first", 2); equal(strtok_r((char *)NULL, ", ", &cp), "second", 3); equal(strtok_r((char *)NULL, ", ", &cp), "third", 4); check(strtok_r((char *)NULL, ", ", &cp) == NULL, 5); (void) strcpy(one, ", first, "); + cp = NULL; equal(strtok_r(one, ", ", &cp), "first", 6); /* Extra delims, 1 tok. */ check(strtok_r((char *)NULL, ", ", &cp) == NULL, 7); (void) strcpy(one, "1a, 1b; 2a, 2b"); + cp = NULL; equal(strtok_r(one, ", ", &cp), "1a", 8); /* Changing delim lists. */ equal(strtok_r((char *)NULL, "; ", &cp), "1b", 9); equal(strtok_r((char *)NULL, ", ", &cp), "2a", 10); (void) strcpy(two, "x-y"); + cp = NULL; equal(strtok_r(two, "-", &cp), "x", 11); /* New string before done. */ equal(strtok_r((char *)NULL, "-", &cp), "y", 12); check(strtok_r((char *)NULL, "-", &cp) == NULL, 13); (void) strcpy(one, "a,b, c,, ,d"); + cp = NULL; equal(strtok_r(one, ", ", &cp), "a", 14); /* Different separators. */ equal(strtok_r((char *)NULL, ", ", &cp), "b", 15); equal(strtok_r((char *)NULL, " ,", &cp), "c", 16); /* Permute list too. */ @@ -783,25 +788,31 @@ test_strtok_r (void) check(strtok_r((char *)NULL, ", ", &cp) == NULL, 18); check(strtok_r((char *)NULL, ", ", &cp) == NULL, 19); /* Persistence. */ (void) strcpy(one, ", "); + cp = NULL; check(strtok_r(one, ", ", &cp) == NULL, 20); /* No tokens. */ (void) strcpy(one, ""); + cp = NULL; check(strtok_r(one, ", ", &cp) == NULL, 21); /* Empty string. */ + check(strtok_r((char *)NULL, ", ", &cp) == NULL, 22); /* Persistence. */ (void) strcpy(one, "abc"); - equal(strtok_r(one, ", ", &cp), "abc", 22); /* No delimiters. */ - check(strtok_r((char *)NULL, ", ", &cp) == NULL, 23); + cp = NULL; + equal(strtok_r(one, ", ", &cp), "abc", 23); /* No delimiters. */ + check(strtok_r((char *)NULL, ", ", &cp) == NULL, 24); (void) strcpy(one, "abc"); - equal(strtok_r(one, "", &cp), "abc", 24); /* Empty delimiter list. */ - check(strtok_r((char *)NULL, "", &cp) == NULL, 25); + cp = NULL; + equal(strtok_r(one, "", &cp), "abc", 25); /* Empty delimiter list. */ + check(strtok_r((char *)NULL, "", &cp) == NULL, 26); (void) strcpy(one, "abcdefgh"); (void) strcpy(one, "a,b,c"); - equal(strtok_r(one, ",", &cp), "a", 26); /* Basics again... */ - equal(strtok_r((char *)NULL, ",", &cp), "b", 27); - equal(strtok_r((char *)NULL, ",", &cp), "c", 28); - check(strtok_r((char *)NULL, ",", &cp) == NULL, 29); - equal(one+6, "gh", 30); /* Stomped past end? */ - equal(one, "a", 31); /* Stomped old tokens? */ - equal(one+2, "b", 32); - equal(one+4, "c", 33); + cp = NULL; + equal(strtok_r(one, ",", &cp), "a", 27); /* Basics again... */ + equal(strtok_r((char *)NULL, ",", &cp), "b", 28); + equal(strtok_r((char *)NULL, ",", &cp), "c", 29); + check(strtok_r((char *)NULL, ",", &cp) == NULL, 30); + equal(one+6, "gh", 31); /* Stomped past end? */ + equal(one, "a", 32); /* Stomped old tokens? */ + equal(one+2, "b", 33); + equal(one+4, "c", 34); } static void diff --git a/sysdeps/generic/ftime.c b/sysdeps/generic/ftime.c index 3e9852c..db692fa 100644 --- a/sysdeps/generic/ftime.c +++ b/sysdeps/generic/ftime.c @@ -16,10 +16,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include -#include -#include int ftime (timebuf) diff --git a/sysdeps/generic/strtok.c b/sysdeps/generic/strtok.c index b6f9523..451fd1e 100644 --- a/sysdeps/generic/strtok.c +++ b/sysdeps/generic/strtok.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1991,1996,1997,1999,2000,2001 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 @@ -45,7 +45,10 @@ strtok (s, delim) /* Scan leading delimiters. */ s += strspn (s, delim); if (*s == '\0') - return NULL; + { + olds = s; + return NULL; + } /* Find the end of the token. */ token = s; diff --git a/sysdeps/generic/strtok_r.c b/sysdeps/generic/strtok_r.c index 4acda14..7e6d774 100644 --- a/sysdeps/generic/strtok_r.c +++ b/sysdeps/generic/strtok_r.c @@ -1,5 +1,5 @@ /* Reentrant string tokenizer. Generic version. - Copyright (C) 1991, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1991, 1996, 1997, 1998, 1999, 2001 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 @@ -46,7 +46,10 @@ __strtok_r (s, delim, save_ptr) /* Scan leading delimiters. */ s += strspn (s, delim); if (*s == '\0') - return NULL; + { + *save_ptr = s; + return NULL; + } /* Find the end of the token. */ token = s; diff --git a/sysdeps/unix/sysv/aix/Dist b/sysdeps/unix/sysv/aix/Dist index bce7330..0482d24 100644 --- a/sysdeps/unix/sysv/aix/Dist +++ b/sysdeps/unix/sysv/aix/Dist @@ -5,5 +5,3 @@ kernel_proto.h bits/utmpx.h gnu/lib-names.h uitrunc.c -savef.S -restf.S diff --git a/sysdeps/unix/sysv/aix/Makefile b/sysdeps/unix/sysv/aix/Makefile index 6c9ce11..9aa48d1 100644 --- a/sysdeps/unix/sysv/aix/Makefile +++ b/sysdeps/unix/sysv/aix/Makefile @@ -6,7 +6,7 @@ static-start-installed-name = /usr/lib/crt0.o ifeq ($(subdir),misc) -sysdep_routines += dl-open dl-sym dl-close restf savef uitrunc +sysdep_routines += dl-open dl-sym dl-close uitrunc endif ifeq ($(subdir),login) diff --git a/sysdeps/unix/sysv/aix/bits/types.h b/sysdeps/unix/sysv/aix/bits/types.h index cd57291..df75454 100644 --- a/sysdeps/unix/sysv/aix/bits/types.h +++ b/sysdeps/unix/sysv/aix/bits/types.h @@ -25,6 +25,7 @@ #include +#define __need_NULL #define __need_size_t #include diff --git a/sysdeps/unix/sysv/aix/restf.S b/sysdeps/unix/sysv/aix/restf.S deleted file mode 100644 index 049627e..0000000 --- a/sysdeps/unix/sysv/aix/restf.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2000 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include - -ENTRY(_restf_all) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf14) -C_TEXT(_restf14): lfd fp14,-144(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf15) -C_TEXT(_restf15): lfd fp15,-136(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf16) -C_TEXT(_restf16): lfd fp16,-128(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf17) -C_TEXT(_restf17): lfd fp17,-120(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf18) -C_TEXT(_restf18): lfd fp18,-112(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf19) -C_TEXT(_restf19): lfd fp19,-104(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf20) -C_TEXT(_restf20): lfd fp20,-96(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf21) -C_TEXT(_restf21): lfd fp21,-88(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf22) -C_TEXT(_restf22): lfd fp22,-80(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf23) -C_TEXT(_restf23): lfd fp23,-72(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf24) -C_TEXT(_restf24): lfd fp24,-64(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf25) -C_TEXT(_restf25): lfd fp25,-56(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf26) -C_TEXT(_restf26): lfd fp26,-48(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf27) -C_TEXT(_restf27): lfd fp27,-40(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf28) -C_TEXT(_restf28): lfd fp28,-32(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf29) -C_TEXT(_restf29): lfd fp29,-24(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf30) -C_TEXT(_restf30): lfd fp30,-16(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_restf31) -C_TEXT(_restf31): lfd fp31,-8(r11) - blr diff --git a/sysdeps/unix/sysv/aix/savef.S b/sysdeps/unix/sysv/aix/savef.S deleted file mode 100644 index 4c10d6e..0000000 --- a/sysdeps/unix/sysv/aix/savef.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 2000 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include - -ENTRY(_savef_all) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef14) -C_TEXT(_savef14): stfd fp14,-144(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef15) -C_TEXT(_savef15): stfd fp15,-136(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef16) -C_TEXT(_savef16): stfd fp16,-128(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef17) -C_TEXT(_savef17): stfd fp17,-120(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef18) -C_TEXT(_savef18): stfd fp18,-112(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef19) -C_TEXT(_savef19): stfd fp19,-104(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef20) -C_TEXT(_savef20): stfd fp20,-96(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef21) -C_TEXT(_savef21): stfd fp21,-88(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef22) -C_TEXT(_savef22): stfd fp22,-80(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef23) -C_TEXT(_savef23): stfd fp23,-72(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef24) -C_TEXT(_savef24): stfd fp24,-64(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef25) -C_TEXT(_savef25): stfd fp25,-56(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef26) -C_TEXT(_savef26): stfd fp26,-48(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef27) -C_TEXT(_savef27): stfd fp27,-40(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef28) -C_TEXT(_savef28): stfd fp28,-32(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef29) -C_TEXT(_savef29): stfd fp29,-24(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef30) -C_TEXT(_savef30): stfd fp30,-16(r11) - ASM_GLOBAL_DIRECTIVE C_TEXT(_savef31) -C_TEXT(_savef31): stfd fp31,-8(r11) - blr diff --git a/sysdeps/unix/sysv/aix/write.c b/sysdeps/unix/sysv/aix/write.c index c872e04..82c2bf6 100644 --- a/sysdeps/unix/sysv/aix/write.c +++ b/sysdeps/unix/sysv/aix/write.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1999. @@ -32,3 +32,4 @@ __write (fd, ptr, n) } /* AIX has no weak aliases (yet) but let's hope for better times. */ weak_alias (__write, write) +strong_alias (__write, __libc_write) -- 2.7.4