summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2002-04-17 22:05:01 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:48:46 +0200
commit352e3b3230dfc6746be6d53325ffe1e33efc5289 (patch)
tree4c169beb4657a1ed3a046817db01cbe49b17017c /ld
parentdf538463687d768b6ee8247ff4412b78850e7404 (diff)
downloaddev86-352e3b3230dfc6746be6d53325ffe1e33efc5289.tar.gz
Import Dev86src-0.16.3.tar.gzv0.16.3
Diffstat (limited to 'ld')
-rw-r--r--ld/Makefile6
-rw-r--r--ld/io.c11
-rw-r--r--ld/ld.c2
-rw-r--r--ld/syshead.h1
-rw-r--r--ld/type.h1
5 files changed, 19 insertions, 2 deletions
diff --git a/ld/Makefile b/ld/Makefile
index 393876c..104a740 100644
--- a/ld/Makefile
+++ b/ld/Makefile
@@ -1,4 +1,8 @@
+ifeq ($(VERSION),)
+include Version
+endif
+
LIBDIR =/usr/bin
CFLAGS =-O
LDFLAGS =
@@ -9,7 +13,7 @@ LDFLAGS =
# -DSTANDARD_GNU_A_OUT # a.out.h is like GNU normal.
# -DNO_AOUT # a.out.h is like nothing known!
#
-DEFS =-DREL_OUTPUT -DBUGCOMPAT
+DEFS =-DREL_OUTPUT -DBUGCOMPAT -DVERSION='"$(VERSION)"'
# An alternative file for a non-standard a.out.h (eg i386 linux on an Alpha)
#
diff --git a/ld/io.c b/ld/io.c
index e56a474..9dd7b06 100644
--- a/ld/io.c
+++ b/ld/io.c
@@ -127,8 +127,10 @@ int level;
PUBLIC void executable()
{
+ if (errcount)
+ unlink(outputname);
#ifndef MSDOS
- if (errcount == 0)
+ else
chmod(outputname, outputperms);
#endif
}
@@ -620,6 +622,13 @@ PUBLIC void usage()
#endif
}
+PUBLIC void version_msg()
+{
+ stderr_out();
+ putstr("ld86 version: ");
+ errexit(VERSION);
+}
+
PUBLIC void use_error(message)
char *message;
{
diff --git a/ld/ld.c b/ld/ld.c
index 9b9883b..24391ca 100644
--- a/ld/ld.c
+++ b/ld/ld.c
@@ -99,6 +99,8 @@ char **argv;
else
switch (arg[1])
{
+ case 'v':
+ version_msg();
case 'r': /* relocatable output */
#ifndef REL_OUTPUT
#ifndef MSDOS
diff --git a/ld/syshead.h b/ld/syshead.h
index fa5c23a..8ea2a3a 100644
--- a/ld/syshead.h
+++ b/ld/syshead.h
@@ -25,6 +25,7 @@
#define SEEK_SET 0
#define STDOUT_FILENO 0
#define STDERR_FILENO 0
+#define VERSION "MSDOS Compile"
#endif
/******************************************************************************/
diff --git a/ld/type.h b/ld/type.h
index ffe65f0..8d4390f 100644
--- a/ld/type.h
+++ b/ld/type.h
@@ -119,6 +119,7 @@ void reserved P((char *name));
void size_error P((int seg, bin_off_t count, bin_off_t size));
void undefined P((char *name));
void usage P((void));
+void version_msg P((void));
void use_error P((char *message));
/* ld.c */