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

Function elf_ehdr

util/cbfstool/elfheaders.c:141–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141static void
142elf_ehdr(struct buffer *input, Elf64_Ehdr *ehdr, struct xdr *xdr, int bit64)
143{
144 ehdr->e_type = xdr->get16(input);
145 ehdr->e_machine = xdr->get16(input);
146 ehdr->e_version = xdr->get32(input);
147 if (bit64){
148 ehdr->e_entry = xdr->get64(input);
149 ehdr->e_phoff = xdr->get64(input);
150 ehdr->e_shoff = xdr->get64(input);
151 } else {
152 ehdr->e_entry = xdr->get32(input);
153 ehdr->e_phoff = xdr->get32(input);
154 ehdr->e_shoff = xdr->get32(input);
155 }
156 ehdr->e_flags = xdr->get32(input);
157 ehdr->e_ehsize = xdr->get16(input);
158 ehdr->e_phentsize = xdr->get16(input);
159 ehdr->e_phnum = xdr->get16(input);
160 ehdr->e_shentsize = xdr->get16(input);
161 ehdr->e_shnum = xdr->get16(input);
162 ehdr->e_shstrndx = xdr->get16(input);
163}
164
165static void
166elf_phdr(struct buffer *pinput, Elf64_Phdr *phdr,

Callers 1

parse_elfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected