Lines Matching refs:sec

195 		struct section *sec = &secs[i];  in read_shdrs()  local
202 sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name); in read_shdrs()
203 sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type); in read_shdrs()
204 sec->shdr.sh_flags = elf_xword_to_cpu(shdr.sh_flags); in read_shdrs()
205 sec->shdr.sh_addr = elf_addr_to_cpu(shdr.sh_addr); in read_shdrs()
206 sec->shdr.sh_offset = elf_off_to_cpu(shdr.sh_offset); in read_shdrs()
207 sec->shdr.sh_size = elf_xword_to_cpu(shdr.sh_size); in read_shdrs()
208 sec->shdr.sh_link = elf_word_to_cpu(shdr.sh_link); in read_shdrs()
209 sec->shdr.sh_info = elf_word_to_cpu(shdr.sh_info); in read_shdrs()
210 sec->shdr.sh_addralign = elf_xword_to_cpu(shdr.sh_addralign); in read_shdrs()
211 sec->shdr.sh_entsize = elf_xword_to_cpu(shdr.sh_entsize); in read_shdrs()
213 if (sec->shdr.sh_link < shnum) in read_shdrs()
214 sec->link = &secs[sec->shdr.sh_link]; in read_shdrs()
224 struct section *sec = &secs[i]; in read_relocs() local
226 if (sec->shdr.sh_type != SHT_REL_TYPE) in read_relocs()
229 sec->reltab = malloc(sec->shdr.sh_size); in read_relocs()
230 if (!sec->reltab) in read_relocs()
231 die("malloc of %" FMT " bytes for relocs failed\n", sec->shdr.sh_size); in read_relocs()
233 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_relocs()
234 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_relocs()
236 if (fread(sec->reltab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_relocs()
239 for (j = 0; j < sec->shdr.sh_size / sizeof(Elf_Rel); j++) { in read_relocs()
240 Elf_Rel *rel = &sec->reltab[j]; in read_relocs()
266 static int do_reloc(struct section *sec, Elf_Rel *rel) in do_reloc() argument
301 struct section *sec = &secs[i]; in walk_relocs() local
303 if (sec->shdr.sh_type != SHT_REL_TYPE) in walk_relocs()
306 sec_applies = &secs[sec->shdr.sh_info]; in walk_relocs()
310 for (j = 0; j < sec->shdr.sh_size / sizeof(Elf_Rel); j++) { in walk_relocs()
311 Elf_Rel *rel = &sec->reltab[j]; in walk_relocs()
313 do_reloc(sec, rel); in walk_relocs()