about summary refs log tree commit diff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-11-21 07:44:16 -0800
committerH.J. Lu <hjl.tools@gmail.com>2012-11-21 12:36:20 -0800
commit163abe1837d2ff89be00b8a675e45d478f509df6 (patch)
tree86adc818d4c004ec8cebccd8c103b2daf2111a03
parent78e479f3fb0be02cabfd0512132ea61daa4f2a6d (diff)
downloadglibc-163abe1837d2ff89be00b8a675e45d478f509df6.tar.gz
glibc-163abe1837d2ff89be00b8a675e45d478f509df6.tar.xz
glibc-163abe1837d2ff89be00b8a675e45d478f509df6.zip
Mark reldepmod7.so with DF_1_GLOBAL
-rw-r--r--elf/Makefile6
-rw-r--r--elf/reldep10.c10
-rw-r--r--elf/reldepmod7.c10
3 files changed, 18 insertions, 8 deletions
diff --git a/elf/Makefile b/elf/Makefile
index aa744e426e..a70b836d57 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -214,7 +214,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		tst-initorder2a tst-initorder2b tst-initorder2c \
 		tst-initorder2d \
 		tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
-		tst-array5dep
+		tst-array5dep reldepmod7
 ifeq (yesyes,$(have-fpie)$(build-shared))
 modules-names += tst-piemod1
 tests += tst-pie1
@@ -745,9 +745,9 @@ $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so
 $(objpfx)reldep9: $(libdl)
 $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so
 
-LDFLAGS-reldep10 = -Wl,-z,global
+LDFLAGS-reldepmod7.so = -Wl,-z,global
 $(objpfx)reldep10: $(libdl)
-$(objpfx)reldep10.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so
+$(objpfx)reldep10.out: $(objpfx)reldepmod7.so $(objpfx)reldepmod3.so
 
 $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so
 
diff --git a/elf/reldep10.c b/elf/reldep10.c
index 45ebcf9263..c6dba73a75 100644
--- a/elf/reldep10.c
+++ b/elf/reldep10.c
@@ -13,11 +13,11 @@ main (void)
 
   mtrace ();
 
-  /* Open the two objects.  */
-  h1 = dlopen ("reldepmod1.so", RTLD_LAZY);
+  /* Open the two objects.  reldepmod7.so is marked with DF_1_GLOBAL.  */
+  h1 = dlopen ("reldepmod7.so", RTLD_LAZY);
   if (h1 == NULL)
     {
-      printf ("cannot open reldepmod1.so: %s\n", dlerror ());
+      printf ("cannot open reldepmod7.so: %s\n", dlerror ());
       exit (1);
     }
   h2 = dlopen ("reldepmod3.so", RTLD_LAZY);
@@ -62,10 +62,10 @@ main (void)
     }
 
   /* Open the first object again.   */
-  h1 = dlopen ("reldepmod1.so", RTLD_LAZY | RTLD_GLOBAL);
+  h1 = dlopen ("reldepmod7.so", RTLD_LAZY);
   if (h1 == NULL)
     {
-      printf ("cannot open reldepmod1.so the second time: %s\n", dlerror ());
+      printf ("cannot open reldepmod7.so the second time: %s\n", dlerror ());
       exit (1);
     }
 
diff --git a/elf/reldepmod7.c b/elf/reldepmod7.c
new file mode 100644
index 0000000000..b8ef6401e1
--- /dev/null
+++ b/elf/reldepmod7.c
@@ -0,0 +1,10 @@
+extern int foo (void);
+
+int some_var;
+
+
+int
+foo (void)
+{
+  return some_var;
+}