Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hp-pcd!hpfcso!mev From: mev@hpfcso.FC.HP.COM (Mike Vermeulen) Newsgroups: comp.sys.hp Subject: Re: Problem using profiler Message-ID: <7370324@hpfcso.FC.HP.COM> Date: 28 Feb 91 04:33:48 GMT References: <6715@testeng1.misemi> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 16 > Any ideas on what the problem is and how it can be solved? My guess is you forgot the -G (or -p) on the command line during the link step. The final link should look something like: cc -G -o a.out *.o The -G option is necessary to make certain the appropriate startup code (/lib/gcrt0.o for gprof or /lib/mcrt0.o for prof) is linked in to the program instead of the standard startup code (/lib/crt0.o). If you accidentally forget the -G on the link step, the appropriate buffers are not set up and the first time mcount (the counting routine called at the start of each routine) is called it dies. --mev