1#include <stdio.h>2#include <stdlib.h>34#include <scc/mach.h>5#include <scc/elf.h>67#include "../libmach.h"8#include "fun.h"910int11elfnew(Obj *obj, int type)12{13 struct elf *elf;14 struct arch *ap;1516 if ((elf = calloc(1, sizeof(*elf))) == NULL)17 return -1;18 for (ap = elfarchs; ap->name; ++ap) {19 if (ap->type == type)20 break;21 }2223 elf->is32 = (ap->name) ? ap->is32 : -1;24 obj->data = elf;25 obj->index = "/";26 return 0;27}