Lines Matching refs:shdr
32 Elf_Shdr shdr; member
250 name = sec_strtab + secs[shndx].shdr.sh_name; in sec_name()
284 if (sec->shdr.sh_type != SHT_SYMTAB) in sym_lookup()
287 nsyms = sec->shdr.sh_size/sizeof(Elf_Sym); in sym_lookup()
390 Elf_Shdr shdr; in read_ehdr() local
395 if (fread(&shdr, sizeof(shdr), 1, fp) != 1) in read_ehdr()
399 shnum = elf_xword_to_cpu(shdr.sh_size); in read_ehdr()
402 shstrndx = elf_word_to_cpu(shdr.sh_link); in read_ehdr()
412 Elf_Shdr shdr; in read_shdrs() local
425 if (fread(&shdr, sizeof(shdr), 1, fp) != 1) in read_shdrs()
428 sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name); in read_shdrs()
429 sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type); in read_shdrs()
430 sec->shdr.sh_flags = elf_xword_to_cpu(shdr.sh_flags); in read_shdrs()
431 sec->shdr.sh_addr = elf_addr_to_cpu(shdr.sh_addr); in read_shdrs()
432 sec->shdr.sh_offset = elf_off_to_cpu(shdr.sh_offset); in read_shdrs()
433 sec->shdr.sh_size = elf_xword_to_cpu(shdr.sh_size); in read_shdrs()
434 sec->shdr.sh_link = elf_word_to_cpu(shdr.sh_link); in read_shdrs()
435 sec->shdr.sh_info = elf_word_to_cpu(shdr.sh_info); in read_shdrs()
436 sec->shdr.sh_addralign = elf_xword_to_cpu(shdr.sh_addralign); in read_shdrs()
437 sec->shdr.sh_entsize = elf_xword_to_cpu(shdr.sh_entsize); in read_shdrs()
438 if (sec->shdr.sh_link < shnum) in read_shdrs()
439 sec->link = &secs[sec->shdr.sh_link]; in read_shdrs()
449 if (sec->shdr.sh_type != SHT_STRTAB) { in read_strtabs()
452 sec->strtab = malloc(sec->shdr.sh_size); in read_strtabs()
455 sec->shdr.sh_size); in read_strtabs()
457 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { in read_strtabs()
459 sec->shdr.sh_offset, strerror(errno)); in read_strtabs()
461 if (fread(sec->strtab, 1, sec->shdr.sh_size, fp) in read_strtabs()
462 != sec->shdr.sh_size) { in read_strtabs()
474 if (sec->shdr.sh_type != SHT_SYMTAB) { in read_symtabs()
477 sec->symtab = malloc(sec->shdr.sh_size); in read_symtabs()
480 sec->shdr.sh_size); in read_symtabs()
482 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { in read_symtabs()
484 sec->shdr.sh_offset, strerror(errno)); in read_symtabs()
486 if (fread(sec->symtab, 1, sec->shdr.sh_size, fp) in read_symtabs()
487 != sec->shdr.sh_size) { in read_symtabs()
491 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) { in read_symtabs()
507 if (sec->shdr.sh_type != SHT_REL_TYPE) { in read_relocs()
510 sec->reltab = malloc(sec->shdr.sh_size); in read_relocs()
513 sec->shdr.sh_size); in read_relocs()
515 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { in read_relocs()
517 sec->shdr.sh_offset, strerror(errno)); in read_relocs()
519 if (fread(sec->reltab, 1, sec->shdr.sh_size, fp) in read_relocs()
520 != sec->shdr.sh_size) { in read_relocs()
524 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in read_relocs()
553 if (sec->shdr.sh_type != SHT_SYMTAB) { in print_absolute_symbols()
557 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) { in print_absolute_symbols()
592 if (sec->shdr.sh_type != SHT_REL_TYPE) { in print_absolute_relocs()
596 sec_applies = &secs[sec->shdr.sh_info]; in print_absolute_relocs()
597 if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) { in print_absolute_relocs()
602 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in print_absolute_relocs()
677 if (sec->shdr.sh_type != SHT_REL_TYPE) { in walk_relocs()
681 sec_applies = &secs[sec->shdr.sh_info]; in walk_relocs()
682 if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) { in walk_relocs()
687 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in walk_relocs()
731 if (secs[i].shdr.sh_addr != 0) /* non SMP kernel */ in percpu_init()
783 if (sec->shdr.sh_info == per_cpu_shndx) in do_reloc64()
1099 sec_name(sec->shdr.sh_info), in do_reloc_info()