aboutsummaryrefslogtreecommitdiff
path: root/src/libmach
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2007-11-05 14:53:16 -0500
committerRuss Cox <rsc@swtch.com>2007-11-05 14:53:16 -0500
commit760f2fb6a9d0ce3b3deffae2ddcd799a9347337c (patch)
treeb07968f5e26c090798265eba038dafdf177a1586 /src/libmach
parent2640996af869dbdee7c0461c69a0c6e59ed58235 (diff)
downloadplan9port-760f2fb6a9d0ce3b3deffae2ddcd799a9347337c.tar.gz
plan9port-760f2fb6a9d0ce3b3deffae2ddcd799a9347337c.tar.bz2
plan9port-760f2fb6a9d0ce3b3deffae2ddcd799a9347337c.zip
libmach: move machbyname, mach to crack.c to avoid OS X linker problem
Diffstat (limited to 'src/libmach')
-rw-r--r--src/libmach/crack.c26
-rw-r--r--src/libmach/mach.c30
-rw-r--r--src/libmach/mkfile1
3 files changed, 26 insertions, 31 deletions
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 <mach.h>
#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; i<nelem(machs); i++)
+ if(strcmp(machs[i]->name, 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 <u.h>
-#include <libc.h>
-#include <bio.h>
-#include <mach.h>
-
-Mach *mach;
-
-extern Mach mach386;
-extern Mach machpower;
-
-static Mach *machs[] =
-{
- &mach386,
- &machpower,
-};
-
-Mach*
-machbyname(char *name)
-{
- int i;
-
- for(i=0; i<nelem(machs); i++)
- if(strcmp(machs[i]->name, 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\