• Home
  • Raw
  • Download

Lines Matching refs:sec

288 		struct section *sec = &secs[i];  in sym_lookup()  local
294 if (sec->shdr.sh_type != SHT_SYMTAB) in sym_lookup()
297 nsyms = sec->shdr.sh_size/sizeof(Elf_Sym); in sym_lookup()
298 symtab = sec->symtab; in sym_lookup()
299 strtab = sec->link->strtab; in sym_lookup()
451 struct section *sec = &secs[i]; in read_shdrs() local
455 sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name); in read_shdrs()
456 sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type); in read_shdrs()
457 sec->shdr.sh_flags = elf_xword_to_cpu(shdr.sh_flags); in read_shdrs()
458 sec->shdr.sh_addr = elf_addr_to_cpu(shdr.sh_addr); in read_shdrs()
459 sec->shdr.sh_offset = elf_off_to_cpu(shdr.sh_offset); in read_shdrs()
460 sec->shdr.sh_size = elf_xword_to_cpu(shdr.sh_size); in read_shdrs()
461 sec->shdr.sh_link = elf_word_to_cpu(shdr.sh_link); in read_shdrs()
462 sec->shdr.sh_info = elf_word_to_cpu(shdr.sh_info); in read_shdrs()
463 sec->shdr.sh_addralign = elf_xword_to_cpu(shdr.sh_addralign); in read_shdrs()
464 sec->shdr.sh_entsize = elf_xword_to_cpu(shdr.sh_entsize); in read_shdrs()
465 if (sec->shdr.sh_link < shnum) in read_shdrs()
466 sec->link = &secs[sec->shdr.sh_link]; in read_shdrs()
475 struct section *sec = &secs[i]; in read_strtabs() local
476 if (sec->shdr.sh_type != SHT_STRTAB) { in read_strtabs()
479 sec->strtab = malloc(sec->shdr.sh_size); in read_strtabs()
480 if (!sec->strtab) { in read_strtabs()
482 sec->shdr.sh_size); in read_strtabs()
484 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { in read_strtabs()
486 sec->shdr.sh_offset, strerror(errno)); in read_strtabs()
488 if (fread(sec->strtab, 1, sec->shdr.sh_size, fp) in read_strtabs()
489 != sec->shdr.sh_size) { in read_strtabs()
501 struct section *sec = &secs[i]; in read_symtabs() local
504 switch (sec->shdr.sh_type) { in read_symtabs()
506 sec->xsymtab = malloc(sec->shdr.sh_size); in read_symtabs()
507 if (!sec->xsymtab) { in read_symtabs()
509 sec->shdr.sh_size); in read_symtabs()
511 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { in read_symtabs()
513 sec->shdr.sh_offset, strerror(errno)); in read_symtabs()
515 if (fread(sec->xsymtab, 1, sec->shdr.sh_size, fp) in read_symtabs()
516 != sec->shdr.sh_size) { in read_symtabs()
524 num_syms = sec->shdr.sh_size / sizeof(Elf_Sym); in read_symtabs()
526 sec->symtab = malloc(sec->shdr.sh_size); in read_symtabs()
527 if (!sec->symtab) { in read_symtabs()
529 sec->shdr.sh_size); in read_symtabs()
531 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { in read_symtabs()
533 sec->shdr.sh_offset, strerror(errno)); in read_symtabs()
535 if (fread(sec->symtab, 1, sec->shdr.sh_size, fp) in read_symtabs()
536 != sec->shdr.sh_size) { in read_symtabs()
541 Elf_Sym *sym = &sec->symtab[j]; in read_symtabs()
562 struct section *sec = &secs[i]; in read_relocs() local
563 if (sec->shdr.sh_type != SHT_REL_TYPE) { in read_relocs()
566 sec->reltab = malloc(sec->shdr.sh_size); in read_relocs()
567 if (!sec->reltab) { in read_relocs()
569 sec->shdr.sh_size); in read_relocs()
571 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) { in read_relocs()
573 sec->shdr.sh_offset, strerror(errno)); in read_relocs()
575 if (fread(sec->reltab, 1, sec->shdr.sh_size, fp) in read_relocs()
576 != sec->shdr.sh_size) { in read_relocs()
580 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in read_relocs()
581 Elf_Rel *rel = &sec->reltab[j]; in read_relocs()
605 struct section *sec = &secs[i]; in print_absolute_symbols() local
609 if (sec->shdr.sh_type != SHT_SYMTAB) { in print_absolute_symbols()
612 sym_strtab = sec->link->strtab; in print_absolute_symbols()
613 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) { in print_absolute_symbols()
616 sym = &sec->symtab[j]; in print_absolute_symbols()
643 struct section *sec = &secs[i]; in print_absolute_relocs() local
648 if (sec->shdr.sh_type != SHT_REL_TYPE) { in print_absolute_relocs()
651 sec_symtab = sec->link; in print_absolute_relocs()
652 sec_applies = &secs[sec->shdr.sh_info]; in print_absolute_relocs()
666 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in print_absolute_relocs()
670 rel = &sec->reltab[j]; in print_absolute_relocs()
729 static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel, in walk_relocs() argument
739 struct section *sec = &secs[i]; in walk_relocs() local
741 if (sec->shdr.sh_type != SHT_REL_TYPE) { in walk_relocs()
744 sec_symtab = sec->link; in walk_relocs()
745 sec_applies = &secs[sec->shdr.sh_info]; in walk_relocs()
760 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in walk_relocs()
761 Elf_Rel *rel = &sec->reltab[j]; in walk_relocs()
765 process(sec, rel, sym, symname); in walk_relocs()
845 static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, in do_reloc64() argument
858 if (sec->shdr.sh_info == per_cpu_shndx) in do_reloc64()
935 static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, in do_reloc32() argument
980 static int do_reloc_real(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, in do_reloc_real() argument
1084 int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, in emit_relocs()
1164 static int do_reloc_info(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, in do_reloc_info() argument
1168 sec_name(sec->shdr.sh_info), in do_reloc_info()