Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 11 May 1999 13:00:20 +0000 (13:00 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 11 May 1999 13:00:20 +0000 (13:00 +0000)
1999-05-11  Ulrich Drepper  <drepper@cygnus.com>

* elf/Versions (ld.so) [GLIBC_2.1.1]: Add _dl_lazy.
* elf/dl-open.c (_dl_open_worker): Only relocate newly loaded objects
lazily if LD_BIND_NOW is not set.
* elf/dl-support.c (_dl_lazy): New variable.
(non_dynamic_init): Set _dl_lazy according to LD_BIND_NOW envvar.
* elf/rtld.c (_dl_lazy): new global variable.
( dl_main): Remove lazy, replace it by _dl_lazy.

1999-05-06  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

* locale/setlocale.c (new_composite_name): Check also whether the
first category name differs.

1999-05-11  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

* sysdeps/unix/sysv/linux/ftime.c: Use the bsd implementation, not
the generic one.

1999-05-11  Philip Blundell  <pb@nexus.co.uk>

* sysdeps/generic/bits/socket.h (struct sockaddr_storage): New
structure; storage suitable for any socket address.
* sysdeps/unix/sysv/linux/bits/socket.h (struct sockaddr_storage):
Likewise.
* sysdeps/unix/sysv/linux/mips/bits/socket.h (struct
sockaddr_storage): Likewise.

* inet/netinet/in.h: Use ULONG_MAX not ~0 to test for a 64-bit
platform.

12 files changed:
ChangeLog
bits/socket.h
elf/Versions
elf/dl-open.c
elf/dl-support.c
elf/rtld.c
inet/netinet/in.h
locale/setlocale.c
sysdeps/generic/bits/socket.h
sysdeps/unix/sysv/linux/bits/socket.h
sysdeps/unix/sysv/linux/ftime.c
sysdeps/unix/sysv/linux/mips/bits/socket.h

index 62aa209..976cadc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+1999-05-11  Ulrich Drepper  <drepper@cygnus.com>
+
+       * elf/Versions (ld.so) [GLIBC_2.1.1]: Add _dl_lazy.
+       * elf/dl-open.c (_dl_open_worker): Only relocate newly loaded objects
+       lazily if LD_BIND_NOW is not set.
+       * elf/dl-support.c (_dl_lazy): New variable.
+       (non_dynamic_init): Set _dl_lazy according to LD_BIND_NOW envvar.
+       * elf/rtld.c (_dl_lazy): new global variable.
+       ( dl_main): Remove lazy, replace it by _dl_lazy.
+
+1999-05-06  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+       * locale/setlocale.c (new_composite_name): Check also whether the
+       first category name differs.
+
+1999-05-11  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+       * sysdeps/unix/sysv/linux/ftime.c: Use the bsd implementation, not
+       the generic one.
+
+1999-05-11  Philip Blundell  <pb@nexus.co.uk>
+
+       * sysdeps/generic/bits/socket.h (struct sockaddr_storage): New
+       structure; storage suitable for any socket address.
+       * sysdeps/unix/sysv/linux/bits/socket.h (struct sockaddr_storage):
+       Likewise.
+       * sysdeps/unix/sysv/linux/mips/bits/socket.h (struct
+       sockaddr_storage): Likewise.
+
+       * inet/netinet/in.h: Use ULONG_MAX not ~0 to test for a 64-bit
+       platform.
+
 1999-05-10  Ulrich Drepper  <drepper@cygnus.com>
 
        * hesiod/Versions: Change _nss_hesiod_getpwuid and
index 480d5b5..5eb2949 100644 (file)
@@ -1,5 +1,5 @@
 /* System-specific socket constants and types.  Generic/4.3 BSD version.
-   Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+   Copyright (C) 1991,92,94,95,96,97,98,99 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,6 +24,9 @@
 # error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <limits.h>
+#include <bits/types.h>
+
 #define        __need_size_t
 #include <stddef.h>
 
@@ -127,6 +130,24 @@ struct sockaddr
   };
 
 
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_align    __uint64_t
+#else
+# define __ss_align    __uint32_t
+#endif
+#define _SS_SIZE       128
+#define _SS_PADSIZE    (_SS_SIZE - (2 * sizeof (__ss_align)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (__ss_); /* Address family, etc.  */
+    __ss_align __ss_align;     /* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
 /* Bits in the FLAGS argument to `send', `recv', et al.  */
 enum
   {
index e26e096..8f1981e 100644 (file)
@@ -39,7 +39,7 @@ ld.so {
   }
   GLIBC_2.1.1 {
     # global variables
-    _dl_origin_path; _dl_platformlen;
+    _dl_lazy; _dl_origin_path; _dl_platformlen;
 
     # functions used in other libraries
     _dl_dst_count; _dl_dst_substitute;
index 9a3c093..b6c79b4 100644 (file)
@@ -46,6 +46,8 @@ extern char **__libc_argv;
 
 extern char **__environ;
 
+extern int _dl_lazy;                   /* Do we do lazy relocations?  */
+
 /* Undefine the following for debugging.  */
 /* #define SCOPE_DEBUG 1 */
 #ifdef SCOPE_DEBUG
@@ -85,6 +87,7 @@ dl_open_worker (void *a)
   struct r_debug *r;
   unsigned int global_add;
   const char *dst;
+  int lazy;
 
   /* Maybe we have to expand a DST.  */
   dst = strchr (file, '$');
@@ -145,6 +148,9 @@ dl_open_worker (void *a)
   show_scope (new);
 #endif
 
+  /* Only do lazy relocation if `LD_BIND_NOW' is not set.  */
+  lazy = (mode & RTLD_BINDING_MASK) == RTLD_LAZY && _dl_lazy;
+
   /* Relocate the objects loaded.  We do this in reverse order so that copy
      relocs of earlier objects overwrite the data written by later objects.  */
 
@@ -173,8 +179,7 @@ dl_open_worker (void *a)
            }
          else
 #endif
-           _dl_relocate_object (l, l->l_scope,
-                                (mode & RTLD_BINDING_MASK) == RTLD_LAZY, 0);
+           _dl_relocate_object (l, l->l_scope, lazy, 0);
        }
 
       if (l == new)
index 450c9c9..b3ff0c6 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for dynamic linking code in static libc.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 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
@@ -40,6 +40,7 @@ int _dl_debug_symbols;
 int _dl_debug_versions;
 int _dl_debug_reloc;
 int _dl_debug_files;
+int _dl_lazy;
 
 /* If nonzero print warnings about problematic situations.  */
 int _dl_verbose;
@@ -90,6 +91,8 @@ non_dynamic_init (void)
      objects.  */
   _dl_init_paths (getenv ("LD_LIBRARY_PATH"));
 
+  _dl_lazy = *(getenv ("LD_BIND_NOW") ?: "") == '\0';
+
 #ifdef DL_PLATFORM_INIT
   DL_PLATFORM_INIT;
 #endif
index acbe3cd..064cd20 100644 (file)
@@ -82,6 +82,7 @@ struct r_search_path *_dl_search_paths;
 const char *_dl_profile;
 const char *_dl_profile_output;
 struct link_map *_dl_profile_map;
+int _dl_lazy;
 int _dl_debug_libs;
 int _dl_debug_impcalls;
 int _dl_debug_bindings;
@@ -332,7 +333,6 @@ dl_main (const ElfW(Phdr) *phdr,
         ElfW(Addr) *user_entry)
 {
   const ElfW(Phdr) *ph;
-  int lazy;
   enum mode mode;
   struct link_map **preloads;
   unsigned int npreloads;
@@ -346,7 +346,7 @@ dl_main (const ElfW(Phdr) *phdr,
   hp_timing_t diff;
 
   /* Process the environment variable which control the behaviour.  */
-  process_envvars (&mode, &lazy);
+  process_envvars (&mode, &_dl_lazy);
 
   /* Set up a flag which tells we are just starting.  */
   _dl_starting_up = 1;
@@ -377,7 +377,7 @@ dl_main (const ElfW(Phdr) *phdr,
        if (! strcmp (_dl_argv[1], "--list"))
          {
            mode = list;
-           lazy = -1;  /* This means do no dependency analysis.  */
+           _dl_lazy = -1;      /* This means do no dependency analysis.  */
 
            ++_dl_skip_args;
            --_dl_argc;
@@ -853,13 +853,13 @@ of this helper program; chances are you did not intend to run this program.\n\
          }
       else
        {
-         if (lazy >= 0)
+         if (_dl_lazy >= 0)
            {
              /* We have to do symbol dependency testing.  */
              struct relocate_args args;
              struct link_map *l;
 
-             args.lazy = lazy;
+             args.lazy = _dl_lazy;
 
              l = _dl_loaded;
              while (l->l_next)
@@ -974,7 +974,7 @@ of this helper program; chances are you did not intend to run this program.\n\
     hp_timing_t add;
 
     /* If we are profiling we also must do lazy reloaction.  */
-    lazy |= consider_profiling;
+    _dl_lazy |= consider_profiling;
 
     l = _dl_loaded;
     while (l->l_next)
@@ -984,7 +984,7 @@ of this helper program; chances are you did not intend to run this program.\n\
     do
       {
        if (l != &_dl_rtld_map)
-         _dl_relocate_object (l, l->l_scope, lazy, consider_profiling);
+         _dl_relocate_object (l, l->l_scope, _dl_lazy, consider_profiling);
 
        l = l->l_prev;
       }
index eaecbfc..ee49fd0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99 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
@@ -20,6 +20,7 @@
 #define        _NETINET_IN_H   1
 
 #include <features.h>
+#include <limits.h>
 #include <stdint.h>
 
 #include <sys/types.h>
@@ -164,7 +165,7 @@ struct in6_addr
        uint8_t         u6_addr8[16];
        uint16_t        u6_addr16[8];
        uint32_t        u6_addr32[4];
-#if (~0UL) > 0xffffffff
+#if ULONG_MAX > 0xffffffff
        uint64_t        u6_addr64[2];
 #endif
       } in6_u;
index 5f152e3..1482465 100644 (file)
@@ -149,7 +149,7 @@ new_composite_name (int category, const char *newnames[LC_ALL])
                          _nl_current_names[i]);
       last_len = strlen (name);
       cumlen += _nl_category_name_sizes[i] + 1 + last_len + 1;
-      if (i > 0 && same && strcmp (name, newnames[0]) != 0)
+      if (same && strcmp (name, newnames[0]) != 0)
        same = 0;
     }
 
index 480d5b5..5eb2949 100644 (file)
@@ -1,5 +1,5 @@
 /* System-specific socket constants and types.  Generic/4.3 BSD version.
-   Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+   Copyright (C) 1991,92,94,95,96,97,98,99 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,6 +24,9 @@
 # error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
 #endif
 
+#include <limits.h>
+#include <bits/types.h>
+
 #define        __need_size_t
 #include <stddef.h>
 
@@ -127,6 +130,24 @@ struct sockaddr
   };
 
 
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_align    __uint64_t
+#else
+# define __ss_align    __uint32_t
+#endif
+#define _SS_SIZE       128
+#define _SS_PADSIZE    (_SS_SIZE - (2 * sizeof (__ss_align)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (__ss_); /* Address family, etc.  */
+    __ss_align __ss_align;     /* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
 /* Bits in the FLAGS argument to `send', `recv', et al.  */
 enum
   {
index 9733903..37a9d93 100644 (file)
@@ -28,6 +28,7 @@
 #define __need_NULL
 #include <stddef.h>
 
+#include <limits.h>
 #include <sys/types.h>
 
 /* Type for length arguments in socket calls.  */
@@ -139,6 +140,24 @@ struct sockaddr
   };
 
 
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype        __uint64_t
+#else
+# define __ss_aligntype        __uint32_t
+#endif
+#define _SS_SIZE       128
+#define _SS_PADSIZE    (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (__ss_); /* Address family, etc.  */
+    __ss_aligntype __ss_align; /* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
 /* Bits in the FLAGS argument to `send', `recv', et al.  */
 enum
   {
index e8b5e6e..5a5949f 100644 (file)
@@ -1,3 +1,3 @@
 /* Linux defines the ftime system call but doesn't actually implement
-   it.  Use the generic implementation.  */
-#include <sysdeps/generic/ftime.c>
+   it.  Use the BSD implementation.  */
+#include <sysdeps/unix/bsd/ftime.c>
index cd85df7..5dbdee4 100644 (file)
@@ -1,5 +1,5 @@
 /* System-specific socket constants and types.  Linux/MIPS version.
-   Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+   Copyright (C) 1991,92,94,95,96,97,98,99 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
@@ -28,6 +28,7 @@
 #define __need_NULL
 #include <stddef.h>
 
+#include <limits.h>
 #include <sys/types.h>
 
 /* Type for length arguments in socket calls.  */
@@ -133,6 +134,24 @@ struct sockaddr
   };
 
 
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_align    __uint64_t
+#else
+# define __ss_align    __uint32_t
+#endif
+#define _SS_SIZE       128
+#define _SS_PADSIZE    (_SS_SIZE - (2 * sizeof(__ss_align)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (__ss_); /* Address family, etc.  */
+    __ss_align __ss_align;     /* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
 /* Bits in the FLAGS argument to `send', `recv', et al.  */
 enum
   {