shithub: scc

ref: a8d4f208d8e94b207c1625fa0008a9f247635dd2
dir: /src/libmach/objsect.c/

View raw version
#include <stdio.h>

#include <scc/mach.h>

#include "libmach.h"

extern getsectfun_t getsectv[];

int
objsect(Obj *obj, Objsect **secp)
{
	int fmt;
	getsectfun_t fn;

	fmt = FORMAT(obj->type);
	if (fmt >= NFORMATS)
		return -1;

	fn = getsectv[fmt];
	return  (*fn)(obj, secp);
}