View | Details | Raw Unified | Return to bug 12871 | Differences between
and this patch

Collapse All | Expand All

(-)a/elf/dl-close.c (-11 / +2 lines)
Lines 119-135 _dl_close_worker (struct link_map *map) Link Here
119
  if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
119
  if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
120
      || dl_close_state != not_pending)
120
      || dl_close_state != not_pending)
121
    {
121
    {
122
      if (map->l_direct_opencount == 0)
122
      if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
123
	{
123
	dl_close_state = rerun;
124
	  if (map->l_type == lt_loaded)
125
	    dl_close_state = rerun;
126
	  else if (map->l_type == lt_library)
127
	    {
128
	      struct link_map **oldp = map->l_initfini;
129
	      map->l_initfini = map->l_orig_initfini;
130
	      _dl_scope_free (oldp);
131
	    }
132
	}
133
124
134
      /* There are still references to this object.  Do nothing more.  */
125
      /* There are still references to this object.  Do nothing more.  */
135
      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
126
      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
(-)a/elf/dl-deps.c (-1 / +3 lines)
Lines 478-483 _dl_map_object_deps (struct link_map *map, Link Here
478
		  nneeded * sizeof needed[0]);
478
		  nneeded * sizeof needed[0]);
479
	  atomic_write_barrier ();
479
	  atomic_write_barrier ();
480
	  l->l_initfini = l_initfini;
480
	  l->l_initfini = l_initfini;
481
	  l->l_free_initfini = 1;
481
	}
482
	}
482
483
483
      /* If we have no auxiliary objects just go on to the next map.  */
484
      /* If we have no auxiliary objects just go on to the next map.  */
Lines 678-683 Filters not supported with LD_TRACE_PRELINKING")); Link Here
678
  l_initfini[nlist] = NULL;
679
  l_initfini[nlist] = NULL;
679
  atomic_write_barrier ();
680
  atomic_write_barrier ();
680
  map->l_initfini = l_initfini;
681
  map->l_initfini = l_initfini;
682
  map->l_free_initfini = 1;
681
  if (l_reldeps != NULL)
683
  if (l_reldeps != NULL)
682
    {
684
    {
683
      atomic_write_barrier ();
685
      atomic_write_barrier ();
Lines 686-692 Filters not supported with LD_TRACE_PRELINKING")); Link Here
686
      _dl_scope_free (old_l_reldeps);
688
      _dl_scope_free (old_l_reldeps);
687
    }
689
    }
688
  if (old_l_initfini != NULL)
690
  if (old_l_initfini != NULL)
689
      map->l_orig_initfini = old_l_initfini;
691
	  _dl_scope_free (old_l_initfini);
690
692
691
  if (errno_reason)
693
  if (errno_reason)
692
    _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
694
    _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
(-)a/elf/dl-libc.c (+4 lines)
Lines 284-289 libc_freeres_fn (free_mem) Link Here
284
	      if (! old->dont_free)
284
	      if (! old->dont_free)
285
		free (old);
285
		free (old);
286
	    }
286
	    }
287
288
	  /* Free the initfini dependency list.  */
289
	  if (l->l_free_initfini)
290
	    free (l->l_initfini);
287
	}
291
	}
288
292
289
      if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
293
      if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
(-)a/elf/rtld.c (+1 lines)
Lines 2276-2281 ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", Link Here
2276
	      lnp->dont_free = 1;
2276
	      lnp->dont_free = 1;
2277
	      lnp = lnp->next;
2277
	      lnp = lnp->next;
2278
	    }
2278
	    }
2279
	  l->l_free_initfini = 0;
2279
2280
2280
	  if (l != &GL(dl_rtld_map))
2281
	  if (l != &GL(dl_rtld_map))
2281
	    _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
2282
	    _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
(-)a/include/link.h (-3 / +3 lines)
Lines 192-197 struct link_map Link Here
192
						 during LD_TRACE_PRELINKING=1
192
						 during LD_TRACE_PRELINKING=1
193
						 contains any DT_SYMBOLIC
193
						 contains any DT_SYMBOLIC
194
						 libraries.  */
194
						 libraries.  */
195
    unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
196
				       freed, ie. not allocated with
197
				       the dummy malloc in ld.so.  */
195
198
196
    /* Collected information about own RPATH directories.  */
199
    /* Collected information about own RPATH directories.  */
197
    struct r_search_path_struct l_rpath_dirs;
200
    struct r_search_path_struct l_rpath_dirs;
Lines 240-248 struct link_map Link Here
240
243
241
    /* List of object in order of the init and fini calls.  */
244
    /* List of object in order of the init and fini calls.  */
242
    struct link_map **l_initfini;
245
    struct link_map **l_initfini;
243
    /* The init and fini list generated at startup, saved when the
244
       object is also loaded dynamically.  */
245
    struct link_map **l_orig_initfini;
246
246
247
    /* List of the dependencies introduced through symbol binding.  */
247
    /* List of the dependencies introduced through symbol binding.  */
248
    struct link_map_reldeps
248
    struct link_map_reldeps

Return to bug 12871