Unified · Split
| @@ -2115,6 +2115,8 @@ PUB_FUNC void tcc_print_stats(TCCState *s1, unsigned total_time) · 2114 unmodified lines | ||
| 2115 | 2115 | (double)total_time/1000, |
| 2116 | 2116 | (unsigned)total_lines*1000/total_time, |
| 2117 | 2117 | (double)total_bytes/1000/total_time); |
| 2118 | + fprintf(stderr, "* text %d, data %d, bss %d bytes\n", | |
| 2119 | + s1->total_output[0], s1->total_output[1], s1->total_output[2]); | |
| 2118 | 2120 | #ifdef MEM_DEBUG |
| 2119 | 2121 | fprintf(stderr, "* %d bytes memory used\n", mem_max_size); |
| 2120 | 2122 | #endif |
| @@ -918,6 +918,7 @@ struct TCCState { · 917 unmodified lines | ||
| 918 | 918 | int total_idents; |
| 919 | 919 | int total_lines; |
| 920 | 920 | int total_bytes; |
| 921 | + int total_output[3]; | |
| 921 | 922 | |
| 922 | 923 | /* option -dnum (for general development purposes) */ |
| 923 | 924 | int g_debug; |
| @@ -202,6 +202,12 @@ ST_FUNC void tccelf_end_file(TCCState *s1) · 201 unmodified lines | ||
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | tcc_free(tr); |
| 205 | + | |
| 206 | + /* record text/data/bss output for -bench info */ | |
| 207 | + for (i = 0; i < 3; ++i) { | |
| 208 | + s = s1->sections[i + 1]; | |
| 209 | + s1->total_output[i] += s->data_offset - s->sh_offset; | |
| 210 | + } | |
| 205 | 211 | } |
| 206 | 212 | |
| 207 | 213 | ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags) |