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

Function shdr_write

util/cbfstool/elfheaders.c:878–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

876}
877
878static void shdr_write(struct elf_writer *ew, size_t n, struct buffer *m)
879{
880 struct xdr *xdr = ew->xdr;
881 int bit64 = ew->bit64;
882 struct elf_writer_section *sec = &ew->sections[n];
883 Elf64_Shdr *shdr = &sec->shdr;
884
885 xdr->put32(m, shdr->sh_name);
886 xdr->put32(m, shdr->sh_type);
887 if (bit64) {
888 xdr->put64(m, shdr->sh_flags);
889 xdr->put64(m, shdr->sh_addr);
890 xdr->put64(m, shdr->sh_offset);
891 xdr->put64(m, shdr->sh_size);
892 xdr->put32(m, shdr->sh_link);
893 xdr->put32(m, shdr->sh_info);
894 xdr->put64(m, shdr->sh_addralign);
895 xdr->put64(m, shdr->sh_entsize);
896 } else {
897 xdr->put32(m, shdr->sh_flags);
898 xdr->put32(m, shdr->sh_addr);
899 xdr->put32(m, shdr->sh_offset);
900 xdr->put32(m, shdr->sh_size);
901 xdr->put32(m, shdr->sh_link);
902 xdr->put32(m, shdr->sh_info);
903 xdr->put32(m, shdr->sh_addralign);
904 xdr->put32(m, shdr->sh_entsize);
905 }
906}
907
908static void
909phdr_write(struct elf_writer *ew, struct buffer *m, Elf64_Phdr *phdr)

Callers 1

elf_writer_serializeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected