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

Function strtab_init

util/cbfstool/elfheaders.c:710–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708}
709
710static void strtab_init(struct elf_writer *ew, size_t size)
711{
712 struct buffer b;
713 Elf64_Shdr shdr;
714
715 /* Start adding strings after the initial NUL entry. */
716 ew->strtab.next_offset = 1;
717 ew->strtab.max_size = size;
718 ew->strtab.buffer = calloc(1, ew->strtab.max_size);
719
720 buffer_init(&b, NULL, ew->strtab.buffer, ew->strtab.max_size);
721 memset(&shdr, 0, sizeof(shdr));
722 shdr.sh_type = SHT_STRTAB;
723 shdr.sh_addralign = 1;
724 shdr.sh_size = ew->strtab.max_size;
725 elf_writer_add_section(ew, &shdr, &b, ".strtab");
726 ew->strtab_sec = last_section(ew);
727}
728
729static void symtab_init(struct elf_writer *ew, size_t max_entries)
730{

Callers 1

elf_writer_initFunction · 0.85

Calls 5

buffer_initFunction · 0.85
elf_writer_add_sectionFunction · 0.85
last_sectionFunction · 0.85
callocFunction · 0.50
memsetFunction · 0.50

Tested by

no test coverage detected