diff options
author | peter <peter@FreeBSD.org> | 2002-09-17 01:49:00 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-09-17 01:49:00 +0000 |
commit | a51c9b66271f0551fb83b90a7db6c464eac2318b (patch) | |
tree | 7d8147c99f6bfb34b7cb47ad46e24a4f7dc93102 /usr.bin/objformat/objformat.c | |
parent | 2a4cb24fb4a35753b66a2503614b874481e35535 (diff) | |
download | FreeBSD-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/objformat.c')
-rw-r--r-- | usr.bin/objformat/objformat.c | 51 |
1 files changed, 3 insertions, 48 deletions
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); } |