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

Function ehdr_write

util/cbfstool/elfheaders.c:851–876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

849}
850
851static void ehdr_write(struct elf_writer *ew, struct buffer *m)
852{
853 int i;
854
855 for (i = 0; i < EI_NIDENT; i++)
856 ew->xdr->put8(m, ew->ehdr.e_ident[i]);
857 ew->xdr->put16(m, ew->ehdr.e_type);
858 ew->xdr->put16(m, ew->ehdr.e_machine);
859 ew->xdr->put32(m, ew->ehdr.e_version);
860 if (ew->bit64) {
861 ew->xdr->put64(m, ew->ehdr.e_entry);
862 ew->xdr->put64(m, ew->ehdr.e_phoff);
863 ew->xdr->put64(m, ew->ehdr.e_shoff);
864 } else {
865 ew->xdr->put32(m, ew->ehdr.e_entry);
866 ew->xdr->put32(m, ew->ehdr.e_phoff);
867 ew->xdr->put32(m, ew->ehdr.e_shoff);
868 }
869 ew->xdr->put32(m, ew->ehdr.e_flags);
870 ew->xdr->put16(m, ew->ehdr.e_ehsize);
871 ew->xdr->put16(m, ew->ehdr.e_phentsize);
872 ew->xdr->put16(m, ew->ehdr.e_phnum);
873 ew->xdr->put16(m, ew->ehdr.e_shentsize);
874 ew->xdr->put16(m, ew->ehdr.e_shnum);
875 ew->xdr->put16(m, ew->ehdr.e_shstrndx);
876}
877
878static void shdr_write(struct elf_writer *ew, size_t n, struct buffer *m)
879{

Callers 1

elf_writer_serializeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected