+1997-02-27 05:12 Ulrich Drepper <drepper@cygnus.com>
+
+ * manual/Makefile: Add rules to run and distribute xtract-typefun.
+ * manual/xtract-typefun.awk: New file. Script to extract function,
+ variable, macro anchor to put into the `dir' file.
+ * manual/signal.texi: Document difference between SysV and BSD
+ signal(3) function and add documentation for sysv_signal.
+
+ * sysdeps/libm-i387/e_acoshl.c: Clear upper half of word containing
+ exponent before comparing.
+
+1997-02-27 01:13 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/netinet/in.h (htonl, htons, ntohl, ntohs): Change
+ prototypes to use types with explicit width. `unsigned long' is
+ different on 64 bit systems.
+ * sysdeps/unix/sysv/linux/netinet/in.h: Likewise.
+ * sysdeps/generic/htonl.c: Likewise.
+ * sysdeps/generic/htons.c: Likewise.
+ * sysdeps/generic/ntohl.c: Likewise.
+ * sysdeps/generic/ntohs.c: Likewise.
+ Suggested by a sun <asun@zoology.washington.edu>.
+
+1997-02-26 08:30 Andreas Jaeger <aj@arthur.pfalz.de>
+
+ * math/math.h: Include <__math.h> if __NO_MATH_INLINES is not
+ defined and we want optimization.
+
+1997-02-27 01:13 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/netinet/in.h (htonl, htons, ntohl, ntohs): Change
+ prototypes to use types with explicit width. `unsigned long' is
+ different on 64 bit systems.
+ Suggested by a sun <asun@zoology.washington.edu>.
+
+1997-02-02 19:53 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * misc/getpass.c: Don't disable canonical input.
+ Reverted patch of Mon Jan 6 01:35:29 1997.
+
+1996-12-14 22:07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * libio/libioP.h (_IO_finish_t): Take additional parameter, to
+ match the hidden __in_chrg parameter of the destructor.
+ (_IO_FINISH): Pass zero for it.
+ * libio/genops.c (_IO_default_finish): Add second parameter, which
+ is ignored.
+ * libio/memstream.c (_IO_mem_finish): Likewise.
+ * libio/fileops.c (_IO_mem_finish): Likewise.
+ * libio/strops.c (_IO_str_finish): Likewise. All callers changed.
+
+1997-02-27 00:23 H.J. Lu <hjl@lucon.org>
+
+ * time/Makefile: Avoid using patterns in dependencies.
+
+1997-02-26 00:56 Miguel de Icaza <miguel@nuclecu.unam.mx>
+
+ * elf/rtld.c: Make _dl_start static. Otherwise the linker on the
+ SPARC will convert the call _dl_start into a call into the PLT.
+
+ * elf/rtld.c (_dl_start): On the SPARC we need to adjust the value
+ of arg to make it point to the actual values.
+
+ * sysdeps/sparc/elf/DEFS.h: New ELF specific version.
+ * sysdeps/sparc/Dist: Mention sysdeps/sparc/elf/DEFS.h.
+
+ * sysdeps/sparc/bsd-_setjmp.S, sysdeps/sparc/bsd-setjmp.S: Make
+ them PIC aware.
+
+ * sysdeps/sparc/dl-machine.h (elf_machine_load_address):
+ Implemented.
+ (elf_machine_rela): Make it compile; fix existing relocation
+ types; add unhandled relocation types.
+ (ELF_ADJUST_ARG): Get pointer to arguments at program startup.
+ (RTLD_START): Initial implementation, not yet finished.
+
+ * sysdeps/sparc/elf/start.S: Fix.
+
+ * sysdeps/sparc/fpu_control.h: Remove duplicate declaration of
+ __setfpucw.
+
+ * sysdeps/sparc/divrem.m4: Make compilable under Linux.
+ * sysdeps/sparc/rem.S, sysdeps/sparc/sdiv.S, sysdeps/sparc/udiv.S,
+ sysdeps/sparc/urem.S : Regenerated.
+
+ * sysdeps/sparc/setjmp.S: Make it PIC aware.
+
+ * sysdeps/unix/sysv/linux/sparc/__sigtrampoline.S: Define
+ __ASSEMBLY__ before using kernel header.
+
+ * sysdeps/unix/sysv/linux/sparc/Makefile: Use -mv8 flag to compile
+ rtld.c.
+
+ * sysdeps/unix/sysv/linux/sparc/brk.c: Implement.
+ * sysdeps/unix/sysv/linux/sparc/profil-counter.h: Remove code
+ to handle old signals.
+ * sysdeps/unix/sysv/linux/sparc/sigaction.c: Implements sigaction
+ for all Linux/SPARC kernels.
+ * sysdeps/unix/sysv/linux/sparc/syscall.S: Add code to store
+ errno using __errno_location.
+ * sysdeps/unix/sysv/linux/sparc/sysdep.h: Add various handler
+ macros for assembler sources.
+ * sysdeps/unix/sysv/linux/sparc/errno.c: Define errno.
+
+1997-02-25 16:02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf/rtld.c (dl_main): Remove dead code that is never executed.
+ Rename local variable l to main_map where it is used to point to
+ the load_map for the executable.
+
+1997-02-25 15:03 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf/dl-version.c (_dl_check_all_versions): Ignore libraries that
+ could not be found.
+
+1997-02-24 23:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * Makerules: Generate implicit object suffix rules automagically.
+ (o-iterator): Move before first use.
+
+ * Makeconfig (all-object-suffixes): Add .bo suffix.
+
+1997-02-25 15:11 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/libm-i387/e_acoshf.S (__ieee754_acoshf): Test correct
+ word on stack for overflow.
+
1997-02-24 23:05 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
* malloc/malloc.c (malloc_get_state): New function.
__STRICT_ANSI__.
* math/math.h: Prevent definition of struct exception when using
- C++.
+ C++. Use __exception instead.
1997-02-22 01:45 Ulrich Drepper <drepper@cygnus.com>
# to pass different flags for each flavor.
libtypes = $(foreach o,$(object-suffixes),$(libtype$o))
object-suffixes := .o
-all-object-suffixes := .o .so .po .go
+all-object-suffixes := .o .so .po .go .bo
libtype.o := lib%.a
ifeq (yes,$(build-shared))
# Under --enable-shared, we will build a shared library of PIC objects.
else
ar-symtab-name = # The null name is used in ELF archives.
endif
+
+# This variable is used in ``include $(o-iterator)'' after defining
+# $(o-iterator-doit) to produce some desired rule using $o for the object
+# suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy
+# is produced for each object suffix in use.
+o-iterator = $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
\f
# Include any system-specific makefiles.
# generated sysdep rules in included from sysd-rules below. When
# compiling in the source tree, generated sources go into the current
# directory, and those should be chosen before any sources in sysdeps.
-$(objpfx)%.o: %.S $(before-compile); $(compile-command.S)
-$(objpfx)%.so: %.S $(before-compile); $(compile-command.S)
-$(objpfx)%.po: %.S $(before-compile); $(compile-command.S)
-$(objpfx)%.go: %.S $(before-compile); $(compile-command.S)
-$(objpfx)%.bo: %.S $(before-compile); $(compile-command.S)
+define o-iterator-doit
+$(objpfx)%$o: %.S $(before-compile); $$(compile-command.S)
+endef
+object-suffixes-left := $(object-suffixes)
+include $(o-iterator)
$(objpfx)%.d: %.S $(before-compile); $(+make-deps)
-$(objpfx)%.o: %.s $(before-compile); $(compile-command.s)
-$(objpfx)%.so: %.s $(before-compile); $(compile-command.s)
-$(objpfx)%.po: %.s $(before-compile); $(compile-command.s)
-$(objpfx)%.go: %.s $(before-compile); $(compile-command.s)
-$(objpfx)%.bo: %.s $(before-compile); $(compile-command.s)
+
+define o-iterator-doit
+$(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
+endef
+object-suffixes-left := $(object-suffixes)
+include $(o-iterator)
$(objpfx)%.d: %.s $(common-objpfx)dummy.d; $(make-dummy-dep)
-$(objpfx)%.o: %.c $(before-compile); $(compile-command.c)
-$(objpfx)%.so: %.c $(before-compile); $(compile-command.c)
-$(objpfx)%.po: %.c $(before-compile); $(compile-command.c)
-$(objpfx)%.go: %.c $(before-compile); $(compile-command.c)
-$(objpfx)%.bo: %.c $(before-compile); $(compile-command.c)
+
+define o-iterator-doit
+$(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
+endef
+object-suffixes-left := $(object-suffixes)
+include $(o-iterator)
$(objpfx)%.d: %.c $(before-compile); $(+make-deps)
# Omit the objpfx rules when building in the source tree, because
ifdef objpfx
# Define first rules to find the source files in $(objpfx).
# Generated source files will end up there.
-$(objpfx)%.o: $(objpfx)%.S $(before-compile); $(compile-command.S)
-$(objpfx)%.so: $(objpfx)%.S $(before-compile); $(compile-command.S)
-$(objpfx)%.po: $(objpfx)%.S $(before-compile); $(compile-command.S)
-$(objpfx)%.go: $(objpfx)%.S $(before-compile); $(compile-command.S)
-$(objpfx)%.bo: $(objpfx)%.S $(before-compile); $(compile-command.S)
+define o-iterator-doit
+$(objpfx)%$o: $(objpfx)%.S $(before-compile); $$(compile-command.S)
+endef
+object-suffixes-left := $(object-suffixes)
+include $(o-iterator)
$(objpfx)%.d: $(objpfx)%.S $(before-compile); $(+make-deps)
-$(objpfx)%.o: $(objpfx)%.s $(before-compile); $(compile-command.s)
-$(objpfx)%.so: $(objpfx)%.s $(before-compile); $(compile-command.s)
-$(objpfx)%.po: $(objpfx)%.s $(before-compile); $(compile-command.s)
-$(objpfx)%.go: $(objpfx)%.s $(before-compile); $(compile-command.s)
-$(objpfx)%.bo: $(objpfx)%.s $(before-compile); $(compile-command.s)
+
+define o-iterator-doit
+$(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
+endef
+object-suffixes-left := $(object-suffixes)
+include $(o-iterator)
$(objpfx)%.d: $(objpfx)%.s $(common-objpfx)dummy.d; $(make-dummy-dep)
-$(objpfx)%.o: $(objpfx)%.c $(before-compile); $(compile-command.c)
-$(objpfx)%.so: $(objpfx)%.c $(before-compile); $(compile-command.c)
-$(objpfx)%.po: $(objpfx)%.c $(before-compile); $(compile-command.c)
-$(objpfx)%.go: $(objpfx)%.c $(before-compile); $(compile-command.c)
-$(objpfx)%.bo: $(objpfx)%.c $(before-compile); $(compile-command.c)
+
+define o-iterator-doit
+$(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
+endef
+object-suffixes-left := $(object-suffixes)
+include $(o-iterator)
$(objpfx)%.d: $(objpfx)%.c $(before-compile); $(+make-deps)
endif
override objects := $(addprefix $(objpfx),$(sources:.c=.o))
-# This variable is used in ``include $(o-iterator)'' after defining
-# $(o-iterator-doit) to produce some desired rule using $o for the object
-# suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy
-# is produced for each object suffix in use.
-o-iterator = $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
-
# The makefile may define $(extra-libs) with `libfoo libbar'
# to build libfoo.a et al from the modules listed in $(libfoo-routines).
ifdef extra-libs
int result = 0;
for (l = map; l != NULL; l = l->l_next)
- result |= _dl_check_map_versions (l, verbose);
+ result |= l->l_opencount != 0 && _dl_check_map_versions (l, verbose);
return result;
}
#error "sysdeps/MACHINE/dl-machine.h fails to define RTLD_START"
#endif
-ElfW(Addr)
+static ElfW(Addr)
_dl_start (void *arg)
{
struct link_map bootstrap_map;
_dl_rtld_map.l_info[DT_STRTAB]->d_un.d_ptr +
_dl_rtld_map.l_info[DT_RPATH]->d_un.d_val);
+#ifdef ELF_ADJUST_ARG
+ ELF_ADJUST_ARG(arg);
+#endif
+
/* Call the OS-dependent function to set up life so we can do things like
file access. It will call `dl_main' (below) to do all the real work
of the dynamic linker, and then unwind our frame and run the user
ElfW(Addr) *user_entry)
{
const ElfW(Phdr) *ph;
- struct link_map *l;
+ struct link_map *main_map;
int lazy;
enum { normal, list, verify, trace } mode;
struct link_map **preloads;
{
void doit (void)
{
- l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
+ main_map = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
}
char *err_str = NULL;
const char *obj_name __attribute__ ((unused));
}
}
else
- l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
+ main_map = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
- phdr = l->l_phdr;
- phent = l->l_phnum;
- l->l_name = (char *) "";
- *user_entry = l->l_entry;
+ phdr = main_map->l_phdr;
+ phent = main_map->l_phnum;
+ main_map->l_name = (char *) "";
+ *user_entry = main_map->l_entry;
}
else
{
/* Create a link_map for the executable itself.
This will be what dlopen on "" returns. */
- l = _dl_new_object ((char *) "", "", lt_executable);
- if (l == NULL)
+ main_map = _dl_new_object ((char *) "", "", lt_executable);
+ if (main_map == NULL)
_dl_sysdep_fatal ("cannot allocate memory for link map", NULL);
- l->l_phdr = phdr;
- l->l_phnum = phent;
- l->l_entry = *user_entry;
- }
-
- if (l != _dl_loaded)
- {
- /* GDB assumes that the first element on the chain is the
- link_map for the executable itself, and always skips it.
- Make sure the first one is indeed that one. */
- l->l_prev->l_next = l->l_next;
- if (l->l_next)
- l->l_next->l_prev = l->l_prev;
- l->l_prev = NULL;
- l->l_next = _dl_loaded;
- _dl_loaded->l_prev = l;
- _dl_loaded = l;
+ main_map->l_phdr = phdr;
+ main_map->l_phnum = phent;
+ main_map->l_entry = *user_entry;
}
/* Scan the program header table for the dynamic section. */
case PT_DYNAMIC:
/* This tells us where to find the dynamic section,
which tells us everything we need to do. */
- l->l_ld = (void *) l->l_addr + ph->p_vaddr;
+ main_map->l_ld = (void *) main_map->l_addr + ph->p_vaddr;
break;
case PT_INTERP:
/* This "interpreter segment" was used by the program loader to
dlopen call or DT_NEEDED entry, for something that wants to link
against the dynamic linker as a shared library, will know that
the shared object is already loaded. */
- _dl_rtld_libname.name = (const char *) l->l_addr + ph->p_vaddr;
+ _dl_rtld_libname.name = (const char *) main_map->l_addr + ph->p_vaddr;
_dl_rtld_libname.next = NULL;
_dl_rtld_map.l_libname = &_dl_rtld_libname;
has_interp = 1;
if (mode == verify)
/* We were called just to verify that this is a dynamic executable
using us as the program interpreter. */
- _exit (l->l_ld == NULL ? 1 : has_interp ? 0 : 2);
+ _exit (main_map->l_ld == NULL ? 1 : has_interp ? 0 : 2);
/* Extract the contents of the dynamic section for easy access. */
- elf_get_dynamic_info (l->l_ld, l->l_info);
- if (l->l_info[DT_HASH])
+ elf_get_dynamic_info (main_map->l_ld, main_map->l_info);
+ if (main_map->l_info[DT_HASH])
/* Set up our cache of pointers into the hash table. */
- _dl_setup_hash (l);
+ _dl_setup_hash (main_map);
/* Put the link_map for ourselves on the chain so it can be found by
- name. */
+ name. Note that at this point the global chain of link maps contains
+ exactly one element, which is pointed to by main_map. */
if (! _dl_rtld_map.l_name)
/* If not invoked directly, the dynamic linker shared object file was
found by the PT_INTERP name. */
_dl_rtld_map.l_name = (char *) _dl_rtld_map.l_libname->name;
_dl_rtld_map.l_type = lt_library;
- while (l->l_next)
- l = l->l_next;
- l->l_next = &_dl_rtld_map;
- _dl_rtld_map.l_prev = l;
+ main_map->l_next = &_dl_rtld_map;
+ _dl_rtld_map.l_prev = main_map;
/* We have two ways to specify objects to preload: via environment
variable and via the file /etc/ld.so.preload. The later can also
/* Load all the libraries specified by DT_NEEDED entries. If LD_PRELOAD
specified some libraries to load, these are inserted before the actual
dependencies in the executable's searchlist for symbol resolution. */
- _dl_map_object_deps (l, preloads, npreloads, mode == trace);
+ _dl_map_object_deps (main_map, preloads, npreloads, mode == trace);
#ifndef MAP_ANON
/* We are done mapping things, so close the zero-fill descriptor. */
chain in symbol search order because gdb uses the chain's order as
its symbol search order. */
unsigned int i = 1;
- while (l->l_searchlist[i] != &_dl_rtld_map)
+ while (main_map->l_searchlist[i] != &_dl_rtld_map)
++i;
- _dl_rtld_map.l_prev = l->l_searchlist[i - 1];
- _dl_rtld_map.l_next = (i + 1 < l->l_nsearchlist ?
- l->l_searchlist[i + 1] : NULL);
+ _dl_rtld_map.l_prev = main_map->l_searchlist[i - 1];
+ _dl_rtld_map.l_next = (i + 1 < main_map->l_nsearchlist ?
+ main_map->l_searchlist[i + 1] : NULL);
assert (_dl_rtld_map.l_prev->l_next == _dl_rtld_map.l_next);
_dl_rtld_map.l_prev->l_next = &_dl_rtld_map;
if (_dl_rtld_map.l_next)
{
void doit (void)
{
- if (_dl_check_all_versions (l, 1) && mode == normal)
+ if (_dl_check_all_versions (main_map, 1) && mode == normal)
/* We cannot start the application. Abort now. */
_exit (1);
}
if (! _dl_loaded->l_info[DT_NEEDED])
_dl_sysdep_message ("\t", "statically linked\n", NULL);
else
- for (l = _dl_loaded->l_next; l; l = l->l_next)
- if (l->l_opencount == 0)
- /* The library was not found. */
- _dl_sysdep_message ("\t", l->l_libname->name, " => not found\n",
- NULL);
- else
- {
- char buf[20], *bp;
- buf[sizeof buf - 1] = '\0';
- bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
- while ((size_t) (&buf[sizeof buf - 1] - bp)
- < sizeof l->l_addr * 2)
- *--bp = '0';
- _dl_sysdep_message ("\t", l->l_libname->name, " => ", l->l_name,
- " (0x", bp, ")\n", NULL);
- }
+ {
+ struct link_map *l;
+
+ for (l = _dl_loaded->l_next; l; l = l->l_next)
+ if (l->l_opencount == 0)
+ /* The library was not found. */
+ _dl_sysdep_message ("\t", l->l_libname->name, " => not found\n",
+ NULL);
+ else
+ {
+ char buf[20], *bp;
+ buf[sizeof buf - 1] = '\0';
+ bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
+ while ((size_t) (&buf[sizeof buf - 1] - bp)
+ < sizeof l->l_addr * 2)
+ *--bp = '0';
+ _dl_sysdep_message ("\t", l->l_libname->name, " => ",
+ l->l_name, " (0x", bp, ")\n", NULL);
+ }
+ }
if (mode != trace)
for (i = 1; i < _dl_argc; ++i)
else if (lazy >= 0)
{
/* We have to do symbol dependency testing. */
+ struct link_map *l;
void doit (void)
{
_dl_relocate_object (l, _dl_object_relocation_scope (l), lazy);
the dynamic linker out of order because it has no copy relocs (we
know that because it is self-contained). */
+ struct link_map *l;
l = _dl_loaded;
while (l->l_next)
l = l->l_next;
{
/* Initialize _r_debug. */
struct r_debug *r = _dl_debug_initialize (_dl_rtld_map.l_addr);
+ struct link_map *l;
l = _dl_loaded;
}
void
-DEFUN(_IO_file_finish, (fp),
- register _IO_FILE* fp)
+DEFUN(_IO_file_finish, (fp, dummy),
+ register _IO_FILE* fp AND int dummy)
{
if (_IO_file_is_open(fp))
{
if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
_IO_SYSCLOSE (fp);
}
- _IO_default_finish(fp);
+ _IO_default_finish(fp, 0);
}
_IO_FILE *
current implementation, this function can get called twice! */
void
-DEFUN(_IO_default_finish, (fp),
- _IO_FILE *fp)
+DEFUN(_IO_default_finish, (fp, dummy),
+ _IO_FILE *fp AND int dummy)
{
struct _IO_marker *mark;
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
/* The 'finish' function does any final cleaning up of an _IO_FILE object.
It does not delete (free) it, but does everything else to finalize it/
It matches the streambuf::~streambuf virtual destructor. */
-typedef void (*_IO_finish_t) __P((_IO_FILE*)); /* finalize */
-#define _IO_FINISH(FP) JUMP0(__finish, FP)
+typedef void (*_IO_finish_t) __P((_IO_FILE*, int)); /* finalize */
+#define _IO_FINISH(FP) JUMP1(__finish, FP, 0)
/* The 'overflow' hook flushes the buffer.
The second argument is a character, or EOF.
extern int _IO_default_underflow __P((_IO_FILE*));
extern int _IO_default_uflow __P((_IO_FILE*));
extern int _IO_default_doallocate __P((_IO_FILE*));
-extern void _IO_default_finish __P((_IO_FILE *));
+extern void _IO_default_finish __P((_IO_FILE *, int));
extern int _IO_default_pbackfail __P((_IO_FILE*, int));
extern _IO_FILE* _IO_default_setbuf __P((_IO_FILE *, char*, _IO_ssize_t));
extern _IO_size_t _IO_default_xsputn __P((_IO_FILE *, const void*, _IO_size_t));
extern int _IO_file_sync __P((_IO_FILE*));
extern int _IO_file_close_it __P((_IO_FILE*));
extern _IO_fpos_t _IO_file_seek __P((_IO_FILE *, _IO_off_t, int));
-extern void _IO_file_finish __P((_IO_FILE*));
+extern void _IO_file_finish __P((_IO_FILE*, int));
/* Other file functions. */
extern _IO_FILE* _IO_file_attach __P((_IO_FILE *, int));
extern int _IO_str_overflow __P((_IO_FILE *, int));
extern int _IO_str_pbackfail __P((_IO_FILE*, int));
extern _IO_fpos_t _IO_str_seekoff __P((_IO_FILE*,_IO_off_t,int,int));
-extern void _IO_str_finish __P ((_IO_FILE*));
+extern void _IO_str_finish __P ((_IO_FILE*, int));
/* Other strfile functions */
extern void _IO_str_init_static __P((_IO_FILE *, char*, int, char*));
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 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
static int _IO_mem_sync __P ((_IO_FILE* fp));
-static void _IO_mem_finish __P ((_IO_FILE* fp));
+static void _IO_mem_finish __P ((_IO_FILE* fp, int));
static const struct _IO_jump_t _IO_mem_jumps =
static void
-_IO_mem_finish (fp)
+_IO_mem_finish (fp, dummy)
_IO_FILE* fp;
+ int dummy;
{
struct _IO_FILE_memstream *mp = (struct _IO_FILE_memstream *) fp;
fp->_IO_buf_base = NULL;
- _IO_default_finish (fp);
+ _IO_default_finish (fp, 0);
}
}
void
-DEFUN (_IO_str_finish, (fp),
- register _IO_FILE* fp)
+DEFUN (_IO_str_finish, (fp, dummy),
+ register _IO_FILE* fp AND int dummy)
{
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
(((_IO_strfile*)fp)->_s._free_buffer)(fp->_IO_buf_base);
fp->_IO_buf_base = NULL;
- _IO_default_finish(fp);
+ _IO_default_finish(fp, 0);
}
struct _IO_jump_t _IO_str_jumps = {
subdir := manual
export subdir := $(subdir)
+# We need GNU awk for the xtract-typefun script.
+GAWK = gawk
+
.PHONY: all dvi info
all: dvi info
dvi: libc.dvi
# touch is broken on our machines. Sigh.
date > $@
+# Generate a file which can be added to the `dir' content to provide direct
+# access to the documentation of the function, variables, and other
+# definitions.
+dir-add.texi: manual/xtract-typefun.awk $(chapters-incl)
+ if test -n "$(chapters-incl)"; then \
+ (for i in $(chapters-incl); do \
+ $(GAWK) -f $< < $i; \
+ done) | sort > $@.new; \
+ ./move-if-change $@.new $@; \
+ fi
+
# Generate Texinfo files from the C source for the example programs.
%.c.texi: examples/%.c
sed -e 's,[{}],@&,g' \
$(patsubst examples/%.c,%.c.texi,$(filter examples/%.c, \
$(minimal-dist))) \
libc.info* libc.?? libc.??s texinfo.tex summary.texi \
- stamp-summary chapters chapters-incl
+ stamp-summary chapters chapters-incl \
+ xtract-typefun.awk
export distribute := $(distribute)
tar-it = tar chovf $@ $^
@end table
@end deftypefun
+@strong{Compatibility Note:} A problem when working with the
+@code{signal} function is that it has a different semantic on BSD and
+SVID system. The difference is that on SVID systems the signal handler
+is deinstalled after an signal was delivered. On BSD systems the
+handler must be explicitly deinstalled. In the GNU C Library we use the
+BSD version by default. To use the SVID version you can either use the
+function @code{sysv_signal} (see below) or use the @code{_XOPEN_SOURCE}
+feature select macro (@pxref{Feature Test Macros}) Generally it should
+be avoided to use this functions due to the compatibility problems. It
+is better to use @code{sigaction} if it is available since the results
+are much more reliable.
+
Here is a simple example of setting up a handler to delete temporary
files when certain fatal signals happen:
(a core dump), and the temporary files may give useful information.
@comment signal.h
+@comment GNU
+@deftypefun sighandler_t sysv_signal (int @var{signum}, sighandler_t @var{action})
+The @code{sysv_signal} implements the behaviour of the standard
+@code{signal} function as found on SVID systems. The difference to BSD
+systems is that the handler is deinstalled after a delivery of a signal.
+
+@strong{Compatibility Note:} As said above for @code{signal}, this
+function should be avoided when possible. @code{sigaction} is the
+preferred method.
+@end deftypefun
+
+@comment signal.h
@comment SVID
@deftypefun sighandler_t ssignal (int @var{signum}, sighandler_t @var{action})
The @code{ssignal} function does the same thing as @code{signal}; it is
--- /dev/null
+#! /usr/local/bin/gawk -f
+BEGIN {
+ last_node="";
+}
+
+/^@node/ {
+ last_node = gensub (/@node +([^@,]+).*/, "\\1", 1);
+}
+
+/^@deftypefun/ {
+ printf ("* %s: (libc)%s.\n",
+ gensub (/@deftypefun +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]+).*/, "\\2", 1),
+ last_node);
+}
+
+/^@deftypevr/ {
+ printf ("* %s: (libc)%s.\n",
+ gensub (/@deftypevr +([^{ ]+|\{[^}]+\}) +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]+).*/, "\\3", 1),
+ last_node);
+}
+
+/^@deftypefn/ {
+ printf ("* %s: (libc)%s.\n",
+ gensub (/@deftypefn +([^{ ]+|\{[^}]+\}) +[^{ ]*(\{[^}]+\})? +([[:alpha:]_][[:alnum:]_]+).*/, "\\3", 1),
+ last_node);
+}
#endif
-#if defined __USE_SVID && !defined __cplusplus
+#ifdef __USE_SVID
/* In SVID error handling, `matherr' is called with this description
of the exceptional condition.
We have a problem when using C++ since `exception' is reserved in
C++. */
+#ifdef __cplusplus
+struct __exception
+#else
struct exception
+#endif
{
int type;
char *name;
double retval;
};
+#ifdef __cplusplus
+extern int __matherr __P ((struct __exception *));
+extern int matherr __P ((struct __exception *));
+#else
extern int __matherr __P ((struct exception *));
extern int matherr __P ((struct exception *));
+#endif
#define X_TLOSS 1.41484755040568800000e+16
#define HUGE FLT_MAX
#include <float.h> /* Defines FLT_MAX. */
-#endif /* SVID && !C++ */
+#endif /* SVID */
#ifdef __USE_BSD
/* Get machine-dependent inline versions (if there are any). */
-#if defined (__NO_MATH_INLINES) || defined (__OPTIMIZE__)
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
#include <__math.h>
#endif
/* Save the old one. */
s = t;
/* Tricky, tricky. */
- t.c_lflag &= ~(ECHO|ISIG|ICANON);
- t.c_cc[VTIME] = 0;
- t.c_cc[VMIN] = 1;
+ t.c_lflag &= ~(ECHO|ISIG);
tty_changed = (tcsetattr (fileno (in), TCSAFLUSH|TCSASOFT, &t) == 0);
}
else
-/* Copyright (C) 1993 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1993, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <ansidecl.h>
#include <netinet/in.h>
#undef htonl
-unsigned long int
-DEFUN(htonl, (x), unsigned long int x)
+u_int32_t
+htonl (x)
+ u_int32_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24);
-/* Copyright (C) 1993 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1993, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <ansidecl.h>
#include <netinet/in.h>
#undef htons
-unsigned short int
-DEFUN(htons, (x), unsigned short int x)
+u_int16_t
+htons (x)
+ u_int16_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
x = (x << 8) | (x >> 8);
struct in_addr imr_interface; /* local IP address of interface */
};
-/* Functions to convert between host and network byte order. */
+/* Functions to convert between host and network byte order.
-extern unsigned long int ntohl __P ((unsigned long int));
-extern unsigned short int ntohs __P ((unsigned short int));
-extern unsigned long int htonl __P ((unsigned long int));
-extern unsigned short int htons __P ((unsigned short int));
+ Please note that these functions normally take `unsigned long int' or
+ `unsigned short int' values as arguments and also return them. But
+ this was a short-sighted decision since on different systems the types
+ may have different representations but the values are always the same. */
+
+extern u_int32_t ntohl __P ((u_int32_t __netlong));
+extern u_int16_t ntohs __P ((u_int16_t __netshort));
+extern u_int32_t htonl __P ((u_int32_t __hostlong));
+extern u_int16_t htons __P ((u_int16_t __hostshort));
#include <endian.h>
-/* Copyright (C) 1993 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1993, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <ansidecl.h>
#include <netinet/in.h>
#undef ntohl
-unsigned long int
-DEFUN(ntohl, (x), unsigned long int x)
+u_int32_t
+ntohl (x)
+ u_int32_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
x = (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24);
-/* Copyright (C) 1993 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1993, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <ansidecl.h>
#include <netinet/in.h>
#undef ntohs
-unsigned short int
-DEFUN(ntohs, (x), unsigned short int x)
+u_int16_t
+ntohs (x)
+ u_int16_t x;
{
#if BYTE_ORDER == LITTLE_ENDIAN
x = (x << 8) | (x >> 8);
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
.text
ENTRY(__ieee754_acoshf)
- movl 8(%esp), %ecx
+ movl 4(%esp), %ecx
cmpl $0x3f800000, %ecx
jl 5f // < 1 => invalid
fldln2 // log(2)
/* ix87 specific implementation of arcsinh.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
.text
ENTRY(__ieee754_acoshl)
movl 12(%esp), %ecx
+ andl $0xffff, %ecx
cmpl $0x3fff, %ecx
jl 5f // < 1 => invalid
fldln2 // log(2)
/* O_*, F_*, FD_* bit values for GNU.
-Copyright (C) 1993, 1994, 1996, 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ Copyright (C) 1993, 1994, 1996, 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. */
#ifndef _FCNTLBITS_H
DEFS.h
+elf/DEFS.h
dotmul.S umul.S
divrem.m4 sdiv.S udiv.S rem.S urem.S
alloca.S
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Sparc version.
-Copyright (C) 1994 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1994, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <sysdep.h>
-ENTRY (setjmp)
+ENTRY (_setjmp)
+#ifdef PIC
+1:
+ jmpl 2f,%o1
+ nop
+2:
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
+ or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
+ add %l7,%o1,%l7
+ sethi %hi(C_SYMBOL_NAME (__sigsetjmp)),%g1
+ or %g1,%lo(C_SYMBOL_NAME (__sigsetjmp)),%g1
+ ld [%l7+%g1],%g1
+ ld [%g1],%g1
+ jmpl %g1,%g0
+ mov %g0,%o1 /* Pass second argument of zero */
+#else
+
sethi %hi(C_SYMBOL_NAME (__sigsetjmp)), %g1
or %lo(C_SYMBOL_NAME (__sigsetjmp)), %g1, %g1
jmp %g1
mov %g0, %o1 /* Pass second argument of zero. */
+#endif
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Sparc version.
-Copyright (C) 1994 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1994, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <sysdep.h>
ENTRY (setjmp)
+#ifdef PIC
+1:
+ jmpl 2f,%o1
+ nop
+2:
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
+ or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%l7
+ add %l7,%o1,%l7
+ sethi %hi(C_SYMBOL_NAME (__sigsetjmp)),%g1
+ or %g1,%lo(C_SYMBOL_NAME (__sigsetjmp)),%g1
+ ld [%l7+%g1],%g1
+ ld [%g1],%g1
+ jmpl %g1,%g0
+ mov 1,%o1
+#else
sethi %hi(C_SYMBOL_NAME (__sigsetjmp)), %g1
or %lo(C_SYMBOL_NAME (__sigsetjmp)), %g1, %g1
jmp %g1
mov 1, %o1 /* Pass second argument of one. */
+#endif
ifelse($1, 1, `9:')')dnl
#include "DEFS.h"
+#ifdef __linux__
+#include <asm/traps.h>
+#else
#ifdef __svr4__
#include <sys/trap.h>
#else
#include <machine/trap.h>
#endif
+#endif
FUNC(NAME)
ifelse(S, `true',
/* Machine-dependent ELF dynamic relocation inline functions. SPARC version.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 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
static inline int
elf_machine_matches_host (Elf32_Half e_machine)
{
- switch (e_machine)
- {
- case EM_SPARC:
- return 1;
- default:
- return 0;
- }
+ return e_machine == EM_SPARC;
}
elf_machine_load_address (void)
{
Elf32_Addr addr;
-???
+
+ asm (
+ "add %%fp,0x44,%%o2\n\t" /* o2 = point to argc */
+ "ld [%%o2 - 4],%%o0\n\t" /* o0 = load argc */
+ "sll %%o0, 2, %%o0\n\t" /* o0 = argc * sizeof (int) */
+ "add %%o2,%%o0,%%o2\n\t" /* o2 = skip over argv */
+ "add %%o2,4,%%o2\n\t" /* skip over null after argv */
+
+ /* Now %o2 is pointing to env, skip over that as well. */
+ "1:\n\t"
+ "ld [%%o2],%%o0\n\t"
+ "cmp %%o0,0\n\t"
+ "bnz 1b\n\t"
+ "add %%o2,4,%%o2\n\t"
+
+ /* Note that above, we want to advance the NULL after envp so
+ we always add 4. */
+
+ /* Now, search for the AT_BASE property. */
+ "2:\n\t"
+ "ld [%%o2],%%o0\n\t"
+ "cmp %%o0,0\n\t"
+ "be,a 3f\n\t"
+ "or %%g0,%%g0,%0\n\t"
+ "cmp %%o0,7\n\t" /* AT_BASE = 7 */
+ "be,a 3f\n\t"
+ "ld [%%o2+4],%0\n\t"
+ "b 2b\n\t"
+ "add %%o2,8,%%o2\n\t"
+ /* At this point %0 has the load address for the interpreter */
+ "3:\n\t"
+ : "=r" (addr)
+ : /* no inputs */
+ : "o0", "o2");
return addr;
}
-/* The `subl' insn above will contain an R_68K_RELATIVE relocation
- entry intended to insert the run-time address of the label `here'.
- This will be the first relocation in the text of the dynamic
- linker; we skip it to avoid trying to modify read-only text in this
- early stage. */
-#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
- ((dynamic_info)[DT_RELA]->d_un.d_ptr += sizeof (Elf32_Rela), \
- (dynamic_info)[DT_RELASZ]->d_un.d_val -= sizeof (Elf32_Rela))
-
+#ifdef RESOLVE
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
MAP is the object containing the reloc. */
static inline void
elf_machine_rela (struct link_map *map,
- const Elf32_Rela *reloc, const Elf32_Sym *sym,
- Elf32_Addr (*resolve) (const Elf32_Sym **ref,
- Elf32_Addr reloc_addr,
- int noplt))
+ const Elf32_Rela *reloc, const Elf32_Sym *sym)
{
Elf32_Addr *const reloc_addr = (void *) (map->l_addr + reloc->r_offset);
Elf32_Addr loadbase;
switch (ELF32_R_TYPE (reloc->r_info))
{
case R_SPARC_COPY:
- loadbase = (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0);
+ loadbase = RESOLVE (&sym, DL_LOOKUP_NOEXEC);
memcpy (reloc_addr, (void *) (loadbase + sym->st_value), sym->st_size);
break;
case R_SPARC_GLOB_DAT:
case R_SPARC_32:
- loadbase = (resolve ? (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0) :
- /* RESOLVE is null during bootstrap relocation. */
- map->l_addr);
+ loadbase = RESOLVE (&sym, 0);
*reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend);
break;
case R_SPARC_JMP_SLOT:
- loadbase = (resolve ? (*resolve) (&sym, (Elf32_Addr) reloc_addr, 1) :
- /* RESOLVE is null during bootstrap relocation. */
- map->l_addr);
+ loadbase = RESOLVE (&sym, DL_LOOKUP_NOPLT);
{
Elf32_Addr value = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend);
}
break;
case R_SPARC_8:
- loadbase = (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0);
+ loadbase = RESOLVE (&sym, 0);
*(char *) reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend);
break;
case R_SPARC_16:
- loadbase = (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0);
+ loadbase = RESOLVE (&sym, 0);
*(short *) reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend);
break;
- case R_SPARC_32:
- loadbase = (resolve ? (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0) :
- /* RESOLVE is null during bootstrap relocation. */
- map->l_addr);
- break;
case R_SPARC_RELATIVE:
- *reloc_addr = map->l_addr + reloc->r_addend;
+ *reloc_addr += map->l_addr + reloc->r_addend;
break;
case R_SPARC_DISP8:
- loadbase = (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0);
+ loadbase = RESOLVE (&sym, 0);
*(char *) reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend
- (Elf32_Addr) reloc_addr);
- (Elf32_Addr) reloc_addr);
break;
case R_SPARC_DISP32:
- loadbase = (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0);
+ loadbase = RESOLVE (&sym, 0);
*reloc_addr = ((sym ? (loadbase + sym->st_value) : 0)
+ reloc->r_addend
- (Elf32_Addr) reloc_addr);
break;
+ case R_SPARC_LO10:
+ {
+ unsigned int saddr;
+
+ loadbase = RESOLVE (&sym, 0);
+ saddr = (loadbase ? loadbase : map->l_addr) + reloc->r_addend;
+
+ *reloc_addr = (*reloc_addr & ~0x3ff) | (saddr & 0x3ff);
+ }
+ break;
+ case R_SPARC_HI22:
+ {
+ unsigned int saddr;
+
+ loadbase = RESOLVE (&sym, 0);
+ saddr = (loadbase ? loadbase : map->l_addr) + reloc->r_addend;
+
+ *reloc_addr = (*reloc_addr & 0xffc00000)|(saddr >> 10);
+ }
+ break;
case R_SPARC_NONE: /* Alright, Wilbur. */
break;
default:
}
}
+#define ELF_ADJUST_ARG(arg) __asm__("\tadd %%fp,64,%0\n" : "=r" (arg))
+
+#endif /* RESOLV */
+
/* Nonzero iff TYPE describes relocation of a PLT entry, so
PLT entries should not be allowed to define the value. */
#define elf_machine_pltrel_p(type) ((type) == R_SPARC_JMP_SLOT)
plt[1] = OPCODE_CALL | (((Elf32_Addr) &_dl_runtime_resolve -
(Elf32_Addr) &plt[1]) >> 2);
plt[2] = OPCODE_NOP; /* Fill call delay slot. */
- plt[3] = l;
+ plt[3] = (Elf32_Addr *) l;
}
/* This code is used in dl-runtime.c to call the `fixup' function
and then redirect to the address it returns. */
#define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
-| Trampoline for _dl_runtime_resolver
+# Trampoline for _dl_runtime_resolver
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, @function
_dl_runtime_resolve:
- | Pass two args to fixup: the PLT address computed from the PC saved
- | in the PLT's call insn, and the reloc offset passed in %g1.
- ld [%o7 + 8], %o1 | Second arg, loaded from PLTPC[2].
- call fixup
- shrl %g1, 22, %o0 | First arg, set in delay slot of call.
- | Jump to the real function.
- jmpl %o0, %g0
- | In the delay slot of that jump, restore the register window
- | saved by the first insn of the PLT.
- restore
+ #call %g0
+ # Pass two args to fixup: the PLT address computed from the PC saved
+ # in the PLT's call insn, and the reloc offset passed in %g1.
+ #ld [%o7 + 8], %o1 | Second arg, loaded from PLTPC[2].
+ #call fixup
+ #shrl %g1, 22, %o0 | First arg, set in delay slot of call.
+ # Jump to the real function.
+ #jmpl %o0, %g0
+ # In the delay slot of that jump, restore the register window
+ # saved by the first insn of the PLT.
+ #restore
.size _dl_runtime_resolve, . - _dl_runtime_resolve
");
/* The PLT uses Elf32_Rela relocs. */
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
-#define RTLD_START asm (???)
+#define RTLD_START __asm__ ( \
+".text\n\
+ .globl _start\n\
+ .type _start,@function\n\
+_start:\n\
+ call _dl_start\n\
+ nop\n\
+ call %o0\n\
+ nop\n\
+");
--- /dev/null
+#define FUNC(name) \
+ .global name; \
+ .type name,@function; \
+ .align 4; \
+ name:
/* Startup code compliant to the ELF SPARC ABI.
-Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1996, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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. */
/* This is the canonical entry point, usually the first thing in the text
segment. The SVR4/SPARC ABI (NOTE: I don't actually have it) says that
sll ENVP, 2, ENVP
add ARGV, ENVP, ENVP
/* Store ENVP in the global variable `_environ'. */
- st [TMP + %lo(_environ)], ENVP
+ ld [TMP + %lo(_environ)], ENVP
/* Call `_init', which is the entry point to our own `.init'
section; and register with `atexit' to have `exit' call
mov ENVP, %o2
call exit /* This should never return. */
+ nop
unimp 0 /* Crash if somehow it does return. */
/* Define a symbol for the first piece of initialized data. */
/* private namespace. It should only be used by crt0.o. */
extern unsigned short __fpu_control;
-__BEGIN_DECLS
-
-/* called by crt0.o. It can be used to manipulate 387 control word. */
-extern void __setfpucw __P ((unsigned short));
-
-__END_DECLS
-
/* Type of the control word. */
typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
#include "DEFS.h"
+#ifdef __linux__
+#include <asm/traps.h>
+#else
#ifdef __svr4__
#include <sys/trap.h>
#else
#include <machine/trap.h>
#endif
+#endif
FUNC(.rem)
! compute sign of result; if neither is negative, no problem
#include "DEFS.h"
+#ifdef __linux__
+#include <asm/traps.h>
+#else
#ifdef __svr4__
#include <sys/trap.h>
#else
#include <machine/trap.h>
#endif
+#endif
FUNC(.div)
! compute sign of result; if neither is negative, no problem
-/* Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1993, 1994, 1996, 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <sysdep.h>
/* Save our SP and FP; in the delay slot of the jump, save our
return PC. Save the signal mask if requested with a tail-call
for simplicity; it always returns zero. */
+#ifdef PIC
+2:
+ jmpl 1f,%g2
+ nop
+1:
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(2b-.)),%l7
+ sethi %hi(C_SYMBOL_NAME (__sigjmp_save)), %g3
+ st %sp, [%o0 + (JB_SP * 4)]
+ or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(2b-.)),%l7
+ or %g3,%lo(C_SYMBOL_NAME (__sigjmp_save)), %g3
+ st %fp, [%o0 + (JB_FP * 4)]
+ ld [%l7+%g3],%g1
+ jmp %g1
+ st %o7, [%o0+(JB_PC*4)]
+#else
sethi %hi(C_SYMBOL_NAME (__sigjmp_save)), %g1
st %sp, [%o0 + (JB_SP*4)]
or %lo(C_SYMBOL_NAME (__sigjmp_save)), %g1, %g1
st %fp, [%o0 + (JB_FP*4)]
jmp %g1
st %o7, [%o0 + (JB_PC*4)]
+#endif /* PIC */
#include "DEFS.h"
+#ifdef __linux__
+#include <asm/traps.h>
+#else
#ifdef __svr4__
#include <sys/trap.h>
#else
#include <machine/trap.h>
#endif
+#endif
FUNC(.udiv)
#include "DEFS.h"
+#ifdef __linux__
+#include <asm/traps.h>
+#else
#ifdef __svr4__
#include <sys/trap.h>
#else
#include <machine/trap.h>
#endif
+#endif
FUNC(.urem)
struct in_addr imr_interface; /* local IP address of interface */
};
-/* Functions to convert between host and network byte order. */
+/* Functions to convert between host and network byte order.
-extern unsigned long int ntohl __P ((unsigned long int));
-extern unsigned short int ntohs __P ((unsigned short int));
-extern unsigned long int htonl __P ((unsigned long int));
-extern unsigned short int htons __P ((unsigned short int));
+ Please note that these functions normally take `unsigned long int' or
+ `unsigned short int' values as arguments and also return them. But
+ this was a short-sighted decision since on different systems the types
+ may have different representations but the values are always the same. */
+
+extern u_int32_t ntohl __P ((u_int32_t __netlong));
+extern u_int16_t ntohs __P ((u_int16_t __netshort));
+extern u_int32_t htonl __P ((u_int32_t __hostlong));
+extern u_int16_t htons __P ((u_int16_t __hostshort));
#include <endian.h>
ifeq ($(subdir),signal)
sysdep_routines += __sigtrampoline
endif
+
+# When I get this to work, this is the right thing
+ifeq ($(subdir),elf)
+CFLAGS-rtld.c += -mv8
+#rtld-routines += dl-sysdepsparc
+endif # elf
+
+asm-CPPFLAGS = -fPIC
/* Contributed by Miguel de Icaza (miguel@gnu.ai.mit.edu) */
/* Many thanks go to David Miller for explaining all this to me */
/* miguel@nuclecu.unam.mx */
-/* Sources: David Miller, 4.4BSD/SPARC code */
+/* Sources: David Miller, 4.4BSD/SPARC code */
#include <sysdep.h>
-
+#define __ASSEMBLY__
/* For REGWIN_SZ */
#include <asm/ptrace.h>
#include <asm/psr.h>
.text
ENTRY(____sparc_signal_trampoline)
- .global SYMBOL_NAME(____sig_table)
+ .global C_SYMBOL_NAME(____sig_table)
/* Make room for 32 %f registers + %fsr
- * this is 132 bytes + alignement = 136
- * 96 is the C frame size
- */
- save %sp,-136-CCFSZ,%sp
+ * this is 132 bytes + alignement = 136
+ * 96 is the C frame size
+ */
+ save %sp,-136-CCFSZ,%sp
/* save regular registers */
mov %g2,%l2
mov %g6,%l6
mov %g7,%l7
- /* save fpu registers */
- ld [%fp+64+16+20],%l0 /* load the psr from sigcontext */
+ /* save fpu registers */
+ ld [%fp+64+16+20],%l0 /* load the psr from sigcontext */
sethi %hi(PSR_EF),%l1
- andcc %l0,%l1,%l0 /* is floating point enabled? */
+ andcc %l0,%l1,%l0 /* is floating point enabled? */
be 1f
rd %y,%l1 /* save y anyways */
/* save fpu registers */
- st %fsr, [%sp + CCFSZ + 0]
- std %f0, [%sp + CCFSZ + 8]
- std %f2, [%sp + CCFSZ + 16]
- std %f4, [%sp + CCFSZ + 24]
- std %f6, [%sp + CCFSZ + 32]
- std %f8, [%sp + CCFSZ + 40]
- std %f10, [%sp + CCFSZ + 48]
- std %f12, [%sp + CCFSZ + 56]
- std %f14, [%sp + CCFSZ + 64]
- std %f16, [%sp + CCFSZ + 72]
- std %f18, [%sp + CCFSZ + 80]
- std %f20, [%sp + CCFSZ + 88]
- std %f22, [%sp + CCFSZ + 96]
- std %f24, [%sp + CCFSZ + 104]
- std %f26, [%sp + CCFSZ + 112]
- std %f28, [%sp + CCFSZ + 120]
- std %f30, [%sp + CCFSZ + 128]
+ st %fsr, [%sp + CCFSZ + 0]
+ std %f0, [%sp + CCFSZ + 8]
+ std %f2, [%sp + CCFSZ + 16]
+ std %f4, [%sp + CCFSZ + 24]
+ std %f6, [%sp + CCFSZ + 32]
+ std %f8, [%sp + CCFSZ + 40]
+ std %f10, [%sp + CCFSZ + 48]
+ std %f12, [%sp + CCFSZ + 56]
+ std %f14, [%sp + CCFSZ + 64]
+ std %f16, [%sp + CCFSZ + 72]
+ std %f18, [%sp + CCFSZ + 80]
+ std %f20, [%sp + CCFSZ + 88]
+ std %f22, [%sp + CCFSZ + 96]
+ std %f24, [%sp + CCFSZ + 104]
+ std %f26, [%sp + CCFSZ + 112]
+ std %f28, [%sp + CCFSZ + 120]
+ std %f30, [%sp + CCFSZ + 128]
1:
/* Load signal number */
/* Sanity check */
cmp %o0,33
bl 1f
- or %g0,%g0,%g1 /*Call sys_setup */
+ or %g0,%g0,%g1 /*Call sys_setup */
t 0x10
1:
#ifdef __PIC__
call ___syy
nop
___syy:
- sethi %hi(_GLOBAL_OFFSET_TABLE_-(___sxx-.)),%o5
- or %o5,%lo(_GLOBAL_OFFSET_TABLE_-(___sxx-.)),%o5
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-(___sxx-.)),%o5
+ or %o5,%lo(_GLOBAL_OFFSET_TABLE_-(___sxx-.)),%o5
add %o7,%o5,%o5
/* restore return address */
mov %o4,%o7
mov %o5,%o4
/* o4 has the GOT pointer */
#endif
- sethi %hi(SYMBOL_NAME(____sig_table)),%o5
- or %o5,%lo(SYMBOL_NAME(____sig_table)),%o5
+ sethi %hi(C_SYMBOL_NAME(____sig_table)),%o5
+ or %o5,%lo(C_SYMBOL_NAME(____sig_table)),%o5
#ifdef __PIC__
add %o5,%o4,%o4
ld [%o4],%o5
add %o5,%o4,%o4
ld [%o4],%o4
ld [%fp + REGWIN_SZ + 4],%o1 /* Load subcode */
- ld [%fp + REGWIN_SZ + 8],%o2 /* pointer to sigcontext */
+ ld [%fp + REGWIN_SZ + 8],%o2 /* pointer to sigcontext */
call %o4
- ld [%fp + REGWIN_SZ + 12],%o3 /* Address where signal occurred */
+ ld [%fp + REGWIN_SZ + 12],%o3 /* Address where signal ocurre
+ */
/* handler returned, restore state */
tst %l0
wr %l1,%g0,%y
/* fpu restoration */
- ld [%sp + CCFSZ + 0], %fsr
- ldd [%sp + CCFSZ + 8], %f0
- ldd [%sp + CCFSZ + 16], %f2
- ldd [%sp + CCFSZ + 24], %f4
- ldd [%sp + CCFSZ + 32], %f6
- ldd [%sp + CCFSZ + 40], %f8
- ldd [%sp + CCFSZ + 48], %f10
- ldd [%sp + CCFSZ + 56], %f12
- ldd [%sp + CCFSZ + 64], %f14
- ldd [%sp + CCFSZ + 72], %f16
- ldd [%sp + CCFSZ + 80], %f18
- ldd [%sp + CCFSZ + 88], %f20
- ldd [%sp + CCFSZ + 96], %f22
- ldd [%sp + CCFSZ + 104], %f24
- ldd [%sp + CCFSZ + 112], %f26
- ldd [%sp + CCFSZ + 120], %f28
- ldd [%sp + CCFSZ + 128], %f30
+ ld [%sp + CCFSZ + 0], %fsr
+ ldd [%sp + CCFSZ + 8], %f0
+ ldd [%sp + CCFSZ + 16], %f2
+ ldd [%sp + CCFSZ + 24], %f4
+ ldd [%sp + CCFSZ + 32], %f6
+ ldd [%sp + CCFSZ + 40], %f8
+ ldd [%sp + CCFSZ + 48], %f10
+ ldd [%sp + CCFSZ + 56], %f12
+ ldd [%sp + CCFSZ + 64], %f14
+ ldd [%sp + CCFSZ + 72], %f16
+ ldd [%sp + CCFSZ + 80], %f18
+ ldd [%sp + CCFSZ + 88], %f20
+ ldd [%sp + CCFSZ + 96], %f22
+ ldd [%sp + CCFSZ + 104], %f24
+ ldd [%sp + CCFSZ + 112], %f26
+ ldd [%sp + CCFSZ + 120], %f28
+ ldd [%sp + CCFSZ + 128], %f30
1:
mov %l2,%g2
mov %l6,%g6
mov %l7,%g7
- /* call sigreturn */
- restore %g0,SYS_sigreturn,%g1 /* register back and set syscall */
+ /* call sigreturn */
+ restore %g0,SYS_ify(sigreturn),%g1 /* register back and set syscal */
add %sp,64+16,%o0
t 0x10
/* if we return, sysreturn failed */
- mov SYS_exit,%g1
+ mov SYS_ify(exit),%g1
t 0x10
--- /dev/null
+itn errno;
void
profil_counter (int signo, __siginfo_t si)
{
- extern int __sparc_old_signals;
-
- if (__sparc_old_signals)
- {
- struct sigcontext_struct *s = (void *) &si;
-
- profil_count ((void *) s->sigc_pc);
- }
- else
- profil_count ((void *) si.si_regs.pc);
+ profil_count ((void *) si.si_regs.pc);
}
#include <sys/signal.h>
#include <errno.h>
+/* Commented out while I figure out what the fuck goes on */
+long ____sig_table [NSIG];
+#if 0
+
/* The kernel will deliver signals in the old way if the signal
number is a positive number. The kernel will deliver a signal
with the new stack layout if the signal number is a negative number.
using at runtime. */
extern void ____sparc_signal_trampoline (int);
-long ____sig_table [NSIG];
int
__trampoline_sigaction (int sig, struct sigaction *new, struct sigaction *old)
"1:"
: "=r" (ret), "=r" ((long int) sig), "=r" ((long int) new),
"=r" ((long int) old)
- : "0" (SYS_sigaction), "1" (sig), "2" (new), "3" (old)
+ : "0" (__NR_sigaction), "1" (sig), "2" (new), "3" (old)
: "g1", "o0", "o1", "o2");
if (ret >= 0)
__set_errno (-ret);
return -1;
}
+#else
+# define __new_sigaction __sigaction
+#endif
int
-__new_sigaction (int sig, struct sigaction *new, struct sigaction *old)
+__new_sigaction (int sig, __const struct sigaction *new, struct sigaction *old)
{
int ret;
"1:"
: "=r" (ret), "=r" ((long int) sig), "=r" ((long int) new),
"=r" ((long int) old)
- : "0" (SYS_sigaction), "1" (sig), "2" (new), "3" (old)
+ : "0" (__NR_sigaction), "1" (sig), "2" (new), "3" (old)
: "g1", "o0", "o1", "o2");
if (ret >= 0)
return 0;
return -1;
}
+#if 0
int
-__sigaction (int sig, struct sigaction *new, struct sigaction *old)
+__sigaction (int sig, __const struct sigaction *new, struct sigaction *old)
{
- static (*sigact_routine) (int, struct sigaction *, struct sigaction *);
+ static (*sigact_routine) (int, __const struct sigaction *, struct sigaction *);
int ret;
struct sigaction sa;
return __sigaction (sig, new, old);
}
+#endif
+
weak_alias (__sigaction, sigaction);
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define DONT_LOAD_G1
#include <sysdep.h>
-ENTRY (__libc_syscall)
+ .text
+ENTRY (syscall)
or %o0,%g0,%g1
or %o1,%g0,%o0
or %o2,%g0,%o1
or %o3,%g0,%o2
or %o4,%g0,%o3
or %o5,%g0,%o4
-PSEUDO_NOENT(__libc_syscall, syscall, 5)
+ ta 0x10
+ bcc 1f
+ nop
+ save %sp, -96, %sp
+ call __errno_location
+ nop
+ st %i0,[%o0]
+ restore
+ retl
+ mov -1, %o0
+1:
ret
-SYSCALL__POST(syscall,5)
+
+PSEUDO_END (syscall)
--- /dev/null
+# File name Caller Syscall name # args Strong name Weak names
+
+s_llseek llseek _llseek 5 __sys_llseek
--- /dev/null
+/* Define errno */
+
+ .common errno,4,4
#ifndef _LINUX_SPARC_SYSDEP_H
#define _LINUX_SPARC_SYSDEP_H 1
+/* Kernel headers use __ASSEMBLY__ */
+#ifdef ASSEMBLER
+#define __ASSEMBLY__
+#endif
+
#include <sysdeps/unix/sparc/sysdep.h>
#undef SYS_ify
#ifdef DONT_LOAD_G1
# define LOADSYSCALL(x)
#else
-# define LOADSYSCALL(x) mov SYS_##n, %g1
+# define LOADSYSCALL(x) mov __NR_##x, %g1
#endif
-/* Linux/SPARC uses a different trap number and uses __errno_location always */
+/* Linux/SPARC uses a different trap number */
#undef PSEUDO
+#ifdef PIC
+#define SYSCALL_ERROR_HANDLER \
+ .global C_SYMBOL_NAME(__errno_location);\
+ .type C_SYMBOL_NAME(__errno_location),@function;\
+ save %sp,-96,%sp;\
+ call __errno_location;\
+ nop;\
+ st %i0,[%o0];\
+ restore;\
+ retl;\
+ mov -1,%o0;
+#else
+#define SYSCALL_ERROR_HANDLER \
+ save %sp,-96,%sp; \
+ call __errno_location; \
+ nop; \
+ st %i0,[%o0]; \
+ restore; \
+ retl; \
+ mov -1,%o0;
+#endif /* PIC */
+
#define PSEUDO(name, syscall_name, args) \
.text; \
ENTRY(name); \
ta 0x10; \
bcc,a 1f; \
nop; \
- save %sp,96,%sp; \
- call __errno_location; \
- nop; \
- st %i0,[%o0]; \
- restore; \
- retl; \
- mov -1,%o0; \
-1:
+ SYSCALL_ERROR_HANDLER; \
+1:;
#endif /* ASSEMBLER */
echo '$*-zones := $$(subst $$(nl), ,$$($*-zones))' ;\
echo 'ifdef $*-zones' ;\
if test x$(findstring $*, $(tzlinks)) != x; then \
- echo '$$(addprefix $$(inst_datadir)/zone%/right/,$$($*-zones)) \';\
- echo '$$(addprefix $$(inst_datadir)/zone%/posix/,$$($*-zones)) \';\
- echo '$$(addprefix $$(inst_datadir)/zone%/,$$($*-zones)): \' ;\
- echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_datadir)/zone%/right/,$$($$t-zones))) \' ;\
- echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_datadir)/zone%/posix/,$$($$t-zones))) \' ;\
- echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_datadir)/zone%/,$$($$t-zones)))' ;\
+ echo '$$(addprefix $$(inst_zonedir)/right/,$$($*-zones)) \';\
+ echo '$$(addprefix $$(inst_zonedir)/posix/,$$($*-zones)) \';\
+ echo '$$(addprefix $$(inst_zonedir)/,$$($*-zones)): \' ;\
+ echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_zonedir)/right/,$$($$t-zones))) \' ;\
+ echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_zonedir)/posix/,$$($$t-zones))) \' ;\
+ echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_zonedir)/,$$($$t-zones)))' ;\
fi ;\
echo '$$(addprefix $$(inst_datadir)/zone%/right/,$$($*-zones)): \' ;\
echo '$< $$(objpfx)zic leapseconds yearistype' ;\