why static moncontrol() in sparc-solaris gmon.o?

Mikael Pettersson mikpe@csd.uu.se
Tue Oct 20 05:50:00 GMT 1998


I just discovered that egcs-1.1b (and perhaps earlier egcs releases
too) don't export "void moncontrol(int)" from gmon.o, when
built for a sparc-solaris2 host.  This is unfortunate, since right
now I need to be able to suspend and resume collection of profiling
data around certain code regions.

I note that gcc 2.7.2.3 and 2.8.1 both export this symbol, so
some egcs developer must have decided to hide it.  Why?

As moncontrol() is geuinely useful, I suggest making it
visible again.  Trivial patch follows.

--- egcs-1.1b/gcc/config/sparc/gmon-sol2.c.~1~  Tue Jan 27 23:11:54 1998
+++ egcs-1.1b/gcc/config/sparc/gmon-sol2.c      Tue Oct 20 12:40:12 1998
@@ -96,7 +96,7 @@
 
 #define        MSG "No space for profiling buffer(s)\n"
 
-static void moncontrol();
+void moncontrol();
 
 void monstartup(lowpc, highpc)
     char       *lowpc;
@@ -412,7 +412,7 @@
  *     profiling is what mcount checks to see if
  *     all the data structures are ready.
  */
-static void moncontrol(mode)
+void moncontrol(mode)
     int mode;
 {
     if (mode) {


-- 
Mikael Pettersson (mikpe@csd.uu.se)
Computing Science Department, Uppsala University



More information about the Gcc-patches mailing list