libmach: move machbyname, mach to crack.c to avoid OS X linker problem
This commit is contained in:
parent
2640996af8
commit
760f2fb6a9
3 changed files with 26 additions and 31 deletions
|
|
@ -4,6 +4,32 @@
|
||||||
#include <mach.h>
|
#include <mach.h>
|
||||||
#include "elf.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
|
static struct
|
||||||
{
|
{
|
||||||
ulong magic;
|
ulong magic;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -27,7 +27,6 @@ OFILES=\
|
||||||
ieee.$O\
|
ieee.$O\
|
||||||
loc.$O\
|
loc.$O\
|
||||||
localaddr.$O\
|
localaddr.$O\
|
||||||
mach.$O\
|
|
||||||
mach386.$O\
|
mach386.$O\
|
||||||
macho.$O\
|
macho.$O\
|
||||||
machocorepower.$O\
|
machocorepower.$O\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue