scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

elf64del.c (416B)


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