From 760f2fb6a9d0ce3b3deffae2ddcd799a9347337c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 5 Nov 2007 14:53:16 -0500 Subject: [PATCH] libmach: move machbyname, mach to crack.c to avoid OS X linker problem --- src/libmach/crack.c | 26 ++++++++++++++++++++++++++ src/libmach/mach.c | 30 ------------------------------ src/libmach/mkfile | 1 - 3 files changed, 26 insertions(+), 31 deletions(-) delete mode 100644 src/libmach/mach.c diff --git a/src/libmach/crack.c b/src/libmach/crack.c index c186456a..fceba541 100644 --- a/src/libmach/crack.c +++ b/src/libmach/crack.c @@ -4,6 +4,32 @@ #include #include "elf.h" + +Mach *mach; + +extern Mach mach386; +extern Mach machpower; + +static Mach *machs[] = +{ + &mach386, + &machpower, +}; + +Mach* +machbyname(char *name) +{ + int i; + + for(i=0; iname, name) == 0){ + mach = machs[i]; + return machs[i]; + } + werrstr("machine '%s' not found", name); + return nil; +} + static struct { ulong magic; diff --git a/src/libmach/mach.c b/src/libmach/mach.c deleted file mode 100644 index 89a88f16..00000000 --- a/src/libmach/mach.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include -#include - -Mach *mach; - -extern Mach mach386; -extern Mach machpower; - -static Mach *machs[] = -{ - &mach386, - &machpower, -}; - -Mach* -machbyname(char *name) -{ - int i; - - for(i=0; iname, name) == 0){ - mach = machs[i]; - return machs[i]; - } - werrstr("machine '%s' not found", name); - return nil; -} - diff --git a/src/libmach/mkfile b/src/libmach/mkfile index 3f976be3..c218c2cf 100644 --- a/src/libmach/mkfile +++ b/src/libmach/mkfile @@ -27,7 +27,6 @@ OFILES=\ ieee.$O\ loc.$O\ localaddr.$O\ - mach.$O\ mach386.$O\ macho.$O\ machocorepower.$O\