elf64del.c (437B)
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 #include <scc/mach.h> 5 #include <scc/elf64.h> 6 7 #include "../libmach.h" 8 #include "fun.h" 9 10 void 11 elf64del(Obj *obj) 12 { 13 struct elf64 *elf = obj->data; 14 15 if (elf) { 16 free(elf->phdr); 17 free(elf->shdr); 18 free(elf->syms); 19 free(elf->strtbl[0]); 20 free(elf->strtbl[1]); 21 } 22 free(obj->data); 23 obj->data = NULL; 24 }