* Error in Gcov for ARM
@ 2011-09-20 5:14 Harry Trinta
2011-09-20 7:46 ` Jonathan Wakely
2011-09-20 10:08 ` Kai Ruottu
0 siblings, 2 replies; 3+ messages in thread
From: Harry Trinta @ 2011-09-20 5:14 UTC (permalink / raw)
To: gcc-help
Dear,
I am having a problem when compiling a program with options
-ftest-coverage and -fprofile-arcs to run on an embedded system with
ARM processor.
I'm using a GCC cross-compiler (arm-elf) to compile the program.
The errors is as follows:
- undefined reference to `__gcov_merge_add'
- undefined reference to `__gcov_init'
is there any restriction on the use of these parameters for this type
of processor?
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Error in Gcov for ARM
2011-09-20 5:14 Error in Gcov for ARM Harry Trinta
@ 2011-09-20 7:46 ` Jonathan Wakely
2011-09-20 10:08 ` Kai Ruottu
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2011-09-20 7:46 UTC (permalink / raw)
To: Harry Trinta; +Cc: gcc-help
On 20 September 2011 06:13, Harry Trinta wrote:
> Dear,
>
> I am having a problem when compiling a program with options
> -ftest-coverage and -fprofile-arcs to run on an embedded system with
> ARM processor.
> I'm using a GCC cross-compiler (arm-elf) to compile the program.
>
> The errors is as follows:
>
> - undefined reference to `__gcov_merge_add'
> - undefined reference to `__gcov_init'
>
>
> is there any restriction on the use of these parameters for this type
> of processor?
Are you linking with -fprofile-arcs or -lgcov?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Error in Gcov for ARM
2011-09-20 5:14 Error in Gcov for ARM Harry Trinta
2011-09-20 7:46 ` Jonathan Wakely
@ 2011-09-20 10:08 ` Kai Ruottu
1 sibling, 0 replies; 3+ messages in thread
From: Kai Ruottu @ 2011-09-20 10:08 UTC (permalink / raw)
To: gcc-help
20.9.2011 8:13, Harry Trinta kirjoitti:
> I am having a problem when compiling a program with options
> -ftest-coverage and -fprofile-arcs to run on an embedded system with
> ARM processor.
> I'm using a GCC cross-compiler (arm-elf) to compile the program.
>
> The errors is as follows:
>
> - undefined reference to `__gcov_merge_add'
> - undefined reference to `__gcov_init'
>
> is there any restriction on the use of these parameters for this type
> of processor?
Not for the processor but maybe for the target itself, as you told:
"an embedded system".
So could you please elaborate where the file 'auxname.gcda' or something
would appear :
-fprofile-arcs
Add code so that program flow arcs are instrumented. During
execution the program records how many times each branch and
call is executed and how many times it is taken or returns.
When the compiled program exits it saves this data to a file
called ‘auxname.gcda’ for each source file. The data may be
used for profile-directed optimizations (‘-fbranch-probabilities’),
or for test coverage analysis (‘-ftest-coverage’). Each object
fileÂ’s auxname is generated from the name of the output file,
if explicitly specified and it is not the final executable,
otherwise it is the basename of the source file. In both cases
any suffix is removed (e.g. ‘foo.gcda’ for input file ‘dir/foo.c’,
or ‘dir/foo.gcda’ for output file specified as ‘-o dir/foo.o’).
See Section 9.5 [Cross-profiling],
As default these files would be written onto the runtime system's
filesystem. What is this with an 'arm-elf' system?
The "cross profiling", what it needs from the standard C library
(implementing the '__gcov_merge_add()' and '__gcov_init()' routines?)
etc. consulting the GCC manual, would be your homework. For instance:
http://sysrun.haifa.il.ibm.com/hrl/greps2007/papers/gcov-on-an-embedded-system.pdf
If the basic prerequisites are ok and you know that they should
work, then you can ask why they however don't work.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-20 10:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-20 5:14 Error in Gcov for ARM Harry Trinta
2011-09-20 7:46 ` Jonathan Wakely
2011-09-20 10:08 ` Kai Ruottu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).