1#include <stdio.h>2#include <stdlib.h>34#include <scc/mach.h>5#include <scc/coff32.h>67#include "../libmach.h"8#include "fun.h"910int11coff32strip(Obj *obj)12{13 int i;14 SCNHDR *scn;15 struct coff32 *coff = obj->data;16 FILHDR *hdr = &coff->hdr;1718 for (i = 0; i < hdr->f_nscns; i++) {19 scn = &coff->scns[i];20 scn->s_nrelloc = 0;21 scn->s_relptr = 0;22 scn->s_nlnno = 0;23 scn->s_lnnoptr = 0;2425 if (coff->rels)26 free(coff->rels[i]);27 if (coff->lines)28 free(coff->lines[i]);29 }3031 hdr->f_nsyms = 0;32 hdr->f_symptr = 0;33 hdr->f_flags |= F_RELFLG | F_LMNO | F_LSYMS;3435 free(coff->ents);36 free(coff->rels);37 free(coff->lines);3839 coff->ents = NULL;40 coff->rels = NULL;41 coff->lines = NULL;4243 return 0;44}