Why does the generated gmon.out file not contain data?

I compiled a program using the -pg switch and linked using the -pg switch. When my program runs, the file "gmon.out" is created. However, after running gprof in the file, there is no data other than the standard information explaining the data provided.

Why was there nothing in the gmon.out file? Obviously, the program is compiled and correctly linked to the creation of a new file "gmon.out"; he simply has no data.

+6
source share
1 answer

This is a bug that occurs with the recent gnu c compiler. You can use the -no-pie option as a workaround

gcc -no-pie 
+2
source

All Articles