MCPcopy Create free account
hub / github.com/coreboot/coreboot / elf_writer_destroy

Function elf_writer_destroy

util/cbfstool/elfheaders.c:810–822  ·  view source on GitHub ↗

* Clean up any internal state represented by ew. Aftewards the elf_writer * is invalid. * It is safe to call elf_writer_destroy with ew as NULL. It returns without * performing any action. */

Source from the content-addressed store, hash-verified

808 * performing any action.
809 */
810void elf_writer_destroy(struct elf_writer *ew)
811{
812 int i;
813 if (ew == NULL)
814 return;
815 if (ew->phdrs != NULL)
816 free(ew->phdrs);
817 free(ew->strtab.buffer);
818 free(ew->symtab.syms);
819 for (i = 0; i < MAX_SECTIONS; i++)
820 free(ew->rel_sections[i].rels);
821 free(ew);
822}
823
824/*
825 * Add a section to the ELF file. Section type, flags, and memsize are

Callers 4

write_elfFunction · 0.85
rmodule_stage_to_elfFunction · 0.85
cbfs_stage_make_elfFunction · 0.85
cbfs_payload_make_elfFunction · 0.85

Calls 1

freeFunction · 0.50

Tested by

no test coverage detected