summaryrefslogtreecommitdiffstats
path: root/usr.bin/objformat
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-09-17 01:49:00 +0000
committerpeter <peter@FreeBSD.org>2002-09-17 01:49:00 +0000
commita51c9b66271f0551fb83b90a7db6c464eac2318b (patch)
tree7d8147c99f6bfb34b7cb47ad46e24a4f7dc93102 /usr.bin/objformat
parent2a4cb24fb4a35753b66a2503614b874481e35535 (diff)
downloadFreeBSD-src-a51c9b66271f0551fb83b90a7db6c464eac2318b.zip
FreeBSD-src-a51c9b66271f0551fb83b90a7db6c464eac2318b.tar.gz
Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the comment in src/Makefile said, this stuff is deprecated and one should not expect this to remain beyond 4.0-REL. It has already lasted WAY beyond that. Notable exceptions: gcc - I have not touched the a.out generation stuff there. ldd/ldconfig - still have some code to interface with a.out rtld. old as/ld/etc - I have not removed these yet, pending their move to ports. some includes - necessary for ldd/ldconfig for now. Tested on: i386 (extensively), alpha
Diffstat (limited to 'usr.bin/objformat')
-rw-r--r--usr.bin/objformat/Makefile16
-rw-r--r--usr.bin/objformat/objformat.159
-rw-r--r--usr.bin/objformat/objformat.c51
3 files changed, 14 insertions, 112 deletions
diff --git a/usr.bin/objformat/Makefile b/usr.bin/objformat/Makefile
index 9c47abe..714cb48 100644
--- a/usr.bin/objformat/Makefile
+++ b/usr.bin/objformat/Makefile
@@ -1,21 +1,5 @@
# $FreeBSD$
PROG= objformat
-NOSHARED?= YES
-
-LINKS+= ${BINDIR}/objformat ${BINDIR}/addr2line
-LINKS+= ${BINDIR}/objformat ${BINDIR}/ar
-LINKS+= ${BINDIR}/objformat ${BINDIR}/as
-LINKS+= ${BINDIR}/objformat ${BINDIR}/c++filt
-LINKS+= ${BINDIR}/objformat ${BINDIR}/gasp
-LINKS+= ${BINDIR}/objformat ${BINDIR}/gdb
-LINKS+= ${BINDIR}/objformat ${BINDIR}/ld
-LINKS+= ${BINDIR}/objformat ${BINDIR}/nm
-LINKS+= ${BINDIR}/objformat ${BINDIR}/objcopy
-LINKS+= ${BINDIR}/objformat ${BINDIR}/objdump
-LINKS+= ${BINDIR}/objformat ${BINDIR}/ranlib
-LINKS+= ${BINDIR}/objformat ${BINDIR}/size
-LINKS+= ${BINDIR}/objformat ${BINDIR}/strings
-LINKS+= ${BINDIR}/objformat ${BINDIR}/strip
.include <bsd.prog.mk>
diff --git a/usr.bin/objformat/objformat.1 b/usr.bin/objformat/objformat.1
index c5575b4..84ac346 100644
--- a/usr.bin/objformat/objformat.1
+++ b/usr.bin/objformat/objformat.1
@@ -30,62 +30,26 @@
.Dt OBJFORMAT 1
.Sh NAME
.Nm objformat
-.Nd reports default binary format and program deflector
+.Nd reports default binary format
.Sh SYNOPSIS
.Nm
-.Nm prog
.Sh DESCRIPTION
-If run as
-.Nm
-the default object file format is reported. The two different object file
-formats are
-.Ar aout
-and
+This program os obsolete and is now just a compatability stub.
+It reports the object file format as
.Ar elf .
-.Pp
-If invoked by any other name,
-.Nm prog
-is expanded to
-.Pa /usr/libexec/<objformat>/prog
-and executed.
-.Sh DIAGNOSTICS
-The
-.Nm
-utility returns with exit code 1
-if called with an improper number of arguments, or if
-.Nm prog
-could not be executed.
-.Sh ENVIRONMENT
-.Bl -tag -width OBJFORMAT_PATH
-.It Ev OBJFORMAT
-If the environment variable
-.Ev OBJFORMAT
-is set, it overrides the default object file format.
-.Ev OBJFORMAT takes precedence over
-.Pa /etc/objformat .
-.It Ev OBJFORMAT_PATH
-If the environment variable
-.Ev OBJFORMAT_PATH
-is set, its value is used as the base path to
-.Nm prog .
-The default is
-.Pa /usr/libexec .
-.El
-.Sh FILES
-.Bl -tag -width /etc/objformat -compact
-.It Pa /etc/objformat
-If present, specifies the object file format to use. Syntax is
-.Ql OBJFORMAT=xxx .
-.El
-.Sh SEE ALSO
-.Xr file 1 ,
-.Xr getobjformat 3
-.\" .Sh STANDARDS
.Sh HISTORY
The
.Nm
command appeared in
.Fx 3.0 .
+.Pp
+The
+.Nm
+program was deprecated in
+.Fx 4.0
+and reduced to a compatability stub in
+.Fx 5.0 .
+It will be completely removed before the next release.
.Sh AUTHORS
.An -nosplit
The
@@ -94,4 +58,3 @@ utility was written by
.An Peter Wemm Aq peter@netplex.com.au .
This manual page was written by
.An David O'Brien Aq obrien@NUXI.com .
-.\" .Sh BUGS
diff --git a/usr.bin/objformat/objformat.c b/usr.bin/objformat/objformat.c
index 1b3e35d..f2e9595 100644
--- a/usr.bin/objformat/objformat.c
+++ b/usr.bin/objformat/objformat.c
@@ -26,58 +26,13 @@
* $FreeBSD$
*/
-#include <err.h>
-#include <objformat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
+#include <stdlib.h>
int
main(int argc, char **argv)
{
- char objformat[32];
- char *path, *chunk;
- char *cmd, *newcmd = NULL;
- const char *objformat_path;
-
- if (getobjformat(objformat, sizeof objformat, &argc, argv) == -1)
- errx(1, "Invalid object format");
-
- cmd = strrchr(argv[0], '/');
- if (cmd != NULL)
- cmd++;
- else
- cmd = argv[0];
-
- if (strcmp(cmd, "objformat") == 0) {
- if (argc != 1) {
- fprintf(stderr, "usage: objformat\n");
- exit(1);
- }
- printf("%s\n", objformat);
- exit(0);
- }
-
- /* 'make world' glue */
- objformat_path = getenv("OBJFORMAT_PATH");
- if (objformat_path == NULL)
- objformat_path = "/usr/libexec";
- path = strdup(objformat_path);
-
- setenv("OBJFORMAT", objformat, 1);
-
- while ((chunk = strsep(&path, ":")) != NULL) {
- if (newcmd != NULL) {
- free(newcmd);
- newcmd = NULL;
- }
- asprintf(&newcmd, "%s/%s/%s", chunk, objformat, cmd);
- if (newcmd == NULL)
- err(1, "cannot allocate memory for new command");
- argv[0] = newcmd;
- execv(newcmd, argv);
- }
- err(1, "could not exec %s/%s in %s", objformat, cmd, objformat_path);
+ write(1, "elf\n", 4);
+ return (0);
}
OpenPOWER on IntegriCloud