about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-02-19 23:25:15 +0000
committerRoland McGrath <roland@gnu.org>1996-02-19 23:25:15 +0000
commit0ddc0d16048d02a98a8a26a1c3e1ab05197d4174 (patch)
treeb42d41b15352a41d56656628636003f854a4692a
parentbfc04a9ff126ea5fdbe08e281bfc61b93f31429b (diff)
downloadglibc-0ddc0d16048d02a98a8a26a1c3e1ab05197d4174.tar.gz
glibc-0ddc0d16048d02a98a8a26a1c3e1ab05197d4174.tar.xz
glibc-0ddc0d16048d02a98a8a26a1c3e1ab05197d4174.zip
Sun Feb 18 14:08:04 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
	* csu/initfini.c (_init): Remove bogus volatile declarations and
	extra variable, take the address of __gmon_start__ only implicitly
	to avoid the test being optimized out.
-rw-r--r--ChangeLog6
-rw-r--r--csu/initfini.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d828092e1b..bf48045572 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Feb 18 14:08:04 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+	* csu/initfini.c (_init): Remove bogus volatile declarations and
+	extra variable, take the address of __gmon_start__ only implicitly
+	to avoid the test being optimized out.
+
 Sun Feb 18 15:08:10 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
 
 	* sysdeps/posix/utimes.c (__utimes): There are 1000000 usecs in a
diff --git a/csu/initfini.c b/csu/initfini.c
index e1bf2b8284..a91c3de7a4 100644
--- a/csu/initfini.c
+++ b/csu/initfini.c
@@ -70,13 +70,10 @@ _init (void)
      gcrt1.o to reference a symbol which would be defined by some library
      module which has a constructor; but then user code's constructors
      would come first, and not be profiled.  */
-  extern volatile void __gmon_start__ (void) __attribute__ ((weak));
-  /* This volatile variable is necessary to avoid GCC optimizing
-     out the test.  */
-  register volatile void (*g) (void) = &__gmon_start__;
+  extern void __gmon_start__ (void) __attribute__ ((weak));
   weak_symbol (__gmon_start__)
-  if (g)
-    (*g) ();
+  if (__gmon_start__)
+    __gmon_start__ ();
 
   /* End the here document containing the .init prologue code.
      Then fetch the .section directive just written and append that