From: Simon Baldwin Date: Mon, 22 Oct 2012 11:13:25 +0000 (+0000) Subject: * as.c (dump_statistics): Compute data size as the delta between X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef8e09a0817e4636f5523afc2feac00a4f173977;p=binutils-gdb.git * as.c (dump_statistics): Compute data size as the delta between current sbrk(0) and start_sbrk. * (main): Set start_sbrk to sbrk(0) on entry. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index b7e4f2ddcd6..035a9cc3065 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2012-10-22 Simon Baldwin + + * as.c (dump_statistics): Compute data size as the delta between + current sbrk(0) and start_sbrk. + * (main): Set start_sbrk to sbrk(0) on entry. + 2012-10-18 Kai Tietz * config/obj-coff.c: Add include of struc-symbol.h header. diff --git a/gas/as.c b/gas/as.c index fa4141f92bc..3eb82c6dd1e 100644 --- a/gas/as.c +++ b/gas/as.c @@ -124,6 +124,9 @@ static struct itbl_file_list *itbl_files; #endif static long start_time; +#ifdef HAVE_SBRK +char *start_sbrk; +#endif static int flag_macro_alternate; @@ -975,7 +978,7 @@ dump_statistics (void) myname, run_time / 1000000, run_time % 1000000); #ifdef HAVE_SBRK fprintf (stderr, _("%s: data size %ld\n"), - myname, (long) (lim - (char *) &environ)); + myname, (long) (lim - start_sbrk)); #endif subsegs_print_statistics (stderr); @@ -1135,6 +1138,9 @@ main (int argc, char ** argv) int macro_strip_at; start_time = get_run_time (); +#ifdef HAVE_SBRK + start_sbrk = (char *) sbrk (0); +#endif #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, "");