This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

The further question.


Hi,Martin

Thanks for your help!

I have further question:

	When i run gcc -pg -S greeting.c
	From greeting.s, i can see the complier will call mcount. But in the function mcount , it doesn't call monstartup( profiling start),_mcleanup(profiling stop).I notice declaration of these two functions in gmon.h. But i don't know how they are linked together when running gcc -pg.

I tried to read gcc.c. But it's difficult for me to read. Can you give me some suggestions about how to read gcc.c and other source file.

I'd like to know what does gcc do when add pg parameter?

Thanks very much for your great help!
Meggie
-----Original Message-----
From: Martin v. Loewis [mailto:martin@mira.isdn.cs.tu-berlin.de]
Sent: Monday, November 29, 1999 5:29 AM
To: meggie.yang@intel.com
Cc: gcc@gcc.gnu.org
Subject: Re: Help Soon!


> > 	Now i am studying gprof. I'm interested gmon.c file. But i don't know where can i find the mcount function.Which describe following:
> > 		extern mcount() asm ("mcount");
> > 	What's meaning?

This is only a declaration. It declares that the name of the function,
on assembler level, is "mcount" (rather than "_mcount", or
"mcount__Fv"). This is because the compiler, internally, generates
calls to mcount, and it has to use the correct spelling there.

If you have such a declaration, you still have to have a definition.

> > 	Why there is another mcount function in the file? 

That is the definition.

Hope this helps,
Martin


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