about summary refs log tree commit diff
path: root/include/link.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-12-15 12:32:27 -0800
committerUlrich Drepper <drepper@redhat.com>2009-12-15 12:32:27 -0800
commit2af6396817fb9df98e63de75dd59fd999ee9f1d0 (patch)
treed66827c66d770f1f3d697dbb027b59064e6ab0e0 /include/link.h
parent2510d01ddba195f8cfaa3c2349f75e0612719d82 (diff)
downloadglibc-2af6396817fb9df98e63de75dd59fd999ee9f1d0.tar.gz
glibc-2af6396817fb9df98e63de75dd59fd999ee9f1d0.tar.xz
glibc-2af6396817fb9df98e63de75dd59fd999ee9f1d0.zip
Avoid ELF lookup race.
On some architectures the update of the l_used field in the lookup
functions races with setting the other bits in the bitfield.  Simply
avoid this and optimize use of l_used in general.
Diffstat (limited to 'include/link.h')
-rw-r--r--include/link.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/link.h b/include/link.h
index 4b9978ad61..26c67438f0 100644
--- a/include/link.h
+++ b/include/link.h
@@ -1,6 +1,6 @@
 /* Data structure for communication from the run-time dynamic linker for
    loaded ELF shared objects.
-   Copyright (C) 1995-2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-2006, 2007, 2009 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
@@ -180,7 +180,6 @@ struct link_map
     unsigned int l_need_tls_init:1; /* Nonzero if GL(dl_init_static_tls)
 				       should be called on this link map
 				       when relocation finishes.  */
-    unsigned int l_used:1;	/* Nonzero if the DSO is used.  */
     unsigned int l_auditing:1;	/* Nonzero if the DSO is used in auditing.  */
     unsigned int l_audit_any_plt:1; /* Nonzero if at least one audit module
 				       is interested in the PLT interception.*/
@@ -239,12 +238,15 @@ struct link_map
     struct link_map **l_initfini;
 
     /* List of the dependencies introduced through symbol binding.  */
-    unsigned int l_reldepsmax;
     struct link_map_reldeps
       {
 	unsigned int act;
 	struct link_map *list[];
       } *l_reldeps;
+    unsigned int l_reldepsmax;
+
+    /* Nonzero if the DSO is used.  */
+    unsigned int l_used;
 
     /* Various flag words.  */
     ElfW(Word) l_feature_1;