diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ld.c | 6 | ||||
-rw-r--r-- | ld/objdump86.c | 15 |
2 files changed, 19 insertions, 2 deletions
@@ -53,13 +53,15 @@ char *suf; PRIVATE char *expandlib(fn) char *fn; { - char *path; + char *path, *s; int i; for (i = lastlib - 1; i >= 0; --i) { - path = ourmalloc(strlen(libs[i]) + strlen(fn) + 1); + path = ourmalloc(strlen(libs[i]) + strlen(fn) + 2); strcpy(path, libs[i]); + s = path + strlen(path); + if (s!=path && s[-1] != '/') strcat(path, "/"); strcat(path, fn); if (access(path, R_OK) == 0) return path; diff --git a/ld/objdump86.c b/ld/objdump86.c index 2c93aa0..d477f3b 100644 --- a/ld/objdump86.c +++ b/ld/objdump86.c @@ -79,6 +79,7 @@ int multiple_files = 0; int byte_order = 0; long size_text, size_data, size_bss; +long tot_size_text=0, tot_size_data=0, tot_size_bss=0; int main(argc, argv) @@ -118,6 +119,12 @@ char ** argv; for(ar=1; ar<argc; ar++) if(argv[ar][0] != '-') do_file(argv[ar]); + if( display_mode == 1 && multiple_files) + printf("%ld\t%ld\t%ld\t%ld\t%lx\tTotal\n", + tot_size_text, tot_size_data, tot_size_bss, + tot_size_text+ tot_size_data+ tot_size_bss, + tot_size_text+ tot_size_data+ tot_size_bss); + return 0; } @@ -242,6 +249,10 @@ char * archive; if(archive) printf("%s(%s)\n", archive, fname); else printf("%s\n", fname); + + tot_size_text += size_text; + tot_size_data += size_data; + tot_size_bss += size_bss; } if( sections == 1 && display_mode != 0 ) @@ -753,6 +764,10 @@ size_aout() header[2]+ header[3]+ header[4], header[2]+ header[3]+ header[4], ifname); + + tot_size_text += header[2]; + tot_size_data += header[3]; + tot_size_bss += header[4]; } void |