about summary refs log tree commit diff
path: root/elf/vismain.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-03-29 03:46:37 +0000
committerRoland McGrath <roland@gnu.org>2003-03-29 03:46:37 +0000
commit5972c58b0e00ee7f27b41c06d843eb9ff873f3ea (patch)
treecc8ff1dd5000a084a9a682d19e8eba9762bafec7 /elf/vismain.c
parent8a3e01b9fb7b179be764d1c10cb0b33abd1e9f68 (diff)
downloadglibc-5972c58b0e00ee7f27b41c06d843eb9ff873f3ea.tar.gz
glibc-5972c58b0e00ee7f27b41c06d843eb9ff873f3ea.tar.xz
glibc-5972c58b0e00ee7f27b41c06d843eb9ff873f3ea.zip
* elf/vismod.h (getvarlocal1): Return const char **.
	(getvarinmod1): Likewise.
	(getvaritcpt1): Likewise.
	(getvarlocal2): Likewise.
	(getvarinmod2): Likewise.
	(getvaritcpt2): Likewise.
	(getvaritcpt3): Likewise.
	* elf/vismain.c (do_test): Adjusted.
	* elf/vismod1.c (getvarlocal1): Return address.
	(getvarinmod1): Likewise.
	(getvaritcpt1): Likewise.
	* elf/vismod2.c (getvarlocal2): Likewise.
	(getvarinmod2): Likewise.
	(getvaritcpt2): Likewise.
	* elf/vismod3.c (getvaritcpt3): Likewise.

	* elf/vismain.c (do_test): Print both addresses when they don't match.
Diffstat (limited to 'elf/vismain.c')
-rw-r--r--elf/vismain.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/elf/vismain.c b/elf/vismain.c
index ad9c8470ac..867cd13061 100644
--- a/elf/vismain.c
+++ b/elf/vismain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -86,7 +86,8 @@ The handling of `.protected' seems to be implemented incorrectly: giving up");
      first DSO.  */
   if (protinmod != getinmod1 ())
     {
-      puts ("`protinmod' in main and mod1 don't have same address");
+      printf ("&protinmod in main (%p) != &protinmod in mod1 (%p)\n",
+	      protinmod, getinmod1 ());
       res = 1;
     }
   if (protinmod == getinmod2 ())
@@ -116,7 +117,8 @@ The handling of `.protected' seems to be implemented incorrectly: giving up");
      one intercepts the references from the main object.  */
   if (protitcpt != getitcpt3 ())
     {
-      puts ("`protitcpt' in main and mod3 don't have same address");
+      printf ("&protitcpt in main (%p) != &protitcpt in mod3 (%p)\n",
+	      &protitcpt, getitcpt3 ());
       res = 1;
     }
   if (protitcpt == getitcpt1 ())
@@ -150,12 +152,12 @@ pointers to `protitcpt' in mod1 or mod2 or mod3 incorrect (%#x)\n", val);
 
   /* Now look at variables.  First a variable which is available
      everywhere.  We must have three different addresses.  */
-  if (protvarlocal == getvarlocal1 ())
+  if (&protvarlocal == getvarlocal1 ())
     {
       puts ("`protvarlocal' in main and mod1 have same address");
       res = 1;
     }
-  if (protvarlocal == getvarlocal2 ())
+  if (&protvarlocal == getvarlocal2 ())
     {
       puts ("`protvarlocal' in main and mod2 have same address");
       res = 1;
@@ -170,53 +172,55 @@ pointers to `protitcpt' in mod1 or mod2 or mod3 incorrect (%#x)\n", val);
       puts ("`protvarlocal in main has wrong value");
       res = 1;
     }
-  if (strcmp (getvarlocal1 (), "vismod1.c") != 0)
+  if (strcmp (*getvarlocal1 (), "vismod1.c") != 0)
     {
       puts ("`getvarlocal1' returns wrong value");
       res = 1;
     }
-  if (strcmp (getvarlocal2 (), "vismod2.c") != 0)
+  if (strcmp (*getvarlocal2 (), "vismod2.c") != 0)
     {
       puts ("`getvarlocal2' returns wrong value");
       res = 1;
     }
 
   /* Now the case where there is no local definition.  */
-  if (protvarinmod != getvarinmod1 ())
+  if (&protvarinmod != getvarinmod1 ())
     {
-      puts ("`protvarinmod' in main and mod1 have not same address");
+      printf ("&protvarinmod in main (%p) != &protitcpt in mod1 (%p)\n",
+	      &protvarinmod, getvarinmod1 ());
       res = 1;
     }
-  if (protvarinmod == getvarinmod2 ())
+  if (&protvarinmod == getvarinmod2 ())
     {
       puts ("`protvarinmod' in main and mod2 have same address");
       res = 1;
     }
-  if (strcmp (getvarinmod1 (), "vismod1.c") != 0)
+  if (strcmp (*getvarinmod1 (), "vismod1.c") != 0)
     {
       puts ("`getvarinmod1' returns wrong value");
       res = 1;
     }
-  if (strcmp (getvarinmod2 (), "vismod2.c") != 0)
+  if (strcmp (*getvarinmod2 (), "vismod2.c") != 0)
     {
       puts ("`getvarinmod2' returns wrong value");
       res = 1;
     }
 
   /* And a test where a variable definition is intercepted.  */
-  if (protvaritcpt == getvaritcpt1 ())
+  if (&protvaritcpt == getvaritcpt1 ())
     {
       puts ("`protvaritcpt' in main and mod1 have same address");
       res = 1;
     }
-  if (protvaritcpt == getvaritcpt2 ())
+  if (&protvaritcpt == getvaritcpt2 ())
     {
       puts ("`protvaritcpt' in main and mod2 have same address");
       res = 1;
     }
-  if (protvaritcpt != getvaritcpt3 ())
+  if (&protvaritcpt != getvaritcpt3 ())
     {
-      puts ("`protvaritcpt' in main and mod3 have not same address");
+      printf ("&protvaritcpt in main (%p) != &protvaritcpt in mod3 (%p)\n",
+	      &protvaritcpt, getvaritcpt3 ());
       res = 1;
     }
   if (getvaritcpt1 () == getvaritcpt2 ())
@@ -229,12 +233,12 @@ pointers to `protitcpt' in mod1 or mod2 or mod3 incorrect (%#x)\n", val);
       puts ("`protvaritcpt in main has wrong value");
       res = 1;
     }
-  if (strcmp (getvaritcpt1 (), "vismod1.c") != 0)
+  if (strcmp (*getvaritcpt1 (), "vismod1.c") != 0)
     {
       puts ("`getvaritcpt1' returns wrong value");
       res = 1;
     }
-  if (strcmp (getvaritcpt2 (), "vismod2.c") != 0)
+  if (strcmp (*getvaritcpt2 (), "vismod2.c") != 0)
     {
       puts ("`getvaritcpt2' returns wrong value");
       res = 1;