mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
1998-07-27 17:42 Ulrich Drepper <drepper@cygnus.com> * nss/nss_files/files-parse.c (INT_FIELD): Use strtoul instead of strtol. (INT_FIELD_MAYBE_NULL): Likewise. * posix/globtest.c: Rewrite for extended test suite. * posix/globtest.sh: More tests. Patch by Brian Wellington <bwelling@anomaly.munge.com>. * stdlib/strtol.c: Don't redefine LONG_MAX, LONG_MIN, and ULONG_MAX. Use new macro. * sysdeps/generic/readv.c: Correct return type. * sysdeps/generic/writev.c: Likewise. 1998-07-24 Gordon Matzigkeit <gord@fig.org> * argp/argp-help.c (_GNU_SOURCE): Define, to suck in program_invocation_name when compiling outside of glibc. 1998-07-26 Philip Blundell <philb@gnu.org> * sysdeps/unix/sysv/linux/arm/siglist.c: New file; ARM tools don't like `@' in .type directives. * sysdeps/libm-ieee754/e_expf.c (__ieee754_expf): Check whether FE_TONEAREST exists for this platform before using it. * sysdeps/libm-ieee754/e_exp.c (__ieee754_exp): Likewise. * sysdeps/arm/dl-machine.h (elf_machine_rel): Delete redundant debugging code. Correct handling of PC24 relocs. * elf/Makefile (ld-map): Only define if versioning is in use. * sysdeps/arm/fpu_control.h: Move to ... * sysdeps/arm/fpu/fpu_control.h: ... here. * sysdeps/generic/fpu_control.h: Made usable as a dummy implementation. * sysdeps/unix/sysv/linux/arm/brk.c: New file. * sysdeps/arm/machine-gmon.h: Improved profiling for ARM. * sysdeps/arm/sysdep.h (CALL_MCOUNT): Replace stub with real implementation. * sysdeps/unix/sysv/linux/arm/clone.S: Likewise. Based on patch from Scott Bambrough and Pat Beirne. * shlib-versions: Add appropriate definitions for ARM machines. * README.template: Mention that Linux/ARM with ELF works now. 1998-07-18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules: Generate compilation rules for all object suffixes, not only those currently selected, for sources in the current or object directory. 1998-07-24 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/fnmatch.c (fnmatch): Allow `/' in character class. Don't match `/' in filename by a character class if requested. * posix/testfnm.c: Rewritten. * posix/testfnm.args: Removed. 1998-07-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/annexc.c (limits_syms): Add missing symbols. (stdarg_syms): Move va_list to `maybe' list. (stdio_syms): Add FOPEN_MAX.
This commit is contained in:
71
ChangeLog
71
ChangeLog
@ -1,3 +1,74 @@
|
||||
1998-07-27 17:42 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* nss/nss_files/files-parse.c (INT_FIELD): Use strtoul instead of
|
||||
strtol.
|
||||
(INT_FIELD_MAYBE_NULL): Likewise.
|
||||
|
||||
* posix/globtest.c: Rewrite for extended test suite.
|
||||
* posix/globtest.sh: More tests.
|
||||
Patch by Brian Wellington <bwelling@anomaly.munge.com>.
|
||||
|
||||
* stdlib/strtol.c: Don't redefine LONG_MAX, LONG_MIN, and ULONG_MAX.
|
||||
Use new macro.
|
||||
|
||||
* sysdeps/generic/readv.c: Correct return type.
|
||||
* sysdeps/generic/writev.c: Likewise.
|
||||
|
||||
1998-07-24 Gordon Matzigkeit <gord@fig.org>
|
||||
|
||||
* argp/argp-help.c (_GNU_SOURCE): Define, to suck in
|
||||
program_invocation_name when compiling outside of glibc.
|
||||
|
||||
1998-07-26 Philip Blundell <philb@gnu.org>
|
||||
|
||||
* sysdeps/unix/sysv/linux/arm/siglist.c: New file; ARM tools don't
|
||||
like `@' in .type directives.
|
||||
|
||||
* sysdeps/libm-ieee754/e_expf.c (__ieee754_expf): Check whether
|
||||
FE_TONEAREST exists for this platform before using it.
|
||||
* sysdeps/libm-ieee754/e_exp.c (__ieee754_exp): Likewise.
|
||||
|
||||
* sysdeps/arm/dl-machine.h (elf_machine_rel): Delete redundant
|
||||
debugging code. Correct handling of PC24 relocs.
|
||||
|
||||
* elf/Makefile (ld-map): Only define if versioning is in use.
|
||||
|
||||
* sysdeps/arm/fpu_control.h: Move to ...
|
||||
* sysdeps/arm/fpu/fpu_control.h: ... here.
|
||||
* sysdeps/generic/fpu_control.h: Made usable as a dummy
|
||||
implementation.
|
||||
|
||||
* sysdeps/unix/sysv/linux/arm/brk.c: New file.
|
||||
|
||||
* sysdeps/arm/machine-gmon.h: Improved profiling for ARM.
|
||||
* sysdeps/arm/sysdep.h (CALL_MCOUNT): Replace stub with real
|
||||
implementation.
|
||||
* sysdeps/unix/sysv/linux/arm/clone.S: Likewise.
|
||||
Based on patch from Scott Bambrough and Pat Beirne.
|
||||
|
||||
* shlib-versions: Add appropriate definitions for ARM machines.
|
||||
|
||||
* README.template: Mention that Linux/ARM with ELF works now.
|
||||
|
||||
1998-07-18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* Makerules: Generate compilation rules for all object suffixes,
|
||||
not only those currently selected, for sources in the current or
|
||||
object directory.
|
||||
|
||||
1998-07-24 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* posix/fnmatch.c (fnmatch): Allow `/' in character class. Don't
|
||||
match `/' in filename by a character class if requested.
|
||||
* posix/testfnm.c: Rewritten.
|
||||
* posix/testfnm.args: Removed.
|
||||
|
||||
1998-07-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* posix/annexc.c (limits_syms): Add missing symbols.
|
||||
(stdarg_syms): Move va_list to `maybe' list.
|
||||
(stdio_syms): Add FOPEN_MAX.
|
||||
|
||||
1998-07-25 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/i386/bits/byteswap.h (__bswap_64): Change __v to __w to
|
||||
|
12
Makerules
12
Makerules
@ -171,21 +171,21 @@ $(common-objpfx)dummy.d:
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.S $(before-compile); $$(compile-command.S)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes-for-libc)
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: %.S $(before-compile); $(+make-deps)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes-for-libc)
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: %.s $(common-objpfx)dummy.d; $(make-dummy-dep)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes-for-libc)
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: %.c $(before-compile); $(+make-deps)
|
||||
|
||||
@ -197,21 +197,21 @@ ifdef objpfx
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: $(objpfx)%.S $(before-compile); $$(compile-command.S)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes-for-libc)
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: $(objpfx)%.S $(before-compile); $(+make-deps)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes-for-libc)
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: $(objpfx)%.s $(common-objpfx)dummy.d; $(make-dummy-dep)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes-for-libc)
|
||||
object-suffixes-left := $(all-object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: $(objpfx)%.c $(before-compile); $(+make-deps)
|
||||
endif
|
||||
|
@ -13,6 +13,7 @@ configurations:
|
||||
sparc-*-linux-gnu Linux-2.x on SPARC
|
||||
sparc64-*-linux-gnu Linux-2.x on UltraSPARC
|
||||
arm-*-none ARM standalone systems
|
||||
arm-*-linux Linux-2.x on ARM
|
||||
arm-*-linuxaout Linux-2.x on ARM using a.out binaries
|
||||
|
||||
|
||||
|
@ -18,6 +18,10 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
@ -35,7 +35,9 @@ elide-routines.os = $(dl-routines) dl-support enbl-secure
|
||||
# ld.so uses those routines, plus some special stuff for being the program
|
||||
# interpreter and operating independent of libc.
|
||||
rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal
|
||||
ifeq ($(versioning),yes)
|
||||
ld-map = $(common-objpfx)libc.map
|
||||
endif
|
||||
distribute = $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
|
||||
dl-hash.h soinit.c sofini.c ldd.sh.in ldd.bash.in eval.c \
|
||||
genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \
|
||||
|
@ -109,7 +109,7 @@ parse_line (char *line, struct STRUCTURE *result, \
|
||||
# define INT_FIELD(variable, terminator_p, swallow, base, convert) \
|
||||
{ \
|
||||
char *endp; \
|
||||
variable = convert (strtol (line, &endp, base)); \
|
||||
variable = convert (strtoul (line, &endp, base)); \
|
||||
if (endp == line) \
|
||||
return 0; \
|
||||
else if (terminator_p (*endp)) \
|
||||
@ -127,7 +127,7 @@ parse_line (char *line, struct STRUCTURE *result, \
|
||||
if (*line == '\0') \
|
||||
/* We expect some more input, so don't allow the string to end here. */ \
|
||||
return 0; \
|
||||
variable = convert (strtol (line, &endp, base)); \
|
||||
variable = convert (strtoul (line, &endp, base)); \
|
||||
if (endp == line) \
|
||||
variable = default; \
|
||||
if (terminator_p (*endp)) \
|
||||
|
2303
po/libc.pot
2303
po/libc.pot
File diff suppressed because it is too large
Load Diff
@ -160,8 +160,10 @@ static const char *const limits_syms[] =
|
||||
"_POSIX_THREAD_DESTRUCTOR_ITERATIONS", "_POSIX_THREAD_KEYS_MAX",
|
||||
"_POSIX_THREAD_THREADS_MAX", "_POSIX_TIMER_MAX", "_POSIX_TTY_NAME_MAX",
|
||||
"_POSIX_TZNAME_MAX", "_POSIX_THREAD_DESTRUCTOR_ITERATIONS",
|
||||
"CHAR_BIT", "CHAR_MAX", "CHAR_MIN", "INT_MAX", "INT_MIN", "MB_LEN_MAX",
|
||||
"NGROUPS_MAX", "PAGESIZE", "SCHAR_MIN", "SCHAR_MAX"
|
||||
"CHAR_BIT", "CHAR_MAX", "CHAR_MIN", "INT_MAX", "INT_MIN", "LONG_MAX",
|
||||
"LONG_MIN", "MB_LEN_MAX", "NGROUPS_MAX", "PAGESIZE", "SCHAR_MAX",
|
||||
"SCHAR_MIN", "SHRT_MAX", "SHRT_MIN", "UCHAR_MAX", "UINT_MAX",
|
||||
"ULONG_MAX", "USHRT_MAX"
|
||||
};
|
||||
static const char *const limits_maybe[] =
|
||||
{
|
||||
@ -333,10 +335,11 @@ static const char *const signal_maybe[] =
|
||||
/* <stdarg.h>. */
|
||||
static const char *const stdarg_syms[] =
|
||||
{
|
||||
"va_arg", "va_end", "va_list", "va_start"
|
||||
"va_arg", "va_end", "va_start"
|
||||
};
|
||||
static const char *const stdarg_maybe[] =
|
||||
{
|
||||
"va_list"
|
||||
};
|
||||
|
||||
/* <stddef.h>. */
|
||||
@ -351,9 +354,9 @@ static const char *const stddef_maybe[] =
|
||||
/* <stdio.h>. */
|
||||
static const char *const stdio_syms[] =
|
||||
{
|
||||
"BUFSIZ", "EOF", "FILENAME_MAX", "L_ctermid", "L_cuserid", "L_tmpnam",
|
||||
"NULL", "SEEK_CUR", "SEEK_END", "SEEK_SET", "STREAM_MAX", "TMP_MAX",
|
||||
"stderr", "stdin", "stdout", "_IOFBF", "_IOLBF", "_IONBF"
|
||||
"BUFSIZ", "EOF", "FILENAME_MAX", "FOPEN_MAX", "L_ctermid", "L_cuserid",
|
||||
"L_tmpnam", "NULL", "SEEK_CUR", "SEEK_END", "SEEK_SET", "STREAM_MAX",
|
||||
"TMP_MAX", "stderr", "stdin", "stdout", "_IOFBF", "_IOLBF", "_IONBF"
|
||||
};
|
||||
static const char *const stdio_maybe[] =
|
||||
{
|
||||
|
@ -228,6 +228,10 @@ fnmatch (pattern, string, flags)
|
||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
/* `/' cannot be matched. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
|
||||
if (not)
|
||||
++p;
|
||||
@ -246,9 +250,6 @@ fnmatch (pattern, string, flags)
|
||||
if (c == fn)
|
||||
goto matched;
|
||||
}
|
||||
else if ((flags & FNM_FILE_NAME) && c == '/')
|
||||
/* [/] can never match. */
|
||||
return FNM_NOMATCH;
|
||||
else if (c == '[' && *p == ':')
|
||||
{
|
||||
/* Leave room for the null. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1997, 1998 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
|
||||
@ -16,36 +16,93 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdio.h>
|
||||
#include <glob.h>
|
||||
#include <unistd.h>
|
||||
#include <glob.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
int glob_flags = GLOB_NOSORT;
|
||||
glob_t filenames;
|
||||
int i, j;
|
||||
int glob_flags = 0;
|
||||
glob_t g;
|
||||
int quotes = 1;
|
||||
|
||||
if (argc != 3)
|
||||
exit (1);
|
||||
if (chdir (argv[1]))
|
||||
exit (1);
|
||||
i = glob (argv[2], glob_flags, NULL, &filenames);
|
||||
while ((i = getopt (argc, argv, "bcdegmopqst")) != -1)
|
||||
switch(i)
|
||||
{
|
||||
case 'b':
|
||||
glob_flags |= GLOB_BRACE;
|
||||
break;
|
||||
case 'c':
|
||||
glob_flags |= GLOB_NOCHECK;
|
||||
break;
|
||||
case 'd':
|
||||
glob_flags |= GLOB_ONLYDIR;
|
||||
break;
|
||||
case 'e':
|
||||
glob_flags |= GLOB_NOESCAPE;
|
||||
break;
|
||||
case 'g':
|
||||
glob_flags |= GLOB_NOMAGIC;
|
||||
break;
|
||||
case 'm':
|
||||
glob_flags |= GLOB_MARK;
|
||||
break;
|
||||
case 'o':
|
||||
glob_flags |= GLOB_DOOFFS;
|
||||
g.gl_offs = 1;
|
||||
break;
|
||||
case 'p':
|
||||
glob_flags |= GLOB_PERIOD;
|
||||
break;
|
||||
case 'q':
|
||||
quotes = 0;
|
||||
break;
|
||||
case 's':
|
||||
glob_flags |= GLOB_NOSORT;
|
||||
break;
|
||||
case 't':
|
||||
glob_flags |= GLOB_TILDE;
|
||||
break;
|
||||
default:
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
if (optind >= argc || chdir (argv[optind]))
|
||||
exit(1);
|
||||
|
||||
j = optind + 1;
|
||||
if (optind + 1 >= argc)
|
||||
exit (1);
|
||||
|
||||
/* Do a glob on each remaining argument. */
|
||||
for (j = optind + 1; j < argc; j++) {
|
||||
i = glob (argv[j], glob_flags, NULL, &g);
|
||||
if (i != 0)
|
||||
break;
|
||||
glob_flags |= GLOB_APPEND;
|
||||
}
|
||||
|
||||
/* Was there an error? */
|
||||
if (i == GLOB_NOSPACE)
|
||||
puts ("GLOB_NOSPACE");
|
||||
else if (i == GLOB_ABEND)
|
||||
puts ("GLOB_ABEND");
|
||||
else if (i == GLOB_ABORTED)
|
||||
puts ("GLOB_ABORTED");
|
||||
else if (i == GLOB_NOMATCH)
|
||||
puts ("GLOB_NOMATCH");
|
||||
|
||||
printf ("%sNULL\n", filenames.gl_pathv ? "not " : "");
|
||||
/* If we set an offset, fill in the first field. */
|
||||
if (glob_flags & GLOB_DOOFFS)
|
||||
g.gl_pathv[0] = (char *) "abc";
|
||||
|
||||
if (filenames.gl_pathv)
|
||||
/* Print out the names. Unless otherwise specified, qoute them. */
|
||||
if (g.gl_pathv)
|
||||
{
|
||||
for (i = 0; i < filenames.gl_pathc; ++i)
|
||||
printf ("`%s'\n", filenames.gl_pathv[i]);
|
||||
for (i = 0; i < g.gl_pathc; ++i)
|
||||
printf ("%s%s%s\n", quotes ? "`" : "", g.gl_pathv[i],
|
||||
quotes ? "'" : "");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -4,17 +4,28 @@ common_objpfx=$1; shift
|
||||
elf_objpfx=$1; shift
|
||||
rtld_installed_name=$1; shift
|
||||
|
||||
# Since we use `osrt' we must make sure to use the same locale everywhere.
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LANG=C
|
||||
export LANG
|
||||
|
||||
# Create the arena
|
||||
: ${TMPDIR=/tmp}
|
||||
testdir=$TMPDIR/globtest-dir
|
||||
testout=$TMPDIR/globtest-out
|
||||
testout2=$TMPDIR/globtest-out2
|
||||
|
||||
trap 'rm -fr $testdir $testout' 1 2 3 15
|
||||
trap 'rm -fr $testdir $testout $testout2' 1 2 3 15
|
||||
|
||||
rm -fr $testdir
|
||||
mkdir $testdir
|
||||
echo 1 > $testdir/file1
|
||||
echo 2 > $testdir/file2
|
||||
echo 3 > $testdir/-file3
|
||||
echo 4 > $testdir/~file4
|
||||
echo 5 > $testdir/.file5
|
||||
echo 6 > $testdir/'*file6'
|
||||
mkdir $testdir/dir1
|
||||
mkdir $testdir/dir2
|
||||
echo 1_1 > $testdir/dir1/file1_1
|
||||
@ -23,40 +34,130 @@ echo 1_2 > $testdir/dir1/file1_2
|
||||
# Run some tests.
|
||||
result=0
|
||||
|
||||
# Normal test
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest "$testdir" "*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`*file6'
|
||||
`-file3'
|
||||
`dir1'
|
||||
`dir2'
|
||||
`file1'
|
||||
`file2'
|
||||
not NULL
|
||||
`~file4'
|
||||
EOF
|
||||
|
||||
# Don't let glob sort it
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest -s "$testdir" "*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`*file6'
|
||||
`-file3'
|
||||
`dir1'
|
||||
`dir2'
|
||||
`file1'
|
||||
`file2'
|
||||
`~file4'
|
||||
EOF
|
||||
|
||||
# Mark directories
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest -m "$testdir" "*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`*file6'
|
||||
`-file3'
|
||||
`dir1/'
|
||||
`dir2/'
|
||||
`file1'
|
||||
`file2'
|
||||
`~file4'
|
||||
EOF
|
||||
|
||||
# Find files starting with .
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest -p "$testdir" "*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`*file6'
|
||||
`-file3'
|
||||
`.'
|
||||
`..'
|
||||
`.file5'
|
||||
`dir1'
|
||||
`dir2'
|
||||
`file1'
|
||||
`file2'
|
||||
`~file4'
|
||||
EOF
|
||||
|
||||
# Test braces
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest -b "$testdir" "file{1,2}" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`file1'
|
||||
`file2'
|
||||
EOF
|
||||
|
||||
# Test NOCHECK
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest -c "$testdir" "abc" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`abc'
|
||||
EOF
|
||||
|
||||
# Test NOMAGIC without magic characters
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest -g "$testdir" "abc" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`abc'
|
||||
EOF
|
||||
|
||||
# Test NOMAGIC with magic characters
|
||||
${elf_objpfx}${rtld_installed_name} --library-path ${common_objpfx} \
|
||||
${common_objpfx}posix/globtest -g "$testdir" "abc*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
GLOB_NOMATCH
|
||||
EOF
|
||||
|
||||
# Test subdirs correctly
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest "$testdir" "*/*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`dir1/file1_1'
|
||||
`dir1/file1_2'
|
||||
not NULL
|
||||
EOF
|
||||
|
||||
# Test subdirs for invalid names
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest "$testdir" "*/1" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
GLOB_NOMATCH
|
||||
NULL
|
||||
EOF
|
||||
|
||||
# Test subdirs with wildcard
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`dir1/file1_1'
|
||||
not NULL
|
||||
EOF
|
||||
|
||||
# Test subdirs with ?
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`dir1/file1_1'
|
||||
`dir1/file1_2'
|
||||
EOF
|
||||
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
@ -64,7 +165,6 @@ ${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`dir1/file1_1'
|
||||
not NULL
|
||||
EOF
|
||||
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
@ -72,7 +172,6 @@ ${common_objpfx}posix/globtest "$testdir" "*-/*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
GLOB_NOMATCH
|
||||
NULL
|
||||
EOF
|
||||
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
@ -80,7 +179,89 @@ ${common_objpfx}posix/globtest "$testdir" "*-" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
GLOB_NOMATCH
|
||||
NULL
|
||||
EOF
|
||||
|
||||
# Test subdirs with ?
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`dir1/file1_1'
|
||||
`dir1/file1_2'
|
||||
EOF
|
||||
|
||||
# Test tilde expansion
|
||||
#${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
#${common_objpfx}posix/globtest -q -t "$testdir" "~" |
|
||||
#sort >$testout
|
||||
#echo ~ > $testout2
|
||||
#cmp $testout2 $testout || result=1
|
||||
|
||||
# Test tilde expansion with trailing slash
|
||||
#${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
#${common_objpfx}posix/globtest -q -t "$testdir" "~/" |
|
||||
#sort > $testout
|
||||
#echo ~/ > $testout2
|
||||
#cmp $testout2 $testout || result=1
|
||||
|
||||
# Test tilde expansion with username
|
||||
#${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
#${common_objpfx}posix/globtest -q -t "$testdir" "~"$USER |
|
||||
#sort > $testout
|
||||
#eval echo ~$USER > $testout2
|
||||
#cmp $testout2 $testout || result=1
|
||||
|
||||
# Tilde expansion shouldn't match a file
|
||||
#${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
#${common_objpfx}posix/globtest -t "$testdir" "~file4" |
|
||||
#sort > $testout
|
||||
#cat <<"EOF" | cmp - $testout || result=1
|
||||
#GLOB_NOMATCH
|
||||
#EOF
|
||||
|
||||
# Matching \** should only find *file6
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest "$testdir" "\**" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`*file6'
|
||||
EOF
|
||||
|
||||
# ... unless NOESCAPE is used, in which case it shouldn't match anything.
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest -e "$testdir" "\**" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
GLOB_NOMATCH
|
||||
EOF
|
||||
|
||||
# Try a recursive failed search
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest -e "$testdir" "a*/*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
GLOB_NOMATCH
|
||||
EOF
|
||||
|
||||
# Try multiple patterns (GLOB_APPEND)
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest "$testdir" "file1" "*/*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`dir1/file1_1'
|
||||
`dir1/file1_2'
|
||||
`file1'
|
||||
EOF
|
||||
|
||||
# Try multiple patterns (GLOB_APPEND) with offset (GLOB_DOOFFS)
|
||||
${elf_objpfx}${rtld_installed_name} --library-path $common_objpfx \
|
||||
${common_objpfx}posix/globtest -o "$testdir" "file1" "*/*" |
|
||||
sort > $testout
|
||||
cat <<"EOF" | cmp - $testout || result=1
|
||||
`abc'
|
||||
`dir1/file1_1'
|
||||
`dir1/file1_2'
|
||||
`file1'
|
||||
EOF
|
||||
|
||||
if test $result -eq 0; then
|
||||
|
@ -1 +0,0 @@
|
||||
*LIB* lib
|
@ -1,10 +1,39 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "fnmatch.h"
|
||||
|
||||
struct {
|
||||
const char *name;
|
||||
const char *pattern;
|
||||
int flags;
|
||||
int expected;
|
||||
} tests[] = {
|
||||
{ "lib", "*LIB*", FNM_PERIOD, FNM_NOMATCH },
|
||||
{ "lib", "*LIB*", FNM_CASEFOLD|FNM_PERIOD, 0 },
|
||||
{ "a/b", "a[/]b", 0, 0 },
|
||||
{ "a/b", "a[/]b", FNM_PATHNAME, FNM_NOMATCH },
|
||||
{ "a/b", "[a-z]/[a-z]", 0, 0 },
|
||||
};
|
||||
|
||||
int
|
||||
main (int c, char *v[])
|
||||
main (void)
|
||||
{
|
||||
printf ("%d\n", fnmatch (v[1], v[2], FNM_PERIOD));
|
||||
printf ("%d\n", fnmatch (v[1], v[2], FNM_CASEFOLD|FNM_PERIOD));
|
||||
exit (0);
|
||||
size_t i;
|
||||
int errors = 0;
|
||||
|
||||
for (i = 0; i < sizeof (tests) / sizeof (*tests); i++)
|
||||
{
|
||||
int match;
|
||||
|
||||
match = fnmatch (tests[i].pattern, tests[i].name, tests[i].flags);
|
||||
if (match != tests[i].expected)
|
||||
{
|
||||
printf ("%s %s %s\n", tests[i].pattern,
|
||||
match == 0 ? "matches" : "does not match",
|
||||
tests[i].name);
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
|
||||
exit (errors != 0);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ alpha.*-.*-linux.* libm=6.1
|
||||
alpha.*-.*-.* libm=6
|
||||
powerpc-.*-.* libm=6
|
||||
mips-.*-.* libm=6
|
||||
arm.*-.*-.* libm=6
|
||||
|
||||
# We provide libc.so.6 for Linux kernel versions 2.0 and later.
|
||||
alpha.*-.*-linux.* libc=6.1
|
||||
@ -36,6 +37,7 @@ i.86-.*-linux.* ld=ld-linux.so.2
|
||||
sparc-.*-linux.* ld=ld-linux.so.2
|
||||
sparc64-.*-linux.* ld=ld-linux64.so.2
|
||||
alpha.*-.*-linux.* ld=ld-linux.so.2
|
||||
arm.*-.*-linux.* ld=ld-linux.so.2
|
||||
# We use the ELF ABI standard name for the default.
|
||||
.*-.*-.* ld=ld.so.1
|
||||
|
||||
|
@ -128,27 +128,27 @@ extern int errno;
|
||||
operating on `long long int's. */
|
||||
#ifdef QUAD
|
||||
# define LONG long long
|
||||
# undef LONG_MIN
|
||||
# define LONG_MIN LONG_LONG_MIN
|
||||
# undef LONG_MAX
|
||||
# define LONG_MAX LONG_LONG_MAX
|
||||
# undef ULONG_MAX
|
||||
# define ULONG_MAX ULONG_LONG_MAX
|
||||
# define STRTOL_LONG_MIN LONG_LONG_MIN
|
||||
# define STRTOL_LONG_MAX LONG_LONG_MAX
|
||||
# define STRTOL_ULONG_MAX ULONG_LONG_MAX
|
||||
# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
|
||||
/* Work around gcc bug with using this constant. */
|
||||
static const unsigned long long int maxquad = ULONG_LONG_MAX;
|
||||
# undef ULONG_MAX
|
||||
# define ULONG_MAX maxquad
|
||||
# undef STRTOL_ULONG_MAX
|
||||
# define STRTOL_ULONG_MAX maxquad
|
||||
# endif
|
||||
#else
|
||||
# define LONG long
|
||||
|
||||
#ifndef ULONG_MAX
|
||||
# ifndef ULONG_MAX
|
||||
# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
|
||||
#endif
|
||||
#ifndef LONG_MAX
|
||||
# endif
|
||||
# ifndef LONG_MAX
|
||||
# define LONG_MAX ((long int) (ULONG_MAX >> 1))
|
||||
#endif
|
||||
# endif
|
||||
# define STRTOL_LONG_MIN LONG_MIN
|
||||
# define STRTOL_LONG_MAX ULONG_MAX
|
||||
# define STRTOL_ULONG_MAX ULONG_MAX
|
||||
#endif
|
||||
|
||||
|
||||
@ -339,8 +339,8 @@ INTERNAL (strtol) (nptr, endptr, base, group LOCALE_PARAM)
|
||||
#endif
|
||||
end = NULL;
|
||||
|
||||
cutoff = ULONG_MAX / (unsigned LONG int) base;
|
||||
cutlim = ULONG_MAX % (unsigned LONG int) base;
|
||||
cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base;
|
||||
cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base;
|
||||
|
||||
overflow = 0;
|
||||
i = 0;
|
||||
@ -380,8 +380,8 @@ INTERNAL (strtol) (nptr, endptr, base, group LOCALE_PARAM)
|
||||
`unsigned LONG int', but outside the range of `LONG int'. */
|
||||
if (overflow == 0
|
||||
&& i > (negative
|
||||
? -((unsigned LONG int) (LONG_MIN + 1)) + 1
|
||||
: (unsigned LONG int) LONG_MAX))
|
||||
? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1
|
||||
: (unsigned LONG int) STRTOL_LONG_MAX))
|
||||
overflow = 1;
|
||||
#endif
|
||||
|
||||
@ -389,9 +389,9 @@ INTERNAL (strtol) (nptr, endptr, base, group LOCALE_PARAM)
|
||||
{
|
||||
__set_errno (ERANGE);
|
||||
#if UNSIGNED
|
||||
return ULONG_MAX;
|
||||
return STRTOL_ULONG_MAX;
|
||||
#else
|
||||
return negative ? LONG_MIN : LONG_MAX;
|
||||
return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -398,35 +398,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
|
||||
break;
|
||||
case R_ARM_GLOB_DAT:
|
||||
case R_ARM_JUMP_SLOT:
|
||||
|
||||
#if 0
|
||||
#define _HEX(i) for (j=28; j>=0; j-=4) b[7-j/4]="0123456789abcdef"[((int)i>>j)&15];
|
||||
{
|
||||
char b[10];
|
||||
int j;
|
||||
_HEX(map->l_addr);
|
||||
__asm__ (" mov r0, #2; mov r1, %0; mov r2, #9; swi 0x00900004; "
|
||||
: : "r"(b) : "r0", "r1", "r2" );
|
||||
_HEX(sym->st_size);
|
||||
__asm__ (" mov r0, #2; mov r1, %0; mov r2, #9; swi 0x00900004; "
|
||||
: : "r"(b) : "r0", "r1", "r2" );
|
||||
_HEX(&sym->st_value);
|
||||
__asm__ (" mov r0, #2; mov r1, %0; mov r2, #9; swi 0x00900004; "
|
||||
: : "r"(b) : "r0", "r1", "r2" );
|
||||
_HEX(sym->st_value);
|
||||
__asm__ (" mov r0, #2; mov r1, %0; mov r2, #9; swi 0x00900004; "
|
||||
: : "r"(b) : "r0", "r1", "r2" );
|
||||
_HEX(sym);
|
||||
__asm__ (" mov r0, #2; mov r1, %0; mov r2, #9; swi 0x00900004; "
|
||||
: : "r"(b) : "r0", "r1", "r2" );
|
||||
_HEX(reloc_addr);
|
||||
__asm__ (" mov r0, #2; mov r1, %0; mov r2, #9; swi 0x00900004; "
|
||||
: : "r"(b) : "r0", "r1", "r2" );
|
||||
b[0]=' '; b[1]='\n';
|
||||
__asm__ (" mov r0, #2; mov r1, %0; mov r2, #2; swi 0x00900004; "
|
||||
: : "r"(b) : "r0", "r1", "r2" );
|
||||
}
|
||||
#endif
|
||||
*reloc_addr = value;
|
||||
break;
|
||||
case R_ARM_ABS32:
|
||||
@ -451,7 +422,12 @@ __asm__ (" mov r0, #2; mov r1, %0; mov r2, #2; swi 0x00900004; "
|
||||
break;
|
||||
}
|
||||
case R_ARM_PC24:
|
||||
*reloc_addr += (value - (Elf32_Addr) reloc_addr);
|
||||
{
|
||||
long int disp = (value - (Elf32_Addr) reloc_addr) / 4;
|
||||
if ((disp >= (1<<24)) || (disp <= -(1<<24)))
|
||||
assert (! "address out of range for PC24 reloc");
|
||||
*reloc_addr += disp;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert (! "unexpected dynamic reloc type");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Machine-dependent definitions for profiling support. ARM version.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997, 1998 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
|
||||
@ -37,19 +37,29 @@ static void mcount_internal (u_long frompc, u_long selfpc);
|
||||
#define _MCOUNT_DECL(frompc, selfpc) \
|
||||
static void mcount_internal (u_long frompc, u_long selfpc)
|
||||
|
||||
/* This macro/func MUST save r0, r1 because the compiler inserts
|
||||
blind calls to _mount(), ignoring the fact that _mcount may
|
||||
clobber registers; therefore, _mcount may NOT clobber registers */
|
||||
/* if (this_fp!=0) {
|
||||
r0 = this_lr
|
||||
r1 = this_fp
|
||||
r1 = [r1-4] which is caller's fp
|
||||
if (r1!=0)
|
||||
r1 = caller's lr
|
||||
call mcount_internal(this_lr, caller's_lr)
|
||||
}
|
||||
*/
|
||||
#define MCOUNT \
|
||||
void _mcount (void) \
|
||||
{ \
|
||||
register unsigned long int frompc, selfpc; \
|
||||
__asm__("movs fp, fp; " \
|
||||
"moveq %0, $0; " \
|
||||
"ldrne %0, [fp, $-4]; " \
|
||||
"ldrne %1, [fp, $-12]; " \
|
||||
"movnes %1, %1; " \
|
||||
"ldrne %1, [%1, $-4]; " \
|
||||
: "=g" (selfpc), "=g" (frompc) \
|
||||
: : "cc" \
|
||||
); \
|
||||
if (selfpc) \
|
||||
mcount_internal(frompc, selfpc); \
|
||||
__asm__("stmdb sp!, {r0, r1, r2, r3};" \
|
||||
"movs fp, fp;" \
|
||||
"moveq r0, #0;" \
|
||||
"ldrne r0, [fp, $-4];" \
|
||||
"ldrne r1, [fp, $-12];" \
|
||||
"movnes r1, r1;" \
|
||||
"ldrne r1, [r1, $-4];" \
|
||||
"movs r1, r1;" \
|
||||
"blne mcount_internal;" \
|
||||
"ldmia sp!, {r0, r1, r2, r3}"); \
|
||||
}
|
||||
|
@ -73,10 +73,10 @@
|
||||
|
||||
/* If compiled for profiling, call `mcount' at the start of each function. */
|
||||
#ifdef PROF
|
||||
/* The mcount code relies on a normal frame pointer being on the stack
|
||||
to locate our caller, so push one just for its benefit. */
|
||||
#define CALL_MCOUNT \
|
||||
#error Profiling not supported.
|
||||
str lr,[sp, #-4]! \
|
||||
bl PLTJMP(mcount) \
|
||||
ldr lr, [sp], #4
|
||||
#else
|
||||
#define CALL_MCOUNT /* Do nothing. */
|
||||
#endif
|
||||
|
@ -20,18 +20,18 @@
|
||||
#ifndef _FPU_CONTROL_H
|
||||
#define _FPU_CONTROL_H
|
||||
|
||||
#define _FPU_RESERVED ??? /* These bits are reserved are not changed. */
|
||||
#define _FPU_RESERVED 0xffffffff /* These bits are reserved and not changed. */
|
||||
|
||||
/* The fdlibm code requires no interrupts for exceptions. Don't
|
||||
change the rounding mode, it would break long double I/O! */
|
||||
#define _FPU_DEFAULT 0x00000000 /* Default value. */
|
||||
|
||||
/* Type of the control word. */
|
||||
typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__?I__)));
|
||||
typedef unsigned int fpu_control_t;
|
||||
|
||||
/* Macros for accessing the hardware control word. */
|
||||
#define _FPU_GETCW(cw) __asm__ ("fetch fpu control word into %0" : "=g" (cw))
|
||||
#define _FPU_SETCW(cw) __asm__ ("set fpu control word to %0" : : "g" (cw))
|
||||
#define _FPU_GETCW(cw) 0
|
||||
#define _FPU_SETCW(cw) do { } while (0)
|
||||
|
||||
/* Default control word set at startup. */
|
||||
extern fpu_control_t __fpu_control;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997, 1998 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
|
||||
@ -25,7 +25,7 @@
|
||||
The buffers are filled in the order specified.
|
||||
Operates just like `read' (see <unistd.h>) except that data are
|
||||
put in VECTOR instead of a contiguous buffer. */
|
||||
int
|
||||
ssize_t
|
||||
__readv (fd, vector, count)
|
||||
int fd;
|
||||
const struct iovec *vector;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1995, 1996, 1997, 1998 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
|
||||
@ -25,7 +25,7 @@
|
||||
The data is written in the order specified.
|
||||
Operates just like `write' (see <unistd.h>) except that the data
|
||||
are taken from VECTOR instead of a contiguous buffer. */
|
||||
int
|
||||
ssize_t
|
||||
__writev (fd, vector, count)
|
||||
int fd;
|
||||
const struct iovec *vector;
|
||||
|
@ -91,7 +91,9 @@ __ieee754_exp (double x)
|
||||
fenv_t oldenv;
|
||||
|
||||
feholdexcept (&oldenv);
|
||||
#ifdef FE_TONEAREST
|
||||
fesetround (FE_TONEAREST);
|
||||
#endif
|
||||
|
||||
/* Calculate n. */
|
||||
n = x * M_1_LN2 + THREEp51;
|
||||
|
@ -87,7 +87,9 @@ __ieee754_expf (float x)
|
||||
fenv_t oldenv;
|
||||
|
||||
feholdexcept (&oldenv);
|
||||
#ifdef FE_TONEAREST
|
||||
fesetround (FE_TONEAREST);
|
||||
#endif
|
||||
|
||||
/* Calculate n. */
|
||||
n = x * M_1_LN2 + THREEp22;
|
||||
|
49
sysdeps/unix/sysv/linux/arm/brk.c
Normal file
49
sysdeps/unix/sysv/linux/arm/brk.c
Normal file
@ -0,0 +1,49 @@
|
||||
/* brk system call for Linux/ARM.
|
||||
Copyright (C) 1995, 1996 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 <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sysdep.h>
|
||||
|
||||
/* This must be initialized data because commons can't have aliases. */
|
||||
void *__curbrk = 0;
|
||||
|
||||
int
|
||||
__brk (void *addr)
|
||||
{
|
||||
void *newbrk;
|
||||
|
||||
asm ("mov a1, %1\n" /* save the argment in r0 */
|
||||
"swi %2\n" /* do the system call */
|
||||
"mov %0, a1;" /* keep the return value */
|
||||
: "=r"(newbrk)
|
||||
: "r"(addr), "i" (SYS_ify (brk))
|
||||
: "a1");
|
||||
|
||||
__curbrk = newbrk;
|
||||
|
||||
if (newbrk < addr)
|
||||
{
|
||||
__set_errno (ENOMEM);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
weak_alias (__brk, brk)
|
@ -1,5 +1,6 @@
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Pat Beirne <patb@corelcomputer.com>
|
||||
|
||||
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
|
||||
@ -27,7 +28,38 @@
|
||||
|
||||
.text
|
||||
ENTRY(__clone)
|
||||
/* Somebody needs to write this. */
|
||||
@ sanity check args
|
||||
cmp r0, #0
|
||||
cmpne r1, #0
|
||||
moveq r0, #-EINVAL
|
||||
beq PLTJMP(syscall_error)
|
||||
|
||||
@ insert the args onto the new stack
|
||||
sub r1, r1, #8
|
||||
str r3, [r1, #4]
|
||||
@ save the function pointer as the 0th element
|
||||
str r0, [r1]
|
||||
|
||||
@ do the system call
|
||||
@ get flags
|
||||
mov r0, r2
|
||||
@ new sp is already in r1
|
||||
swi SYS_ify(clone)
|
||||
cmp r0, #0
|
||||
blt PLTJMP(syscall_error)
|
||||
beq thread_start
|
||||
@ else, thread was launched...
|
||||
mov pc, lr
|
||||
|
||||
thread_start:
|
||||
@ pick the function arg and call address off the stack and execute
|
||||
ldr r0, [sp, #4]
|
||||
mov lr, pc
|
||||
ldr pc, [sp]
|
||||
|
||||
@ and we are done, passing the return value through r0
|
||||
bl PLTJMP(_exit)
|
||||
|
||||
PSEUDO_END (__clone)
|
||||
|
||||
weak_alias (__clone, clone)
|
||||
|
75
sysdeps/unix/sysv/linux/arm/siglist.c
Normal file
75
sysdeps/unix/sysv/linux/arm/siglist.c
Normal file
@ -0,0 +1,75 @@
|
||||
/* Copyright (C) 1997, 1998 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 <stddef.h>
|
||||
#include <signal.h>
|
||||
#include <sizes.h>
|
||||
|
||||
#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
|
||||
# define SYS_SIGLIST __new_sys_siglist
|
||||
# define SYS_SIGABBREV __new_sys_sigabbrev
|
||||
#else
|
||||
# define SYS_SIGLIST _sys_siglist
|
||||
# define SYS_SIGABBREV _sys_sigabbrev
|
||||
#endif
|
||||
|
||||
#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
|
||||
asm (".data; .globl __old_sys_siglist; __old_sys_siglist:");
|
||||
#endif
|
||||
|
||||
const char *const SYS_SIGLIST[NSIG] =
|
||||
{
|
||||
#define init_sig(sig, abbrev, desc) [sig] desc,
|
||||
#include "siglist.h"
|
||||
#undef init_sig
|
||||
};
|
||||
|
||||
#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
|
||||
asm (".type __old_sys_siglist,%object;.size __old_sys_siglist,"
|
||||
OLD_SIGLIST_SIZE_STR "*" PTR_SIZE_STR);
|
||||
|
||||
asm (".data; .globl __old_sys_sigabbrev; __old_sys_sigabbrev:");
|
||||
#endif
|
||||
|
||||
const char *const SYS_SIGABBREV[NSIG] =
|
||||
{
|
||||
#define init_sig(sig, abbrev, desc) [sig] abbrev,
|
||||
#include "siglist.h"
|
||||
#undef init_sig
|
||||
};
|
||||
|
||||
#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
|
||||
asm (".type __old_sys_sigabbrev,%object;.size __old_sys_sigabbrev,"
|
||||
OLD_SIGLIST_SIZE_STR "*" PTR_SIZE_STR);
|
||||
|
||||
extern const char *const *__old_sys_siglist;
|
||||
extern const char *const *__old_sys_sigabbrev;
|
||||
|
||||
strong_alias (__old_sys_siglist, _old_sys_siglist)
|
||||
symbol_version (__old_sys_siglist, _sys_siglist, GLIBC_2.0);
|
||||
symbol_version (_old_sys_siglist, sys_siglist, GLIBC_2.0);
|
||||
symbol_version (__old_sys_sigabbrev, sys_sigabbrev, GLIBC_2.0);
|
||||
|
||||
strong_alias (__new_sys_siglist, _new_sys_siglist)
|
||||
default_symbol_version (__new_sys_siglist, _sys_siglist, GLIBC_2.1);
|
||||
default_symbol_version (_new_sys_siglist, sys_siglist, GLIBC_2.1);
|
||||
default_symbol_version (__new_sys_sigabbrev, sys_sigabbrev, GLIBC_2.1);
|
||||
#else
|
||||
weak_alias (_sys_siglist, sys_siglist)
|
||||
weak_alias (_sys_sigabbrev, sys_sigabbrev)
|
||||
#endif
|
Reference in New Issue
Block a user