diff options
author | Simon Baldwin <simonb@google.com> | 2012-10-22 11:13:25 +0000 |
---|---|---|
committer | Simon Baldwin <simonb@google.com> | 2012-10-22 11:13:25 +0000 |
commit | ef8e09a0817e4636f5523afc2feac00a4f173977 (patch) | |
tree | 37b53f9585a47c3e0cbbe81019acb9f95ad4ac32 /gas/as.c | |
parent | b3676d82d7039ba759abd39223d75cc81388b468 (diff) | |
download | gdb-ef8e09a0817e4636f5523afc2feac00a4f173977.zip gdb-ef8e09a0817e4636f5523afc2feac00a4f173977.tar.gz gdb-ef8e09a0817e4636f5523afc2feac00a4f173977.tar.bz2 |
* 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.
Diffstat (limited to 'gas/as.c')
-rw-r--r-- | gas/as.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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, ""); |