aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-07-16 06:38:54 +0000
committerRoland McGrath <roland@gnu.org>1996-07-16 06:38:54 +0000
commitec42724d6970b2d3e9007de0841394856e84d287 (patch)
tree764952d3965d32f0d4e6fda3f97b40dcb1e6ef61
parented36809a9c00966422a003d239a6ce64e5f08caa (diff)
downloadglibc-ec42724d6970b2d3e9007de0841394856e84d287.zip
glibc-ec42724d6970b2d3e9007de0841394856e84d287.tar.gz
glibc-ec42724d6970b2d3e9007de0841394856e84d287.tar.bz2
Tue Jul 16 00:31:31 1996 Richard Henderson <rth@tamu.edu>cvs/libc-960716
* sysdeps/alpha/dl-machine.h: Mirror Roland's changes to i386/dl-machine.h of 960713. * sysdeps/generic/dl-sysdep.c: Include <sys/mman.h>. (_dl_sysdep_read_whole_file): Fix result variable declaration. Tue Jul 16 00:53:57 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * sysdeps/mach/hurd/uname.c: Call __gethostname to fill in the `nodename' member. Mon Jul 15 17:23:53 1996 Ulrich Drepper <drepper@cygnus.com> * stdio-common/vfprintf.c (vfprintf): Call parse_one_spec with pointer to local variable instead of NULL. 1996-07-15 Paul Eggert <eggert@twinsun.com> * time/strftime.c (strftime): Don't pass empty macro argument to `add'. Sat Jul 13 09:53:39 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove names that are already added by other means. * sysdeps/unix/sysv/linux/syscalls.list: Add more EXTRA's in the caller column to get those syscalls added automagically. * elf/rtld.c (dl_main) [ELF_MACHINE_DEBUG_SETUP]: Use this macro instead of setting the DT_DEBUG pointer. * csu/initfini.c (_init, _fini): Generate .end directives after standalone prologues and filter them out from epilogues.
-rw-r--r--ChangeLog36
-rw-r--r--FAQ35
-rw-r--r--csu/initfini.c12
-rw-r--r--elf/rtld.c12
-rw-r--r--stdio-common/vfprintf.c3
-rw-r--r--sysdeps/alpha/dl-machine.h344
-rw-r--r--sysdeps/generic/dl-sysdep.c3
-rw-r--r--sysdeps/mach/hurd/uname.c19
-rw-r--r--sysdeps/unix/sysv/linux/Makefile8
-rw-r--r--time/strftime.c2
10 files changed, 282 insertions, 192 deletions
diff --git a/ChangeLog b/ChangeLog
index 656db02..c2b5168 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+Tue Jul 16 00:31:31 1996 Richard Henderson <rth@tamu.edu>
+
+ * sysdeps/alpha/dl-machine.h: Mirror Roland's changes to
+ i386/dl-machine.h of 960713.
+
+ * sysdeps/generic/dl-sysdep.c: Include <sys/mman.h>.
+ (_dl_sysdep_read_whole_file): Fix result variable declaration.
+
+Tue Jul 16 00:53:57 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * sysdeps/mach/hurd/uname.c: Call __gethostname to fill in the
+ `nodename' member.
+
+Mon Jul 15 17:23:53 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * stdio-common/vfprintf.c (vfprintf): Call parse_one_spec
+ with pointer to local variable instead of NULL.
+
+1996-07-15 Paul Eggert <eggert@twinsun.com>
+
+ * time/strftime.c (strftime): Don't pass empty macro argument to `add'.
+
+Sat Jul 13 09:53:39 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove names
+ that are already added by other means.
+
+ * sysdeps/unix/sysv/linux/syscalls.list: Add more EXTRA's in the
+ caller column to get those syscalls added automagically.
+
Mon Jul 15 12:24:54 1996 Miles Bader <miles@gnu.ai.mit.edu>
* login/logout.c (logout): Initialize DATA to a state that will
@@ -5,6 +35,12 @@ Mon Jul 15 12:24:54 1996 Miles Bader <miles@gnu.ai.mit.edu>
Sun Jul 14 01:51:39 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+ * elf/rtld.c (dl_main) [ELF_MACHINE_DEBUG_SETUP]: Use this macro
+ instead of setting the DT_DEBUG pointer.
+
+ * csu/initfini.c (_init, _fini): Generate .end directives after
+ standalone prologues and filter them out from epilogues.
+
* Makeconfig (rtld-installed-name): Set to ld.so.1.
* sysdeps/unix/sysv/linux/Makefile (rtld-installed-name): Variable
removed.
diff --git a/FAQ b/FAQ
index 5cb8b72..84dd984 100644
--- a/FAQ
+++ b/FAQ
@@ -46,6 +46,9 @@ please let me know.
[Q12] ``The `gencat' utility cannot process the input which are
successfully used on my Linux libc based system. Why?''
+
+[Q13] ``How do I configure GNU libc so that the essential libraries
+ like libc.so go into /lib and the other into /usr/lib?''
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
[Q1] ``What systems does the GNU C Library run on?''
@@ -287,7 +290,6 @@ means to support the new techniques later.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
-
[Q11] ``Where are the DST_* constants found in <sys/time.h> on many
systems?''
@@ -300,7 +302,6 @@ code for POSIX TZ environment variable handling.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
-
[Q12] ``The `gencat' utility cannot process the input which are
successfully used on my Linux libc based system. Why?''
@@ -338,6 +339,36 @@ catalog files to the XPG4 form:
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+[Q13] ``How do I configure GNU libc so that the essential libraries
+ like libc.so go into /lib and the other into /usr/lib?''
+
+[A13] {UD} Like all other GNU packages GNU libc is configured to use a
+base directory and install all files relative to this. If you intend
+to really use GNU libc on your system this base directory is /usr. I.e.,
+you run
+ configure --prefix=/usr <other_options>
+
+Some systems like Linux have a filesystem standard which makes a
+difference between essential libraries and others. Essential
+libraries are placed in /lib because this directory is required to be
+located on the same disk partition as /. The /usr subtree might be
+found on another partition/disk.
+
+To install the essential libraries which come with GNU libc in /lib
+one must explicitly tell this. Autoconf has no option for this so you
+have to use the file where all user supplied additional information
+should go in: `configparms' (see the `INSTALL' file). For Linux the
+`configparms' file should contain:
+
+slibdir=/lib
+sysconfdir=/etc
+
+The first line specifies the directory for the essential libraries,
+the second line the directory for file which are by tradition placed
+in a directory named /etc.
+
+
+~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Answers were given by:
{UD} Ulrich Drepper, <drepper@cygnus.com>
diff --git a/csu/initfini.c b/csu/initfini.c
index 28e822b..e4a7117 100644
--- a/csu/initfini.c
+++ b/csu/initfini.c
@@ -77,10 +77,10 @@ _init (void)
/* End the here document containing the .init prologue code.
Then fetch the .section directive just written and append that
to crtn.s-new, followed by the function epilogue. */
- asm ("\nEOF.crti.init
-\n\
+ asm (".end _init\n\
+EOF.crti.init\n\
fgrep .init crti.s-new >>crtn.s-new\n\
- cat >> crtn.s-new <<\\EOF.crtn.init");
+ fgrep -v .end >> crtn.s-new <<\\EOF.crtn.init");
}
/* End the here document containing the .init epilogue code.
@@ -96,8 +96,8 @@ _fini (void)
/* End the here document containing the .fini prologue code.
Then fetch the .section directive just written and append that
to crtn.s-new, followed by the function epilogue. */
- asm ("\nEOF.crti.fini\
-\n\
+ asm (".end _fini\n\
+EOF.crti.fini\n\
cat > /dev/null <<\\EOF.fini.skip");
{
@@ -111,7 +111,7 @@ cat > /dev/null <<\\EOF.fini.skip");
asm ("\nEOF.fini.skip\
\n\
fgrep .fini crti.s-new >>crtn.s-new\n\
- cat >> crtn.s-new <<\\EOF.crtn.fini");
+ fgrep -v .end >> crtn.s-new <<\\EOF.crtn.fini");
}
/* End the here document containing the .fini epilogue code.
diff --git a/elf/rtld.c b/elf/rtld.c
index 6a4742b..66cfa60 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -414,6 +414,16 @@ of this helper program; chances are you did not intend to run this program.\n",
struct r_debug *r = _dl_debug_initialize (_dl_rtld_map.l_addr);
l = _dl_loaded;
+
+#ifdef ELF_MACHINE_DEBUG_SETUP
+
+ /* Some machines (e.g. MIPS) don't use DT_DEBUG in this way. */
+
+ ELF_MACHINE_DEBUG_SETUP (l, r);
+ ELF_MACHINE_DEBUG_SETUP (&_dl_rtld_map, r);
+
+#else
+
if (l->l_info[DT_DEBUG])
/* There is a DT_DEBUG entry in the dynamic section. Fill it in
with the run-time address of the r_debug structure */
@@ -424,6 +434,8 @@ of this helper program; chances are you did not intend to run this program.\n",
if (_dl_rtld_map.l_info[DT_DEBUG])
_dl_rtld_map.l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
+#endif
+
/* Notify the debugger that all objects are now mapped in. */
r->r_state = RT_ADD;
_dl_debug_state ();
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 3fa53a6..ebe6220 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1115,7 +1115,8 @@ do_positional:
}
/* Parse the format specifier. */
- nargs += parse_one_spec (f, nargs, &specs[nspecs], &max_ref_arg, NULL);
+ nargs += parse_one_spec (f, nargs, &specs[nspecs], &max_ref_arg,
+ &mbstate);
}
/* Determine the number of arguments the format string consumes. */
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h
index 8986ed7..b900b76 100644
--- a/sysdeps/alpha/dl-machine.h
+++ b/sysdeps/alpha/dl-machine.h
@@ -18,14 +18,16 @@ 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. */
-/* This was written in the absense of an ABI -- don't expect
+/* This was written in the absence of an ABI -- don't expect
it to remain unchanged. */
+#ifndef dl_machine_h
+#define dl_machine_h 1
+
#define ELF_MACHINE_NAME "alpha"
#include <assert.h>
#include <string.h>
-#include <link.h>
/* Return nonzero iff E_MACHINE is compatible with the running host. */
@@ -35,7 +37,6 @@ elf_machine_matches_host (Elf64_Word e_machine)
return e_machine == EM_ALPHA;
}
-
/* Return the run-time address of the _GLOBAL_OFFSET_TABLE_.
Must be inlined in a function which uses global data. */
static inline Elf64_Addr *
@@ -45,7 +46,6 @@ elf_machine_got (void)
return (Elf64_Addr *)(gp - 0x8000);
}
-
/* Return the run-time load address of the shared object. */
static inline Elf64_Addr
elf_machine_load_address (void)
@@ -78,6 +78,164 @@ elf_machine_load_address (void)
return dot + 4 + zero_disp;
}
+/* Set up the loaded object described by L so its unrelocated PLT
+ entries will jump to the on-demand fixup code in dl-runtime.c. */
+
+static inline void
+elf_machine_runtime_setup (struct link_map *l, int lazy)
+{
+ Elf64_Addr plt;
+ extern void _dl_runtime_resolve (void);
+
+ if (l->l_info[DT_JMPREL] && lazy)
+ {
+ /* The GOT entries for the functions in the PLT have not been
+ filled in yet. Their initial contents are directed to the
+ PLT which arranges for the dynamic linker to be called. */
+ plt = l->l_addr + l->l_info[DT_PLTGOT]->d_un.d_ptr;
+
+ /* This function will be called to perform the relocation. */
+ *(Elf64_Addr *)(plt + 16) = (Elf64_Addr) &_dl_runtime_resolve;
+
+ /* Identify this shared object */
+ *(Elf64_Addr *)(plt + 24) = (Elf64_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 */
+ .globl _dl_runtime_resolve
+ .ent _dl_runtime_resolve
+_dl_runtime_resolve:
+ lda $sp, -168($sp)
+ .frame $sp, 168, $26
+ /* Preserve all registers that C normally doesn't. */
+ stq $26, 0($sp)
+ stq $0, 8($sp)
+ stq $1, 16($sp)
+ stq $2, 24($sp)
+ stq $3, 32($sp)
+ stq $4, 40($sp)
+ stq $5, 48($sp)
+ stq $6, 56($sp)
+ stq $7, 64($sp)
+ stq $8, 72($sp)
+ stq $16, 80($sp)
+ stq $17, 88($sp)
+ stq $18, 96($sp)
+ stq $19, 104($sp)
+ stq $20, 112($sp)
+ stq $21, 120($sp)
+ stq $22, 128($sp)
+ stq $23, 136($sp)
+ stq $24, 144($sp)
+ stq $25, 152($sp)
+ stq $29, 160($sp)
+ .mask 0x27ff01ff, -168
+ /* Set up our $gp */
+ br $gp, .+4
+ ldgp $gp, 0($gp)
+ .prologue 1
+ /* Set up the arguments for _dl_runtime_resolve. */
+ /* $16 = link_map out of plt0 */
+ ldq $16, 8($27)
+ /* $17 = offset of reloc entry */
+ mov $28, $17
+ /* Do the fixup */
+ bsr $26, fixup..ng
+ /* Move the destination address to a safe place. */
+ mov $0, $27
+ /* Restore program registers. */
+ ldq $26, 0($sp)
+ ldq $0, 8($sp)
+ ldq $1, 16($sp)
+ ldq $2, 24($sp)
+ ldq $3, 32($sp)
+ ldq $4, 40($sp)
+ ldq $5, 48($sp)
+ ldq $6, 56($sp)
+ ldq $7, 64($sp)
+ ldq $8, 72($sp)
+ ldq $16, 80($sp)
+ ldq $17, 88($sp)
+ ldq $18, 96($sp)
+ ldq $19, 104($sp)
+ ldq $20, 112($sp)
+ ldq $21, 120($sp)
+ ldq $22, 128($sp)
+ ldq $23, 136($sp)
+ ldq $24, 144($sp)
+ ldq $25, 152($sp)
+ ldq $29, 160($sp)
+ /* Clean up and turn control to the destination */
+ lda $sp, 168($sp)
+ jmp $31, ($27)
+ .end _dl_runtime_resolve");
+
+/* The PLT uses Elf_Rel relocs. */
+#define elf_machine_relplt elf_machine_rela
+
+/* Mask identifying addresses reserved for the user program,
+ where the dynamic linker should not map anything. */
+/* FIXME */
+#define ELF_MACHINE_USER_ADDRESS_MASK (~0x1FFFFFFFFUL)
+
+/* Initial entry point code for the dynamic linker.
+ The C function `_dl_start' is the real entry point;
+ its return value is the user program's entry point. */
+
+#define RTLD_START asm ("\
+.text
+ .globl _start
+ .globl _dl_start_user
+_start:
+ br $gp,.+4
+ ldgp $gp, 0($gp)
+ /* Pass pointer to argument block to _dl_start. */
+ mov $sp, $16
+ bsr $26, _dl_start..ng
+_dl_start_user:
+ /* Save the user entry point address in s0. */
+ mov $0, $9
+ /* See if we were run as a command with the executable file
+ name as an extra leading argument. If so, adjust the stack
+ pointer to skip _dl_skip_args words. */
+ ldl $1, _dl_skip_args
+ beq $1, 0f
+ ldq $2, 0($sp)
+ subq $2, $1, $2
+ s8addq $1, $sp, $sp
+ stq $2, 0($sp)
+ /* Load _dl_default_scope[2] into s1 to pass to _dl_init_next. */
+0: ldq $10, _dl_default_scope+16
+ /* Call _dl_init_next to return the address of an initalizer
+ function to run. */
+1: mov $10, $16
+ jsr $26, _dl_init_next
+ ldgp $gp, 0($26)
+ beq $0, 2f
+ mov $0, $27
+ jsr $26, ($0)
+ ldgp $gp, 0($26)
+ br 1b
+2: /* Pass our finalizer function to the user in $0. */
+ lda $0, _dl_fini
+ /* Jump to the user's entry point. */
+ mov $9, $27
+ jmp ($9)");
+
+/* 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_ALPHA_JMP_SLOT)
+
+/* The alpha never uses Elf64_Rel relocations. */
+#define ELF_MACHINE_NO_REL 1
+
+#endif /* !dl_machine_h */
+
+#ifdef RESOLVE
/* Fix up the instructions of a PLT entry to invoke the function
rather than the dynamic linker. */
@@ -154,13 +312,11 @@ elf_alpha_fix_plt(struct link_map *l,
static inline void
elf_machine_rela (struct link_map *map,
const Elf64_Rela *reloc,
- const Elf64_Sym *sym,
- Elf64_Addr (*resolve) (const Elf64_Sym **ref,
- Elf64_Addr reloc_addr,
- int noplt))
+ const Elf64_Sym *sym)
{
- Elf64_Addr *const reloc_addr = (void *)(map->l_addr + reloc->r_offset);
- unsigned long r_info = ELF64_R_TYPE (reloc->r_info);
+ Elf64_Addr * const reloc_addr = (void *)(map->l_addr + reloc->r_offset);
+ unsigned long const r_info = ELF64_R_TYPE (reloc->r_info);
+
#ifndef RTLD_BOOTSTRAP
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
reference weak so static programs can still link. This declaration
@@ -175,8 +331,8 @@ elf_machine_rela (struct link_map *map,
if (r_info == R_ALPHA_RELATIVE)
{
- /* Already done in dynamic linker. */
#ifndef RTLD_BOOTSTRAP
+ /* Already done in dynamic linker. */
if (map != &_dl_rtld_map)
#endif
*reloc_addr += map->l_addr;
@@ -187,12 +343,8 @@ elf_machine_rela (struct link_map *map,
{
Elf64_Addr loadbase, sym_value;
-#ifndef RTLD_BOOTSTRAP
- loadbase = (*resolve)(&sym, (Elf64_Addr)reloc_addr,
- r_info == R_ALPHA_JMP_SLOT);
-#else
- loadbase = map->l_addr;
-#endif
+ loadbase = RESOLVE (&sym, (Elf64_Addr)reloc_addr,
+ r_info == R_ALPHA_JMP_SLOT);
sym_value = sym ? loadbase + sym->st_value : 0;
if (r_info == R_ALPHA_GLOB_DAT)
@@ -233,8 +385,8 @@ elf_machine_rela (struct link_map *map,
static inline void
elf_machine_lazy_rel (struct link_map *map, const Elf64_Rela *reloc)
{
- Elf64_Addr *const reloc_addr = (void *)(map->l_addr + reloc->r_offset);
- unsigned long r_info = ELF64_R_TYPE (reloc->r_info);
+ Elf64_Addr * const reloc_addr = (void *)(map->l_addr + reloc->r_offset);
+ unsigned long const r_info = ELF64_R_TYPE (reloc->r_info);
if (r_info == R_ALPHA_JMP_SLOT)
{
@@ -243,159 +395,9 @@ elf_machine_lazy_rel (struct link_map *map, const Elf64_Rela *reloc)
*reloc_addr += map->l_addr;
}
else if (r_info == R_ALPHA_NONE)
- ;
+ return;
else
assert (! "unexpected PLT reloc type");
}
-/* The alpha never uses Elf_Rel relocations. */
-#define ELF_MACHINE_NO_REL 1
-
-
-/* Set up the loaded object described by L so its unrelocated PLT
- entries will jump to the on-demand fixup code in dl-runtime.c. */
-
-static inline void
-elf_machine_runtime_setup (struct link_map *l, int lazy)
-{
- Elf64_Addr plt;
- extern void _dl_runtime_resolve (void);
-
- if (l->l_info[DT_JMPREL] && lazy)
- {
- /* The GOT entries for the functions in the PLT have not been
- filled in yet. Their initial contents are directed to the
- PLT which arranges for the dynamic linker to be called. */
- plt = l->l_addr + l->l_info[DT_PLTGOT]->d_un.d_ptr;
-
- /* This function will be called to perform the relocation. */
- *(Elf64_Addr *)(plt + 16) = (Elf64_Addr) &_dl_runtime_resolve;
-
- /* Identify this shared object */
- *(Elf64_Addr *)(plt + 24) = (Elf64_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 */
- .globl _dl_runtime_resolve
- .ent _dl_runtime_resolve
-_dl_runtime_resolve:
- lda $sp, -168($sp)
- .frame $sp, 168, $26
- /* Preserve all registers that C normally doesn't. */
- stq $26, 0($sp)
- stq $0, 8($sp)
- stq $1, 16($sp)
- stq $2, 24($sp)
- stq $3, 32($sp)
- stq $4, 40($sp)
- stq $5, 48($sp)
- stq $6, 56($sp)
- stq $7, 64($sp)
- stq $8, 72($sp)
- stq $16, 80($sp)
- stq $17, 88($sp)
- stq $18, 96($sp)
- stq $19, 104($sp)
- stq $20, 112($sp)
- stq $21, 120($sp)
- stq $22, 128($sp)
- stq $23, 136($sp)
- stq $24, 144($sp)
- stq $25, 152($sp)
- stq $29, 160($sp)
- .mask 0x27ff01ff, -168
- /* Set up our $gp */
- br $gp, .+4
- ldgp $gp, 0($gp)
- .prologue 1
- /* Set up the arguments for _dl_runtime_resolve. */
- /* $16 = link_map out of plt0 */
- ldq $16, 8($27)
- /* $17 = offset of reloc entry */
- mov $28, $17
- /* Do the fixup */
- bsr $26, fixup..ng
- /* Move the destination address to a safe place. */
- mov $0, $27
- /* Restore program registers. */
- ldq $26, 0($sp)
- ldq $0, 8($sp)
- ldq $1, 16($sp)
- ldq $2, 24($sp)
- ldq $3, 32($sp)
- ldq $4, 40($sp)
- ldq $5, 48($sp)
- ldq $6, 56($sp)
- ldq $7, 64($sp)
- ldq $8, 72($sp)
- ldq $16, 80($sp)
- ldq $17, 88($sp)
- ldq $18, 96($sp)
- ldq $19, 104($sp)
- ldq $20, 112($sp)
- ldq $21, 120($sp)
- ldq $22, 128($sp)
- ldq $23, 136($sp)
- ldq $24, 144($sp)
- ldq $25, 152($sp)
- ldq $29, 160($sp)
- /* Clean up and turn control to the destination */
- lda $sp, 168($sp)
- jmp $31, ($27)
- .end _dl_runtime_resolve");
-
-/* The PLT uses Elf_Rel relocs. */
-#define elf_machine_relplt elf_machine_rela
-
-/* Mask identifying addresses reserved for the user program,
- where the dynamic linker should not map anything. */
-/* FIXME */
-#define ELF_MACHINE_USER_ADDRESS_MASK (~0x1FFFFFFFFUL)
-
-/* Initial entry point code for the dynamic linker.
- The C function `_dl_start' is the real entry point;
- its return value is the user program's entry point. */
-
-#define RTLD_START asm ("\
-.text
- .globl _start
- .globl _dl_start_user
-_start:
- br $gp,.+4
- ldgp $gp, 0($gp)
- /* Pass pointer to argument block to _dl_start. */
- mov $sp, $16
- bsr $26, _dl_start..ng
-_dl_start_user:
- /* Save the user entry point address in s0. */
- mov $0, $9
- /* See if we were run as a command with the executable file
- name as an extra leading argument. If so, adjust the stack
- pointer to skip _dl_skip_args words. */
- ldl $1, _dl_skip_args
- beq $1, 0f
- ldq $2, 0($sp)
- subq $2, $1, $2
- s8addq $1, $sp, $sp
- stq $2, 0($sp)
- /* Load _dl_default_scope[2] into s1 to pass to _dl_init_next. */
-0: ldq $10, _dl_default_scope+16
- /* Call _dl_init_next to return the address of an initalizer
- function to run. */
-1: mov $10, $16
- jsr $26, _dl_init_next
- ldgp $gp, 0($26)
- beq $0, 2f
- mov $0, $27
- jsr $26, ($0)
- ldgp $gp, 0($26)
- br 1b
-2: /* Pass our finalizer function to the user in $0. */
- lda $0, _dl_fini
- /* Jump to the user's entry point. */
- mov $9, $27
- jmp ($9)");
+#endif /* RESOLVE */
diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c
index 579054d..87eac71 100644
--- a/sysdeps/generic/dl-sysdep.c
+++ b/sysdeps/generic/dl-sysdep.c
@@ -20,6 +20,7 @@ Cambridge, MA 02139, USA. */
#include <elf.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/mman.h>
#include <fcntl.h>
#include <link.h>
#include <unistd.h>
@@ -126,7 +127,7 @@ _dl_sysdep_open_zero_fill (void)
void *
_dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
{
- void *contents;
+ void *result;
struct stat st;
int fd = __open (file, O_RDONLY);
if (fd < 0)
diff --git a/sysdeps/mach/hurd/uname.c b/sysdeps/mach/hurd/uname.c
index 74d9d37..5fac305 100644
--- a/sysdeps/mach/hurd/uname.c
+++ b/sysdeps/mach/hurd/uname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1993, 1994, 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
@@ -25,7 +25,20 @@ uname (struct utsname *uname)
{
error_t err;
- err = __USEPORT (PROC, __proc_uname (port, uname));
+ if (err = __USEPORT (PROC, __proc_uname (port, uname)))
+ return __hurd_fail (err);
- return err ? __hurd_fail (err) : 0;
+ /* Fill in the hostname, which the proc server doesn't know. */
+ err = errno;
+ if (__gethostname (uname.nodename, sizeof uname.nodename) < 0)
+ {
+ if (errno == ENAMETOOLONG)
+ /* Ignore the error of the buffer being too small.
+ It is of fixed size, nothing to do about it. */
+ errno = err;
+ else
+ return -1;
+ }
+
+ return 0;
}
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index e8369a4..8c7f26d 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -1,10 +1,5 @@
-ifeq ($(subdir), io)
-sysdep_routines += fxstat lxstat xstat
-endif
-
ifeq ($(subdir), misc)
-sysdep_routines += mount umount xmknod s_ptrace s_sysctl sysctl llseek \
-setfsgid setfsuid sysinfo uselib s_reboot
+sysdep_routines += sysctl
sysdep_headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h \
sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \
@@ -27,7 +22,6 @@ generated += syscall-list.h syscall-list.d
endif
ifeq ($(subdir), time)
-sysdep_routines += adjtimex
sysdep_headers += sys/timex.h
endif
diff --git a/time/strftime.c b/time/strftime.c
index 69d7103..8893412 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -299,7 +299,7 @@ strftime (s, maxsize, format, tp)
size_t len = strftime (p, maxsize - i, subfmt, tp);
if (len == 0 && *subfmt)
return 0;
- add(len, );
+ add (len, ;);
}
break;