scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <stdio.h>
 2#include <stdlib.h>
 3
 4#include <scc/mach.h>
 5#include <scc/coff32.h>
 6
 7#include "../libmach.h"
 8#include "fun.h"
 9
10void
11coff32del(Obj *obj)
12{
13	int i;
14	struct coff32 *coff = obj->data;
15
16	if (coff) {
17		free(coff->scns);
18		free(coff->ents);
19		free(coff->strtbl);
20
21		for (i = 0; i < coff->hdr.f_nscns; i++) {
22			if (coff->rels)
23				free(coff->rels[i]);
24			if (coff->lines)
25				free(coff->lines[i]);
26		}
27		free(coff->rels);
28		free(coff->lines);
29	}
30	free(obj->data);
31	obj->data = NULL;
32}