]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 20 May 1998 10:50:03 +0000 (10:50 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 20 May 1998 10:50:03 +0000 (10:50 +0000)
1998-05-20  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

* Makeconfig (rpath-link): Add resolvobjdir.
(resolvobjdir): New variable.
Reported by Peter Breitenlohner <peb@mppmu.mpg.de> [fixes PR libc/633].

1998-05-20 09:36  Ulrich Drepper  <drepper@cygnus.com>

* elf/dl-close.c: Call shared object terminators at the right time.
Patch by Philippe Troin <phil@fifi.org>.

1998-05-20  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* Make-dist (+tsrcs): Also add *.map for every member of
$(extra-libs).

* Makefile (distribute): Don't distribute scripts/printsources and
scripts/=__ify.  Distribute FAQ.in.
(rpm/%): Don't pass subdirs to sub-make.

* timezone/Makefile: Protect inclusion of z.* by $(avoid-generated)
instead of $(no_deps).

1998-05-19  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* sysdeps/generic/setenv.c: Protect against GNU C extension.
(KNOWN_VALUE, STORE_VALUE): Do it right.
(setenv): Remove unused variable.

1998-05-18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* timezone/Makefile (tz-cflags): Define TM_GMTOFF and TM_ZONE.
(CFLAGS-zdump.c): Add $(tz-cflags).

* timezone/zdump.c (abbr): Use TM_ZONE if defined.  Add const to
return type.

1998-05-18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* time/tzfile.c (__tzfile_compute): Undo last change.  Instead
take struct tm parameter and set tm_isdst, tm_zone and tm_offset
if use_localtime.
* time/tzset.c: Update prototype of __tzfile_compute.
(__tz_convert): Pass tp to __tzfile_compute.  Don't set tm_isdst,
tm_zone and tm_offset here if __use_tzfile.

1998-05-19  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* Makerules: Install libc.a even if there are no object file.

1998-05-18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* Makerules (do-makelib): Don't force creating library from
scratch, to avoid wasting time and space and to get correct
behaviour if $(subdirs) is incomplete.

1998-05-19  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* Makerules (do-stamp): Make it work when building in source
directory.

ChangeLog
Make-dist
Makeconfig
Makefile
Makerules
elf/dl-close.c
sysdeps/generic/setenv.c
time/tzfile.c
time/tzset.c
timezone/Makefile
timezone/zdump.c

index 4053a097bd10c2c1250a8fa535a6ebb094fdc7cb..7f3cd2781b15333b6e85ac0e0eff4b3ad5b0a0f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,64 @@
+1998-05-20  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+       * Makeconfig (rpath-link): Add resolvobjdir.
+       (resolvobjdir): New variable.
+       Reported by Peter Breitenlohner <peb@mppmu.mpg.de> [fixes PR libc/633].
+
+1998-05-20 09:36  Ulrich Drepper  <drepper@cygnus.com>
+
+       * elf/dl-close.c: Call shared object terminators at the right time.
+       Patch by Philippe Troin <phil@fifi.org>.
+
+1998-05-20  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * Make-dist (+tsrcs): Also add *.map for every member of
+       $(extra-libs).
+
+       * Makefile (distribute): Don't distribute scripts/printsources and
+       scripts/=__ify.  Distribute FAQ.in.
+       (rpm/%): Don't pass subdirs to sub-make.
+
+       * timezone/Makefile: Protect inclusion of z.* by $(avoid-generated)
+       instead of $(no_deps).
+
+1998-05-19  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * sysdeps/generic/setenv.c: Protect against GNU C extension.
+       (KNOWN_VALUE, STORE_VALUE): Do it right.
+       (setenv): Remove unused variable.
+
+1998-05-18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * timezone/Makefile (tz-cflags): Define TM_GMTOFF and TM_ZONE.
+       (CFLAGS-zdump.c): Add $(tz-cflags).
+
+       * timezone/zdump.c (abbr): Use TM_ZONE if defined.  Add const to
+       return type.
+
+1998-05-18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * time/tzfile.c (__tzfile_compute): Undo last change.  Instead
+       take struct tm parameter and set tm_isdst, tm_zone and tm_offset
+       if use_localtime.
+       * time/tzset.c: Update prototype of __tzfile_compute.
+       (__tz_convert): Pass tp to __tzfile_compute.  Don't set tm_isdst,
+       tm_zone and tm_offset here if __use_tzfile.
+
+1998-05-19  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * Makerules: Install libc.a even if there are no object file.
+
+1998-05-18  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * Makerules (do-makelib): Don't force creating library from
+       scratch, to avoid wasting time and space and to get correct
+       behaviour if $(subdirs) is incomplete.
+
+1998-05-19  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * Makerules (do-stamp): Make it work when building in source
+       directory.
+
 1998-05-20 00:10  Ulrich Drepper  <drepper@cygnus.com>
 
        * elf/dl-load.c: Rename option and variable from ignore-rpath to
index 13df78abcedef32b6fcb4b4b300932ec27cd6955..30b9749e91d63fa921b3d8415f5ac79a313ddd4e 100644 (file)
--- a/Make-dist
+++ b/Make-dist
@@ -122,7 +122,8 @@ sources := $(filter-out $(addsuffix .c,$(basename $(.S.s))),$(sources)) $(.S.s)
        $(+subdir-nodist) $(dont_distribute)
 foo:=$(shell echo '+out=$(+out)' >&2; echo foofoo >&2)
 +tsrcs := $(filter-out $(+out), $(sources) $(all-headers) $(distribute)) \
-          $(foreach l,$(extra-libs),$($l-map)) $(+sysdeps)
+          $(foreach l,$(extra-libs),$($l-map)) \
+          $(wildcard $(addsuffix .map,$(extra-libs))) $(+sysdeps)
 foo:=$(shell echo 'made +tsrcs=$(+tsrcs)'>&2)
 foo:=$(shell echo generated='$(generated)' >&2)
 #generated := $(sort $(generated) $(generated:.S=.c) $(generated:.s=.c))
index 8cdf8c6a763204f7f73d390c1b39d1482376f5eb..e81005e1906495b3f18330867ba2ee974e88a2a5 100644 (file)
@@ -413,13 +413,14 @@ else
 default-rpath = $(libdir)
 endif
 # This is how to find at build-time things that will be installed there.
-rpath-link = $(common-objdir):$(mathobjdir):$(elfobjdir):$(nssobjdir):$(nisobjdir):$(dbobjdir):$(rtobjdir)
+rpath-link = $(common-objdir):$(mathobjdir):$(elfobjdir):$(nssobjdir):$(nisobjdir):$(dbobjdir):$(rtobjdir):$(resolvobjdir)
 mathobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)math)
 elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
 nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
 nisobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nis)
 dbobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)db2)
 rtobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)rt)
+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
 else
 link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a
 endif
index dca5009b92b7a35045507b2602a617fef91e0119..44699ac158f57a23ece0ac45fd7ca8c88d5d7d2e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -234,8 +234,8 @@ parent_echo-distinfo:
 \f
 # Make the distribution tarfile.
 
-distribute  := README README.libm INSTALL FAQ NOTES NEWS PROJECTS      \
-               BUGS COPYING.LIB COPYING ChangeLog ChangeLog.[0-9]      \
+distribute  := README README.libm INSTALL FAQ FAQ.in NOTES NEWS BUGS   \
+               PROJECTS COPYING.LIB COPYING ChangeLog ChangeLog.[0-9]  \
                Makefile Makeconfig Makerules Rules Make-dist MakeTAGS  \
                extra-lib.mk o-iterator.mk libc.map configure           \
                configure.in aclocal.m4 config.h.in config.make.in      \
@@ -244,9 +244,9 @@ distribute  :=      README README.libm INSTALL FAQ NOTES NEWS PROJECTS      \
                rpm/template rpm/rpmrc glibcbug.in abi-tags stub-tag.h  \
                test-skeleton.c include/des.h                           \
                $(addprefix scripts/,                                   \
-                       rellns-sh config.sub config.guess printsources  \
-                       mkinstalldirs move-if-change install-sh =__ify  \
-                       test-installation.pl gen-FAQ.pl)
+                           rellns-sh config.sub config.guess           \
+                           mkinstalldirs move-if-change install-sh     \
+                           test-installation.pl gen-FAQ.pl)
 
 distribute := $(strip $(distribute))
 generated := $(generated) stubs.h
@@ -270,7 +270,7 @@ endif
 FORCE:
 
 rpm/%: subdir_distinfo
-       $(MAKE) $(PARALLELMFLAGS) -C $(@D) subdirs='$(subdirs)' $(@F)
+       $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
 
 iconvdata/%:
        $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
index dadafdbc881d79735e66b6087a681ac962b673b8..ece8f0610c9b2369ed01908f9ef40677ae7f9071 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -499,7 +499,7 @@ define o-iterator-doit
 $(objpfx)stamp$o: $(o-objects); $$(do-stamp)
 endef
 define do-stamp
-echo '$(patsubst $(common-objpfx)%,%,$^)' > $@T
+echo '$(patsubst $(objpfx)%,$(addsuffix /,$(subdir))%,$^)' > $@T
 mv -f $@T $@
 endef
 object-suffixes-left := $(object-suffixes-for-libc)
@@ -508,17 +508,15 @@ include $(o-iterator)
 endif
 
 # Now define explicit rules to build the library archives; these depend
-# on the stamp files built above.  The rule always destroys and recreates
-# the library from scratch; it's faster that way.
+# on the stamp files built above.
 define o-iterator-doit
 $(common-objpfx)$(patsubst %,$(libtype$o),c): \
                $(subdirs-stamp-o) $(common-objpfx)stamp$o; $$(do-makelib)
 endef
 define do-makelib
 cd $(common-objdir) && \
-$(AR) $(CREATE_ARFLAGS) $(@F)T `cat $(patsubst $(common-objpfx)%,%,$^)`
-$(RANLIB) $@T
-mv -f $@T $@
+$(AR) $(CREATE_ARFLAGS) $(@F) `cat $(patsubst $(common-objpfx)%,%,$^)`
+$(RANLIB) $@
 endef
 subdirs-stamps := $(foreach d,$(subdirs),$(common-objpfx)$d/stamp%)
 subdirs-stamp-o = $(subst %,$o,$(subdirs-stamps))
@@ -575,10 +573,8 @@ $(addprefix $(..)./scripts/mkinstalldirs ,\
            $(filter-out $(wildcard $(@D:%/=%)),$(@D:%/=%)))
 endef
 
-# Any directory (parent or subdir) that has any object files to build
-# should install libc.a; this way "make install" in a subdir is guaranteed
-# to install everything it changes.
-ifdef objects
+# Any directory (parent or subdir) should install libc.a; this way
+# "make install" in a subdir is guaranteed to install everything it changes.
 installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
                             $(inst_libdir)/$(patsubst %,$(libtype$o),\
                                                     $(libprefix)$(libc-name)))
@@ -589,7 +585,6 @@ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
 # Running ranlib after installing makes the __.SYMDEF time stamp up to
 # date, which avoids messages from some linkers.
        $(RANLIB) $@
-endif
 
 define do-install-program
 $(make-target-directory)
index 70b2e6057e85c098e2df53a973867319533922ec..49deb961b35ed4541acbb352afab13557dbdb518 100644 (file)
@@ -47,30 +47,39 @@ _dl_close (struct link_map *map)
   __libc_lock_lock (_dl_load_lock);
 
   /* Decrement the reference count.  */
-  if (--map->l_opencount > 0 || map->l_type != lt_loaded)
+  if (map->l_opencount > 1 || map->l_type != lt_loaded)
     {
       /* There are still references to this object.  Do nothing more.  */
+      --map->l_opencount;
       __libc_lock_unlock (_dl_load_lock);
       return;
     }
 
+  list = map->l_searchlist;
+
+  /* Call all termination functions at once.  */
+  for (i = 0; i < map->l_nsearchlist; ++i)
+    {
+      struct link_map *imap = list[i];
+      if (imap->l_opencount == 1 && imap->l_type == lt_loaded)
+       {
+         if (imap->l_info[DT_FINI])
+           /* Call its termination function.  */
+           (*(void (*) (void)) ((void *) imap->l_addr
+                                + imap->l_info[DT_FINI]->d_un.d_ptr)) ();
+       }
+    }
+
   /* Notify the debugger we are about to remove some loaded objects.  */
   _r_debug.r_state = RT_DELETE;
   _dl_debug_state ();
 
-  list = map->l_searchlist;
-
   /* The search list contains a counted reference to each object it
      points to, the 0th elt being MAP itself.  Decrement the reference
      counts on all the objects MAP depends on.  */
-  for (i = 1; i < map->l_nsearchlist; ++i)
+  for (i = 0; i < map->l_nsearchlist; ++i)
     --list[i]->l_opencount;
 
-  /* Clear the search list so it doesn't get freed while we are still
-     using it.  We have cached it in LIST and will free it when
-     finished.  */
-  map->l_searchlist = NULL;
-
   /* Check each element of the search list to see if all references to
      it are gone.  */
   for (i = 0; i < map->l_nsearchlist; ++i)
@@ -84,11 +93,6 @@ _dl_close (struct link_map *map)
          const ElfW(Phdr) *first, *last;
          ElfW(Addr) mapstart, mapend;
 
-         if (imap->l_info[DT_FINI])
-           /* Call its termination function.  */
-           (*(void (*) (void)) ((void *) imap->l_addr +
-                                imap->l_info[DT_FINI]->d_un.d_ptr)) ();
-
          if (imap->l_global)
            {
              /* This object is in the global scope list.  Remove it.  */
@@ -126,7 +130,7 @@ _dl_close (struct link_map *map)
            imap->l_prev->l_next = imap->l_next;
          if (imap->l_next)
            imap->l_next->l_prev = imap->l_prev;
-         if (imap->l_searchlist)
+         if (imap->l_searchlist && imap->l_searchlist != list)
            free (imap->l_searchlist);
          free (imap);
        }
index 22ea7e551fa73fe9c11aaa9b321ccd3dfce8ff93..b2ebbadfaa5ae4e706ef5275e9dc449614cc1325 100644 (file)
@@ -69,7 +69,8 @@ __libc_lock_define_initialized (static, envlock)
    allow arbitrary many changes of the environment given that the used
    values are from a small set.  Outside glibc this will eat up all
    memory after a while.  */
-#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH)
+#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \
+                     && defined __GNUC__)
 # define USE_TSEARCH   1
 # include <search.h>
 
@@ -79,18 +80,11 @@ static void *known_values;
 
 # define KNOWN_VALUE(Str) \
   ({                                                                         \
-    void **value = tfind (Str, &known_values, (__compar_fn_t) strcmp);       \
-    if (value != NULL)                                                       \
-      value = *(const char **) value;                                        \
-    value;                                                                   \
+    void *value = tfind (Str, &known_values, (__compar_fn_t) strcmp);        \
+    value != NULL ? *(char **) value : NULL;                                 \
   })
 # define STORE_VALUE(Str) \
-  ({                                                                         \
-    void **value = tsearch (Str, &known_values, (__compar_fn_t) strcmp);      \
-    if (value != NULL)                                                       \
-      value = *(const char **) value;                                        \
-    value;                                                                   \
-  })
+  tsearch (Str, &known_values, (__compar_fn_t) strcmp)
 
 #else
 # undef USE_TSEARCH
@@ -186,7 +180,6 @@ setenv (name, value, replace)
     }
   else if (replace)
     {
-      size_t len = strlen (*ep);
       char *new_value;
       char *np;
 
index 9fab857ecc71a56144fbd4fe55baa95325803ff6..1d51a695ff91d349d2daec5323aa292d842173e4 100644 (file)
@@ -415,13 +415,13 @@ find_transition (time_t timer)
 int
 __tzfile_compute (time_t timer, int use_localtime,
                  long int *leap_correct, int *leap_hit,
-                 int *isdst, long int *offset)
+                 struct tm *tp)
 {
-  struct ttinfo *info = find_transition (timer);
   register size_t i;
 
   if (use_localtime)
     {
+      struct ttinfo *info = find_transition (timer);
       __daylight = rule_stdoff != rule_dstoff;
       __timezone = -rule_stdoff;
       __tzname[1] = NULL;
@@ -432,11 +432,11 @@ __tzfile_compute (time_t timer, int use_localtime,
       if (__tzname[1] == NULL)
        /* There is no daylight saving time.  */
        __tzname[1] = __tzname[0];
+      tp->tm_isdst = info->isdst;
+      tp->tm_zone = &zone_names[info->idx];
+      tp->tm_gmtoff = info->offset;
     }
 
-  *isdst = info->isdst;
-  *offset = info->offset;
-
   *leap_correct = 0L;
   *leap_hit = 0;
 
index 251967e5c6d4f41215608d01b49ba27a72b7d52f..4b8fa410214a5df5b3808acbcc74c50ad56de370 100644 (file)
@@ -38,7 +38,7 @@ extern int __use_tzfile;
 extern void __tzfile_read __P ((const char *file));
 extern int __tzfile_compute __P ((time_t timer, int use_localtime,
                                  long int *leap_correct, int *leap_hit,
-                                 int *isdst, long int *offset));
+                                 struct tm *tp));
 extern void __tzfile_default __P ((const char *std, const char *dst,
                                   long int stdoff, long int dstoff));
 extern char *__tzstring __P ((const char *string));
@@ -595,8 +595,6 @@ __tz_convert (const time_t *timer, int use_localtime, struct tm *tp)
 {
   long int leap_correction;
   int leap_extra_secs;
-  int isdst;
-  long int offset;
 
   if (timer == NULL)
     {
@@ -615,8 +613,7 @@ __tz_convert (const time_t *timer, int use_localtime, struct tm *tp)
   if (__use_tzfile)
     {
       if (! __tzfile_compute (*timer, use_localtime,
-                             &leap_correction, &leap_extra_secs,
-                             &isdst, &offset))
+                             &leap_correction, &leap_extra_secs, tp))
        tp = NULL;
     }
   else
@@ -625,18 +622,20 @@ __tz_convert (const time_t *timer, int use_localtime, struct tm *tp)
        tp = NULL;
       leap_correction = 0L;
       leap_extra_secs = 0;
-
-      isdst = (*timer >= tz_rules[0].change && *timer < tz_rules[1].change);
-      offset = tz_rules[isdst].offset;
     }
 
   if (tp)
     {
       if (use_localtime)
        {
-         tp->tm_isdst = isdst;
-         tp->tm_zone = __tzname[isdst];
-         tp->tm_gmtoff = offset;
+         if (!__use_tzfile)
+           {
+             int isdst = (*timer >= tz_rules[0].change
+                          && *timer < tz_rules[1].change);
+             tp->tm_isdst = isdst;
+             tp->tm_zone = __tzname[isdst];
+             tp->tm_gmtoff = tz_rules[isdst].offset;
+           }
        }
       else
        {
index 3f3f944e8bb216e4e070b32db2fb534a36ca971e..410d3834db121a6636d95cd39857f880fe3d6234 100644 (file)
@@ -53,7 +53,7 @@ define nl
 
 
 endef
-ifneq ($(no_deps),t)
+ifndef avoid-generated
 -include $(addprefix $(objpfx)z.,$(tzfiles))
 endif
 
@@ -158,9 +158,10 @@ $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
 
 tz-cflags = -DTZDIR='"$(zonedir)"' \
            -DTZDEFAULT='"$(localtime-file)"' \
-           -DTZDEFRULES='"$(posixrules-file)"'
+           -DTZDEFRULES='"$(posixrules-file)"' \
+           -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
 
-CFLAGS-zdump.c = -Wno-strict-prototypes -DNOID
+CFLAGS-zdump.c = -Wno-strict-prototypes -DNOID $(tz-cflags)
 CFLAGS-zic.c = -Wno-strict-prototypes -DNOID $(tz-cflags)
 CFLAGS-ialloc.c = -Wno-strict-prototypes -DNOID
 CFLAGS-scheck.c = -Wno-strict-prototypes -DNOID
index f6480bb308f820ea8fdfb26dad8f6aaacfc5ccc3..8c4f6ad1dfad01644a446ffcfbf0107f77ad19b5 100644 (file)
@@ -127,7 +127,7 @@ extern char *       optarg;
 extern int     optind;
 extern char *  tzname[2];
 
-static char *  abbr P((struct tm * tmp));
+static const char *abbr P((struct tm * tmp));
 static long    delta P((struct tm * newp, struct tm * oldp));
 static time_t  hunt P((char * name, time_t lot, time_t hit));
 static size_t  longest;
@@ -358,15 +358,19 @@ int       v;
        (void) printf("\n");
 }
 
-static char *
+static const char *
 abbr(tmp)
 struct tm *    tmp;
 {
-       register char * result;
-       static char     nada;
+       register const char *result;
+       static const char nada;
 
+#ifdef TM_ZONE
+       result = tmp->TM_ZONE;
+#else /* !defined TM_ZONE */
        if (tmp->tm_isdst != 0 && tmp->tm_isdst != 1)
                return &nada;
        result = tzname[tmp->tm_isdst];
+#endif /* !defined TM_ZONE */
        return (result == NULL) ? &nada : result;
 }