summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-09-07 23:32:00 +0000
committerjdp <jdp@FreeBSD.org>1998-09-07 23:32:00 +0000
commit5b11e2a2f4237604a3b79eae0bd8f58cd296fca5 (patch)
tree3406d2b2dff7ee0b157826eb5429d6e93491b1a8 /contrib/gcc
parent06aec80098f1b2500b86064347079545f0d01eaf (diff)
downloadFreeBSD-src-5b11e2a2f4237604a3b79eae0bd8f58cd296fca5.zip
FreeBSD-src-5b11e2a2f4237604a3b79eae0bd8f58cd296fca5.tar.gz
Make profiling work for ELF. gprof now autodetects the format of
the executable file, so it will work for both a.out and ELF format files. I have split the object format specific code into separate source files. It's cleaner than it was before, but it's still pretty crufty. Don't cheat on your make world for this update. A lot of things have to be rebuilt for it to work, including the compiler and all of the profiled libraries.
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/config/i386/freebsd.h11
-rw-r--r--contrib/gcc/config/i386/freebsd.h.fixed11
2 files changed, 14 insertions, 8 deletions
diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h
index 7563948..d55c8f8 100644
--- a/contrib/gcc/config/i386/freebsd.h
+++ b/contrib/gcc/config/i386/freebsd.h
@@ -405,9 +405,10 @@ do { \
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *%s@GOT(%%ebx)\n", \
+ TARGET_AOUT ? "mcount" : ".mcount"); \
else \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall %s\n", TARGET_AOUT ? "mcount" : ".mcount"); \
}
#define FUNCTION_PROFILER_EPILOGUE(FILE) \
@@ -415,9 +416,11 @@ do { \
if (TARGET_PROFILER_EPILOGUE) \
{ \
if (flag_pic) \
- fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *%s@GOT(%%ebx)\n", \
+ TARGET_AOUT ? "mexitcount" : ".mexitcount"); \
else \
- fprintf (FILE, "\tcall mexitcount\n"); \
+ fprintf (FILE, "\tcall %s\n", \
+ TARGET_AOUT ? "mexitcount" : ".mexitcount"); \
} \
}
diff --git a/contrib/gcc/config/i386/freebsd.h.fixed b/contrib/gcc/config/i386/freebsd.h.fixed
index 7563948..d55c8f8 100644
--- a/contrib/gcc/config/i386/freebsd.h.fixed
+++ b/contrib/gcc/config/i386/freebsd.h.fixed
@@ -405,9 +405,10 @@ do { \
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *%s@GOT(%%ebx)\n", \
+ TARGET_AOUT ? "mcount" : ".mcount"); \
else \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall %s\n", TARGET_AOUT ? "mcount" : ".mcount"); \
}
#define FUNCTION_PROFILER_EPILOGUE(FILE) \
@@ -415,9 +416,11 @@ do { \
if (TARGET_PROFILER_EPILOGUE) \
{ \
if (flag_pic) \
- fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *%s@GOT(%%ebx)\n", \
+ TARGET_AOUT ? "mexitcount" : ".mexitcount"); \
else \
- fprintf (FILE, "\tcall mexitcount\n"); \
+ fprintf (FILE, "\tcall %s\n", \
+ TARGET_AOUT ? "mexitcount" : ".mexitcount"); \
} \
}
OpenPOWER on IntegriCloud