summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2004-01-24 16:27:32 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:48:49 +0200
commitbeba34dc223aa0dcf3e5f696966c5e8408b022c3 (patch)
treeea0523ac242bd3e877338e9a771b975d4cd3839a /ld
parentb5dac1e3bdd01a2ce105df747a9073ff0d6a94e2 (diff)
downloaddev86-beba34dc223aa0dcf3e5f696966c5e8408b022c3.tar.gz
Import Dev86src-0.16.15.tar.gzv0.16.15
Diffstat (limited to 'ld')
-rw-r--r--ld/ld.c6
-rw-r--r--ld/objdump86.c15
2 files changed, 19 insertions, 2 deletions
diff --git a/ld/ld.c b/ld/ld.c
index cc95fb7..2d31f13 100644
--- a/ld/ld.c
+++ b/ld/ld.c
@@ -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