This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Support DF_1_GLOBAL


Hi,

This simple change adds DF_1_GLOBAL support. Do we want to support
this feature?  If yes, I will submit a linker patch to implement
-z global and add a testcase for glibc.


H.J.
----
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 9c39a34..2e3e7ec 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -240,6 +240,11 @@ dl_open_worker (void *a)
     /* This happens only if we load a DSO for 'sprof'.  */
     return;
 
+  /* Make the symbols defined in the object available for symbol resolution
+     of subsequently loaded objects if it is marked with DF_1_GLOBAL.  */
+  if (__builtin_expect (new->l_flags_1 & DF_1_GLOBAL, 0))
+    mode |= RTLD_GLOBAL;
+
   /* This object is directly loaded.  */
   ++new->l_direct_opencount;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]