This is the mail archive of the
mailing list for the GCC project.
The further question.
- To: "'Martin v. Loewis'" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Subject: The further question.
- From: "Yang, Meggie" <meggie dot yang at intel dot com>
- Date: Mon, 29 Nov 1999 11:45:43 +0800
- Cc: gcc at gcc dot gnu dot org
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!
From: Martin v. Loewis [mailto:firstname.lastname@example.org]
Sent: Monday, November 29, 1999 5:29 AM
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,