summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog121
-rw-r--r--csu/initfini.c13
-rw-r--r--elf/ldd.bash.in9
-rw-r--r--elf/ldd.sh.in9
-rw-r--r--elf/sln.c6
-rw-r--r--sysdeps/arm/__longjmp.S6
-rw-r--r--sysdeps/arm/bsd-_setjmp.S2
-rw-r--r--sysdeps/arm/bsd-setjmp.S2
-rw-r--r--sysdeps/arm/dl-machine.h60
-rw-r--r--sysdeps/arm/fpu/__longjmp.S10
-rw-r--r--sysdeps/arm/ieee754.h (renamed from sysdeps/arm/fpu/ieee754.h)0
-rw-r--r--sysdeps/arm/sysdep.h4
-rw-r--r--sysdeps/generic/glob.c6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/fcntl.h12
-rw-r--r--sysdeps/unix/sysv/linux/arm/errlist.c55
-rw-r--r--sysdeps/unix/sysv/linux/arm/init-first.h55
-rw-r--r--sysdeps/unix/sysv/linux/bits/fcntl.h5
-rw-r--r--sysdeps/unix/sysv/linux/bits/siginfo.h4
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/fcntl.h16
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/fcntl.h13
20 files changed, 305 insertions, 103 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f51192fd7..5fd00e304d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+1998-08-20 16:01 Ulrich Drepper <drepper@cygnus.com>
+
+ * elf/ldd.sh.in: Redirect warnings and error messages to stderr.
+ * elf/ldd.bash.in: Likewise.
+
+ * elf/sln.c: Avoid warning for no main prototype.
+
+ * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Remove O_READ and
+ O_WRITE.
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+
+ * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Add F_SETSIG and
+ F_GETSIG.
+ * sysdeps/unix/sysv/linux/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+
+1998-08-20 Philip Blundell <pb@nexus.co.uk>
+
+ * sysdeps/arm/fpu/ieee754.h: Move to...
+ * sysdeps/arm/ieee754.h: ... here.
+
+ * sysdeps/arm/__longjmp.S: Put return value in correct register.
+ Don't set the condition flags unnecessarily.
+ * sysdeps/arm/fpu/__longjmp.S: Likewise. Restore floating point
+ registers correctly.
+
+ * sysdeps/arm/dl-machine.h: Fix problems with profiling code
+ (patch from Scott Bambrough).
+
+ * sysdeps/arm/sysdep.h (CALL_MCOUNT): Add missing semicolons.
+
+ * csu/initfini.c (_init): Don't check whether __gmon_start__ is
+ NULL, just call it unconditionally.
+ (__gmon_start__): Provide stub version as a weak symbol.
+
+1998-07-30 Philip Blundell <philb@gnu.org>
+
+ * sysdeps/unix/sysv/linux/arm/init-first.h: New file (from patch
+ by Scott Bambrough)
+
+ * sysdeps/unix/sysv/linux/arm/errlist.c: New file; ARM tools don't
+ like `@' in .type directives.
+
+ * sysdeps/arm/bsd-setjmp.S: Use PLT for procedure call.
+ * sysdeps/arm/bsd-_setjmp.S: Likewise.
+
+ * sysdeps/arm/dl-machine.h: Set __libc_stack_end.
+
+1998-08-20 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_SETOWN): Correct value.
+ (F_GETOWN): Likewise.
+
+ * sysdeps/unix/sysv/linux/bits/siginfo.h (SI_SIGIO): Add it (from
+ Linux 2.1.117).
+
+1998-08-20 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/glob.c [_LIBC]: Define __stat only if not
+ already defined.
+
1998-08-18 Ulrich Drepper <drepper@cygnus.com>
* include/features.h: Define __USE_EXTERN_INLINES for recent
@@ -18,35 +81,35 @@
* sysdeps/generic/bits/glob.c [_LIBC]: Define __stat using __xstat
to allow compilation without optimization.
-1998-08-14 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
-
- * nis/nss_compat/compat-grp.c: Set errno to ENOENT if we have no
- more entries.
- * nis/nss_compat/compat-initgroups.c: Likewise.
- * nis/nss_compat/compat-pwd.c: Likewise.
- * nis/nss_compat/compat-spwd.c: Likewise.
- * nis/nss_nis/nis-alias.c: Likewise.
- * nis/nss_nis/nis-ethers.c: Likewise.
- * nis/nss_nis/nis-grp.c: Likewise.
- * nis/nss_nis/nis-hosts.c: Likewise.
- * nis/nss_nis/nis-initgroups.c: Likewise.
- * nis/nss_nis/nis-network.c: Likewise.
- * nis/nss_nis/nis-proto.c: Likewise.
- * nis/nss_nis/nis-pwd.c: Likewise.
- * nis/nss_nis/nis-rpc.c: Likewise.
- * nis/nss_nis/nis-service.c: Likewise.
- * nis/nss_nis/nis-spwd.c: Likewise.
-
- * nis/rpcsvc/yp.h: Generate new without 1024 byte limits.
-
- * nis/ypclnt.c: Try binding dir only first time, could be to old.
-
- * nis/yp_xdr.c: Remove 1024 byte limit.
- * nis/ypupdate_xdr.c: Likewise.
-
- * nis/nss_nis/nis-publickey.c: Make sure, nobody could send
- wrong data.
-
+1998-08-14 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
+
+ * nis/nss_compat/compat-grp.c: Set errno to ENOENT if we have no
+ more entries.
+ * nis/nss_compat/compat-initgroups.c: Likewise.
+ * nis/nss_compat/compat-pwd.c: Likewise.
+ * nis/nss_compat/compat-spwd.c: Likewise.
+ * nis/nss_nis/nis-alias.c: Likewise.
+ * nis/nss_nis/nis-ethers.c: Likewise.
+ * nis/nss_nis/nis-grp.c: Likewise.
+ * nis/nss_nis/nis-hosts.c: Likewise.
+ * nis/nss_nis/nis-initgroups.c: Likewise.
+ * nis/nss_nis/nis-network.c: Likewise.
+ * nis/nss_nis/nis-proto.c: Likewise.
+ * nis/nss_nis/nis-pwd.c: Likewise.
+ * nis/nss_nis/nis-rpc.c: Likewise.
+ * nis/nss_nis/nis-service.c: Likewise.
+ * nis/nss_nis/nis-spwd.c: Likewise.
+
+ * nis/rpcsvc/yp.h: Generate new without 1024 byte limits.
+
+ * nis/ypclnt.c: Try binding dir only first time, could be to old.
+
+ * nis/yp_xdr.c: Remove 1024 byte limit.
+ * nis/ypupdate_xdr.c: Likewise.
+
+ * nis/nss_nis/nis-publickey.c: Make sure, nobody could send
+ wrong data.
+
1998-08-18 Roland McGrath <roland@baalperazim.frob.com>
* Rules (binaries-static, binaries-shared static pattern rules):
diff --git a/csu/initfini.c b/csu/initfini.c
index 8f8ce2f707..b05d36ae9a 100644
--- a/csu/initfini.c
+++ b/csu/initfini.c
@@ -73,8 +73,7 @@ _init (void)
would come first, and not be profiled. */
extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
- if (__gmon_start__)
- __gmon_start__ ();
+ __gmon_start__ ();
asm ("ALIGN");
asm("END_INIT");
@@ -85,6 +84,16 @@ _init (void)
}
asm ("END_INIT");
+/* This version of __gmon_start__ is used if no other is found. By providing
+ a default function we avoid the need to test whether the pointer is NULL,
+ which can be painful on some machines. */
+
+void __attribute__ ((weak))
+__gmon_start__ (void)
+{
+ /* do nothing */
+}
+
/* End of the _init epilog, beginning of the _fini prolog. */
asm ("\n/*@_init_EPILOG_ENDS*/");
asm ("\n/*@_fini_PROLOG_BEGINS*/");
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index 9bf88d1ae7..f6ffa6b4e8 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -114,7 +114,8 @@ case $# in
exit 1
elif test -r "$file"; then
test -x "$file" ||
- echo 'ldd:' $"warning: you do not have execution permission for" "\`$file'"
+ echo 'ldd:' $"\
+warning: you do not have execution permission for" "\`$file'" >&2
verify_out=`${RTLD} --verify "$file"`
case $? in
0)
@@ -135,7 +136,7 @@ case $# in
;;
esac
else
- echo 'ldd:' $"error: you do not have read permission for" "\`$file'"
+ echo 'ldd:' $"error: you do not have read permission for" "\`$file'" >&2
exit 1
fi
exit
@@ -155,7 +156,7 @@ case $# in
result=1
elif test -r "$file"; then
test -x "$file" || echo 'ldd:' $"\
-warning: you do not have execution permission for" "\`$file'"
+warning: you do not have execution permission for" "\`$file'" >&2
verify_out=`${RTLD} --verify "$file"`
case $? in
0)
@@ -177,7 +178,7 @@ warning: you do not have execution permission for" "\`$file'"
;;
esac
else
- echo 'ldd:' $"error: you do not have read permission for" "\`$file'"
+ echo 'ldd:' $"error: you do not have read permission for" "\`$file'" >&2
result=1
fi
done
diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in
index 2447a90a3e..4eda958b4b 100644
--- a/elf/ldd.sh.in
+++ b/elf/ldd.sh.in
@@ -112,7 +112,8 @@ Try \`ldd --help' for more information."
else
if test -r "$file"; then
test -x "$file" ||
- echo "ldd: warning: you do not have execution permission for \`$file'"
+ echo "\
+ldd: warning: you do not have execution permission for \`$file'" >&2
verify_out=`${RTLD} --verify "$file"`
case $? in
0)
@@ -132,7 +133,7 @@ Try \`ldd --help' for more information."
;;
esac
else
- echo "ldd: error: you do not have read permission for \`$file'"
+ echo "ldd: error: you do not have read permission for \`$file'" >&2
exit 1
fi
fi
@@ -155,7 +156,7 @@ Try \`ldd --help' for more information."
else
if test -r "$file"; then
test -x "$file" || echo "\
-ldd: warning: you do not have execution permission for \`$file'"
+ldd: warning: you do not have execution permission for \`$file'" >&2
verify_out=`${RTLD} --verify "$file"`
case $? in
0)
@@ -175,7 +176,7 @@ ldd: warning: you do not have execution permission for \`$file'"
;;
esac
else
- echo "ldd: error: you do not have read permission for \`$file'"
+ echo "ldd: error: you do not have read permission for \`$file'" >&2
result=1
fi
fi
diff --git a/elf/sln.c b/elf/sln.c
index a958bac0cf..f9344692e6 100644
--- a/elf/sln.c
+++ b/elf/sln.c
@@ -34,9 +34,7 @@ static int makesymlink __P ((const char *src, const char *dest));
static int makesymlinks __P ((const char *file));
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
switch (argc)
{
@@ -162,7 +160,7 @@ makesymlink (src, dest)
fprintf (stderr, "%s: invalid destination: %s\n", dest, error);
return -1;
}
-
+
#ifdef S_ISLNK
if (symlink (src, dest) == 0)
#else
diff --git a/sysdeps/arm/__longjmp.S b/sysdeps/arm/__longjmp.S
index 239b0cfc85..742e0baa16 100644
--- a/sysdeps/arm/__longjmp.S
+++ b/sysdeps/arm/__longjmp.S
@@ -25,9 +25,9 @@
/* __longjmp(jmpbuf, val) */
ENTRY (__longjmp)
- movs r2, r0
+ mov ip, r0
movs r0, r1 /* get the return value in place */
- moveq r1, #1 /* can't let setjmp() return zero! */
+ moveq r0, #1 /* can't let setjmp() return zero! */
- LOADREGS(ia, r2, {v1-v6, sl, fp, sp, pc})
+ LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
END (__longjmp)
diff --git a/sysdeps/arm/bsd-_setjmp.S b/sysdeps/arm/bsd-_setjmp.S
index 6ae6da6457..5cecc2a0be 100644
--- a/sysdeps/arm/bsd-_setjmp.S
+++ b/sysdeps/arm/bsd-_setjmp.S
@@ -25,5 +25,5 @@
ENTRY (_setjmp)
mov r1, #0
- b C_SYMBOL_NAME(__sigsetjmp)
+ b PLTJMP(C_SYMBOL_NAME(__sigsetjmp))
END (_setjmp)
diff --git a/sysdeps/arm/bsd-setjmp.S b/sysdeps/arm/bsd-setjmp.S
index 52622e2155..bfa9552afb 100644
--- a/sysdeps/arm/bsd-setjmp.S
+++ b/sysdeps/arm/bsd-setjmp.S
@@ -25,5 +25,5 @@
ENTRY (setjmp)
mov r1, #1
- b C_SYMBOL_NAME(__sigsetjmp)
+ b PLTJMP(C_SYMBOL_NAME(__sigsetjmp))
END (setjmp)
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index 912f7863fb..c40f9d7260 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -99,7 +99,8 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
end in this function. */
if (profile)
{
- got[2] = (Elf32_Addr) &_dl_runtime_profile;
+ //got[2] = (Elf32_Addr) &_dl_runtime_profile;
+ got[2] = (Elf32_Addr) &_dl_runtime_resolve;
/* Say that we really want profiling and the timers are started. */
_dl_profile_map = l;
}
@@ -144,7 +145,6 @@ _dl_runtime_resolve:
stmdb sp!,{r0-r3,sl,fp}
@ prepare to call fixup()
-
@ change &GOT[n+3] into 8*n NOTE: reloc are 8 bytes each
sub r1, ip, lr
sub r1, r1, #4
@@ -153,6 +153,7 @@ _dl_runtime_resolve:
@ get pointer to linker struct
ldr r0, [lr, #-4]
+ @ call fixup routine
" CALL_ROUTINE(fixup) "
@ save the return
@@ -165,21 +166,15 @@ _dl_runtime_resolve:
mov pc, ip
.size _dl_runtime_resolve, .-_dl_runtime_resolve
-
+
.globl _dl_runtime_profile
.type _dl_runtime_profile, #function
.align 2
_dl_runtime_profile:
- @ we get caled with
- @ stack[0] contains the return address from this call
- @ ip contains &GOT[n+3] (pointer to function)
- @ lr points to &GOT[2]
-
- @ save almost everything; return add is already on the stack
- stmdb sp!,{r0-r3,fp}
+ @ save almost everything; lr is already on the stack
+ stmdb sp!,{r0-r3,sl,fp}
@ prepare to call fixup()
-
@ change &GOT[n+3] into 8*n NOTE: reloc are 8 bytes each
sub r1, ip, lr
sub r1, r1, #4
@@ -188,18 +183,19 @@ _dl_runtime_profile:
@ get pointer to linker struct
ldr r0, [lr, #-4]
+ @ call profiling fixup routine
" CALL_ROUTINE(profile_fixup) "
@ save the return
mov ip, r0
@ restore the stack
- ldmia sp!,{r0-r3,fp,lr}
+ ldmia sp!,{r0-r3,sl,fp,lr}
@ jump to the newly found address
mov pc, ip
- .size _dl_runtime_profile, .-_dl_runtime_profile
+ .size _dl_runtime_resolve, .-_dl_runtime_resolve
.previous
");
#else // PROF
@@ -212,15 +208,33 @@ _dl_runtime_profile:
.align 2
_dl_runtime_resolve:
_dl_runtime_profile:
- stmdb sp!,{r0-r3,fp}
- ldr r1,[sp,#0x34]
+ @ we get called with
+ @ stack[0] contains the return address from this call
+ @ ip contains &GOT[n+3] (pointer to function)
+ @ lr points to &GOT[2]
+
+ @ save almost everything; return add is already on the stack
+ stmdb sp!,{r0-r3,sl,fp}
+
+ @ prepare to call fixup()
+ @ change &GOT[n+3] into 8*n NOTE: reloc are 8 bytes each
sub r1, ip, lr
sub r1, r1, #4
add r1, r1, r1
+
+ @ get pointer to linker struct
ldr r0, [lr, #-4]
+
+ @ call profiling fixup routine
" CALL_ROUTINE(fixup) "
+
+ @ save the return
mov ip, r0
- ldmia sp!,{r0-r3,fp,lr}
+
+ @ restore the stack
+ ldmia sp!,{r0-r3,sl,fp,lr}
+
+ @ jump to the newly found address
mov pc, ip
.size _dl_runtime_profile, .-_dl_runtime_profile
@@ -251,6 +265,10 @@ _dl_start_user:
ldr sl, .L_GET_GOT
add sl, pc, sl
.L_GOT_GOT:
+ @ Store the highest stack address
+ ldr r1, .L_STACK_END
+ ldr r1, [sl, r1]
+ str sp, [r1]
@ See if we were run as a command with the executable file
@ name as an extra leading argument.
ldr r1, .L_SKIP_ARGS
@@ -299,6 +317,8 @@ _dl_start_user:
.word _dl_starting_up(GOT)
.L_FINI_PROC:
.word _dl_fini(GOT)
+.L_STACK_END:
+ .word __libc_stack_end(GOT)
.previous\n\
");
@@ -421,14 +441,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
*reloc_addr += value;
break;
}
- case R_ARM_PC24:
- {
- 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");
break;
diff --git a/sysdeps/arm/fpu/__longjmp.S b/sysdeps/arm/fpu/__longjmp.S
index 8afa177b20..25ba6b39fa 100644
--- a/sysdeps/arm/fpu/__longjmp.S
+++ b/sysdeps/arm/fpu/__longjmp.S
@@ -25,12 +25,12 @@
/* __longjmp(jmpbuf, val) */
ENTRY (__longjmp)
- movs r2, r0
+ mov ip, r0 /* save jmp_buf pointer */
+
movs r0, r1 /* get the return value in place */
- moveq r1, #1 /* can't let setjmp() return zero! */
+ moveq r0, #1 /* can't let setjmp() return zero! */
- add r2, r2, #48
- lfmfd f4, 4, [r2]
+ lfmia f4, 4, [ip] ! /* load the floating point regs */
- LOADREGS(ia, r2, {v1-v6, sl, fp, sp, pc})
+ LOADREGS(ia, ip, {v1-v6, sl, fp, sp, pc})
END (__longjmp)
diff --git a/sysdeps/arm/fpu/ieee754.h b/sysdeps/arm/ieee754.h
index 73f7d6a376..73f7d6a376 100644
--- a/sysdeps/arm/fpu/ieee754.h
+++ b/sysdeps/arm/ieee754.h
diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h
index 13d34c741b..6247f9c94b 100644
--- a/sysdeps/arm/sysdep.h
+++ b/sysdeps/arm/sysdep.h
@@ -74,8 +74,8 @@
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
#define CALL_MCOUNT \
- str lr,[sp, #-4]! \
- bl PLTJMP(mcount) \
+ str lr,[sp, #-4]! ; \
+ bl PLTJMP(mcount) ; \
ldr lr, [sp], #4
#else
#define CALL_MCOUNT /* Do nothing. */
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c
index 509fc1b972..c41d03f8b2 100644
--- a/sysdeps/generic/glob.c
+++ b/sysdeps/generic/glob.c
@@ -253,7 +253,9 @@ extern char *alloca ();
# define readdir(str) __readdir (str)
# define getpwnam_r(name, bufp, buf, len, res) \
__getpwnam_r (name, bufp, buf, len, res)
-# define __stat(fname, buf) __xstat (_STAT_VER, fname, buf)
+# ifndef __stat
+# define __stat(fname, buf) __xstat (_STAT_VER, fname, buf)
+# endif
#endif
#if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
@@ -291,7 +293,7 @@ inline
const char *next_brace_sub __P ((const char *begin));
static int glob_in_dir __P ((const char *pattern, const char *directory,
int flags,
- int (*errfunc) __P ((const char *, int)),
+ int (*errfunc) (const char *, int),
glob_t *pglob));
static int prefix_array __P ((const char *prefix, char **array, size_t n));
static int collated_compare __P ((const __ptr_t, const __ptr_t));
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index 14840649ea..0dc0c47b1a 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 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,11 +25,6 @@
#include <sys/types.h>
-/* In GNU, read and write are bits (unlike BSD). */
-#ifdef __USE_GNU
-# define O_READ O_RDONLY /* Open for reading. */
-# define O_WRITE O_WRONLY /* Open for writing. */
-#endif
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
@@ -71,6 +66,11 @@
# define F_GETOWN 6 /* Set owner of socket (receiver of SIGIO). */
#endif
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
diff --git a/sysdeps/unix/sysv/linux/arm/errlist.c b/sysdeps/unix/sysv/linux/arm/errlist.c
new file mode 100644
index 0000000000..e249522514
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/errlist.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 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 <sizes.h>
+#include <errlist.h>
+
+#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+
+# define SYS_ERRLIST __new_sys_errlist
+# define SYS_NERR __new_sys_nerr
+
+asm (".data; .globl __old_sys_errlist; __old_sys_errlist:");
+#endif
+
+#include <sysdeps/gnu/errlist.c>
+
+#if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
+asm (".type __old_sys_errlist,%object;.size __old_sys_errlist,"
+ OLD_ERRLIST_SIZE_STR "*" PTR_SIZE_STR);
+
+extern const char *const *__old_sys_errlist;
+
+const int __old_sys_nerr = OLD_ERRLIST_SIZE;
+
+strong_alias (__old_sys_nerr, _old_sys_nerr);
+weak_alias (__old_sys_nerr, _old_sys_nerr)
+symbol_version (__old_sys_nerr, _sys_nerr, GLIBC_2.0);
+symbol_version (_old_sys_nerr, sys_nerr, GLIBC_2.0);
+weak_alias (__old_sys_errlist, _old_sys_errlist);
+symbol_version (__old_sys_errlist, _sys_errlist, GLIBC_2.0);
+symbol_version (_old_sys_errlist, sys_errlist, GLIBC_2.0);
+
+weak_alias (__new_sys_nerr, _new_sys_nerr)
+default_symbol_version (__new_sys_nerr, _sys_nerr, GLIBC_2.1);
+default_symbol_version (_new_sys_nerr, sys_nerr, GLIBC_2.1);
+weak_alias (__new_sys_errlist, _new_sys_errlist)
+default_symbol_version (__new_sys_errlist, _sys_errlist, GLIBC_2.1);
+default_symbol_version (_new_sys_errlist, sys_errlist, GLIBC_2.1);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/arm/init-first.h b/sysdeps/unix/sysv/linux/arm/init-first.h
new file mode 100644
index 0000000000..d68c368cc2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/init-first.h
@@ -0,0 +1,55 @@
+/* Prepare arguments for library initialization function.
+ Copyright (C) 1997 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. */
+
+/* The job of this fragment it to find argc and friends for INIT.
+ This is done in one of two ways: either in the stack context
+ of program start, or having dlopen pass them in.
+
+ */
+
+#define SYSDEP_CALL_INIT(NAME, INIT) \
+void NAME (void* arg, ...) \
+{ \
+ int argc; \
+ char** argv; \
+ char** envp; \
+ /* The next variable is only here to work around a bug in gcc <= 2.7.2.2. \
+ If the address would be taken inside the expression the optimizer \
+ would try to be too smart and throws it away. Grrr. */ \
+ int *dummy_addr = &_dl_starting_up; \
+ \
+ __libc_multiple_libcs = dummy_addr && !_dl_starting_up; \
+ \
+ if (!__libc_multiple_libcs) \
+ { \
+ /* The ... in the arg list above forces the gnu ARM compiler to \
+ push r0, r1, r2, r3 onto the stack. This way we can get the address */ \
+ argc = *(int*) (&arg+4); \
+ argv = (char **) &arg + 5; \
+ envp = &argv[argc+1]; \
+ } \
+ else /* the three were passed as arguments */ \
+ { \
+ argc = (int)arg; \
+ argv = (char**)*(&arg + 1); \
+ envp = (char**)*(&arg + 2); \
+ } \
+ \
+ INIT (argc, argv, envp); \
+}
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl.h b/sysdeps/unix/sysv/linux/bits/fcntl.h
index 51e845b9c1..223cb99e75 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl.h
@@ -74,6 +74,11 @@
# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
#endif
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
/* For F_[GET|SET]FL. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
index 25cd78293e..66e6261999 100644
--- a/sysdeps/unix/sysv/linux/bits/siginfo.h
+++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
@@ -112,7 +112,9 @@ typedef struct siginfo
signals. */
enum
{
- SI_ASYNCIO = -4, /* Sent by AIO completion. */
+ SI_SIGIO = -5, /* Sent by queued SIGIO. */
+# define SI_SIGIO SI_SIGIO
+ SI_ASYNCIO, /* Sent by AIO completion. */
# define SI_ASYNCIO SI_ASYNCIO
SI_MESGQ, /* Sent by real time mesq state change. */
# define SI_MESGQ SI_MESGQ
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index 09d6fb6d4c..0a0d9c9d00 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -24,11 +24,6 @@
#include <sys/types.h>
-/* In GNU, read and write are bits (unlike BSD). */
-#ifdef __USE_GNU
-# define O_READ O_RDONLY /* Open for reading. */
-# define O_WRITE O_WRONLY /* Open for writing. */
-#endif
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0x0003
@@ -66,8 +61,13 @@
#define F_SETLKW64 7 /* Set record locking info (blocking). */
#ifdef __USE_BSD
-# define F_SETOWN 5 /* Get owner of socket (receiver of SIGIO). */
-# define F_GETOWN 6 /* Set owner of socket (receiver of SIGIO). */
+# define F_SETOWN 24 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 23 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
#endif
/* for F_[GET|SET]FL */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index 9e8c589b9a..2fa0cd8b20 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/SPARC.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -22,12 +22,6 @@
#include <sys/types.h>
-/* In GNU, read and write are bits (unlike BSD). */
-#ifdef __USE_GNU
-# define O_READ O_RDONLY /* Open for reading. */
-# define O_WRITE O_WRONLY /* Open for writing. */
-#endif
-
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_RDONLY 0x0000
@@ -61,6 +55,11 @@
#define F_SETLK 8 /* Set record locking info (non-blocking). */
#define F_SETLKW 9 /* Set record locking info (blocking). */
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
/* XXX missing */
#define F_GETLK64 7 /* Get record locking info. */
#define F_SETLK64 8 /* Set record locking info (non-blocking). */