From 22395d7ed4081e9dca0fb92dd8428330264f777f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 27 Feb 1997 17:49:00 +0000 Subject: [PATCH] * configure.in: Define BSD44_FORMAT if the target looks like a BSD4.4 derived system. * configure: Rebuild. * Makefile.in (.c.o): Add @DEFS@. * gmon_io.c (gmon_out_read): In BSD44_FORMAT code, get profrate from profrate field, not version field. --- gprof/ChangeLog | 9 +++++++++ gprof/Makefile.in | 2 +- gprof/configure | 9 +++++++++ gprof/configure.in | 9 +++++++++ gprof/gmon_io.c | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/gprof/ChangeLog b/gprof/ChangeLog index a8add32edc8..ab53b47384b 100644 --- a/gprof/ChangeLog +++ b/gprof/ChangeLog @@ -1,3 +1,12 @@ +Thu Feb 27 12:46:53 1997 Ian Lance Taylor + + * configure.in: Define BSD44_FORMAT if the target looks like a + BSD4.4 derived system. + * configure: Rebuild. + * Makefile.in (.c.o): Add @DEFS@. + * gmon_io.c (gmon_out_read): In BSD44_FORMAT code, get profrate + from profrate field, not version field. + Thu Jan 16 17:42:54 1997 Ian Lance Taylor * dummy.c (find_call): Clear ignore_direct_calls. diff --git a/gprof/Makefile.in b/gprof/Makefile.in index 2b4402ef883..db3f0f0af8e 100644 --- a/gprof/Makefile.in +++ b/gprof/Makefile.in @@ -56,7 +56,7 @@ LDFLAGS= HLDFLAGS = @HLDFLAGS@ HLDENV = @HLDENV@ .c.o: - $(CC) -c -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd -DMACHINE_H=\"$(MY_TARGET).h\" $(TCFLAGS) $(HCFLAGS) $(CFLAGS) $< + $(CC) -c -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd @DEFS@ -DMACHINE_H=\"$(MY_TARGET).h\" $(TCFLAGS) $(HCFLAGS) $(CFLAGS) $< all: $(GEN_FILES) $(PROG) diff --git a/gprof/configure b/gprof/configure index 7799ca8d87f..cf951d9d9f8 100755 --- a/gprof/configure +++ b/gprof/configure @@ -925,6 +925,15 @@ esac +case "${target}" in +*-*-bsd4.4* | *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) + cat >> confdefs.h <<\EOF +#define BSD44_FORMAT 1 +EOF + + ;; +esac + BFDLIB='-L../bfd -lbfd' # We need to handle some special cases if BFD was built shared. diff --git a/gprof/configure.in b/gprof/configure.in index 074ace72661..30bb9b237e8 100644 --- a/gprof/configure.in +++ b/gprof/configure.in @@ -33,6 +33,15 @@ esac AC_SUBST(MY_TARGET) +dnl We need to set BSD44_FORMAT on a host which uses the additional +dnl header fields. This is an attempt to do that. I can't think of a +dnl good feature test for this. +case "${target}" in +*-*-bsd4.4* | *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) + AC_DEFINE(BSD44_FORMAT) + ;; +esac + BFDLIB='-L../bfd -lbfd' # We need to handle some special cases if BFD was built shared. diff --git a/gprof/gmon_io.c b/gprof/gmon_io.c index 1f0e1acbf24..d66b969281a 100644 --- a/gprof/gmon_io.c +++ b/gprof/gmon_io.c @@ -188,7 +188,7 @@ DEFUN (gmon_out_read, (filename), const char *filename) { int profrate; - profrate = bfd_get_32 (core_bfd, (bfd_byte *) &raw.version[0]); + profrate = bfd_get_32 (core_bfd, (bfd_byte *) &raw.profrate[0]); if (!s_highpc) hz = profrate; else if (hz != profrate) -- 2.30.2