Lines Matching defs:shdr

25 	Elf_Shdr       shdr;
98 name = sec_strtab + secs[shndx].shdr.sh_name;
263 Elf_Shdr shdr;
276 if (fread(&shdr, sizeof(shdr), 1, fp) != 1)
279 sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name);
280 sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type);
281 sec->shdr.sh_flags = elf_xword_to_cpu(shdr.sh_flags);
282 sec->shdr.sh_addr = elf_addr_to_cpu(shdr.sh_addr);
283 sec->shdr.sh_offset = elf_off_to_cpu(shdr.sh_offset);
284 sec->shdr.sh_size = elf_xword_to_cpu(shdr.sh_size);
285 sec->shdr.sh_link = elf_word_to_cpu(shdr.sh_link);
286 sec->shdr.sh_info = elf_word_to_cpu(shdr.sh_info);
287 sec->shdr.sh_addralign = elf_xword_to_cpu(shdr.sh_addralign);
288 sec->shdr.sh_entsize = elf_xword_to_cpu(shdr.sh_entsize);
289 if (sec->shdr.sh_link < ehdr.e_shnum)
290 sec->link = &secs[sec->shdr.sh_link];
301 if (sec->shdr.sh_type != SHT_STRTAB)
304 sec->strtab = malloc(sec->shdr.sh_size);
307 sec->shdr.sh_size);
309 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0)
311 sec->shdr.sh_offset, strerror(errno));
313 if (fread(sec->strtab, 1, sec->shdr.sh_size, fp) !=
314 sec->shdr.sh_size)
325 if (sec->shdr.sh_type != SHT_SYMTAB)
328 sec->symtab = malloc(sec->shdr.sh_size);
331 sec->shdr.sh_size);
333 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0)
335 sec->shdr.sh_offset, strerror(errno));
337 if (fread(sec->symtab, 1, sec->shdr.sh_size, fp) !=
338 sec->shdr.sh_size)
341 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) {
363 base = sec->shdr.sh_addr;
369 if (sec->shdr.sh_type != SHT_REL_TYPE)
372 sec->reltab = malloc(sec->shdr.sh_size);
375 sec->shdr.sh_size);
377 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0)
379 sec->shdr.sh_offset, strerror(errno));
381 if (fread(sec->reltab, 1, sec->shdr.sh_size, fp) !=
382 sec->shdr.sh_size)
385 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {
410 Elf_Shdr shdr;
415 if (sec->shdr.sh_type != SHT_REL_TYPE)
422 if (fread(&shdr, sizeof(shdr), 1, fp) != 1)
430 shdr.sh_size = 0;
436 if (fwrite(&shdr, sizeof(shdr), 1, fp) != 1)
480 if (sec->shdr.sh_type != SHT_REL_TYPE)
484 sec_applies = &secs[sec->shdr.sh_info];
485 if (!(sec_applies->shdr.sh_flags & SHF_ALLOC))
490 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {
584 size_reserved = sec_reloc->shdr.sh_size;
607 if (fseek(outf, sec_reloc->shdr.sh_offset, SEEK_SET) < 0) {
609 sec_reloc->shdr.sh_offset, strerror(errno));
640 sec_name(sec->shdr.sh_info),