Lines Matching refs:sec

292 		struct section *sec = &secs[i];  in sym_lookup()  local
298 if (sec->shdr.sh_type != SHT_SYMTAB) in sym_lookup()
301 nsyms = sec->shdr.sh_size/sizeof(Elf_Sym); in sym_lookup()
302 symtab = sec->symtab; in sym_lookup()
303 strtab = sec->link->strtab; in sym_lookup()
449 struct section *sec = &secs[i]; in read_shdrs() local
454 sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name); in read_shdrs()
455 sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type); in read_shdrs()
456 sec->shdr.sh_flags = elf_xword_to_cpu(shdr.sh_flags); in read_shdrs()
457 sec->shdr.sh_addr = elf_addr_to_cpu(shdr.sh_addr); in read_shdrs()
458 sec->shdr.sh_offset = elf_off_to_cpu(shdr.sh_offset); in read_shdrs()
459 sec->shdr.sh_size = elf_xword_to_cpu(shdr.sh_size); in read_shdrs()
460 sec->shdr.sh_link = elf_word_to_cpu(shdr.sh_link); in read_shdrs()
461 sec->shdr.sh_info = elf_word_to_cpu(shdr.sh_info); in read_shdrs()
462 sec->shdr.sh_addralign = elf_xword_to_cpu(shdr.sh_addralign); in read_shdrs()
463 sec->shdr.sh_entsize = elf_xword_to_cpu(shdr.sh_entsize); in read_shdrs()
464 if (sec->shdr.sh_link < shnum) in read_shdrs()
465 sec->link = &secs[sec->shdr.sh_link]; in read_shdrs()
475 struct section *sec = &secs[i]; in read_strtabs() local
477 if (sec->shdr.sh_type != SHT_STRTAB) in read_strtabs()
480 sec->strtab = malloc(sec->shdr.sh_size); in read_strtabs()
481 if (!sec->strtab) in read_strtabs()
482 die("malloc of %" FMT " bytes for strtab failed\n", sec->shdr.sh_size); in read_strtabs()
484 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_strtabs()
485 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_strtabs()
487 if (fread(sec->strtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_strtabs()
497 struct section *sec = &secs[i]; in read_symtabs() local
500 switch (sec->shdr.sh_type) { in read_symtabs()
502 sec->xsymtab = malloc(sec->shdr.sh_size); in read_symtabs()
503 if (!sec->xsymtab) in read_symtabs()
504 die("malloc of %" FMT " bytes for xsymtab failed\n", sec->shdr.sh_size); in read_symtabs()
506 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_symtabs()
507 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_symtabs()
509 if (fread(sec->xsymtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_symtabs()
516 num_syms = sec->shdr.sh_size / sizeof(Elf_Sym); in read_symtabs()
518 sec->symtab = malloc(sec->shdr.sh_size); in read_symtabs()
519 if (!sec->symtab) in read_symtabs()
520 die("malloc of %" FMT " bytes for symtab failed\n", sec->shdr.sh_size); in read_symtabs()
522 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_symtabs()
523 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_symtabs()
525 if (fread(sec->symtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_symtabs()
529 Elf_Sym *sym = &sec->symtab[j]; in read_symtabs()
551 struct section *sec = &secs[i]; in read_relocs() local
553 if (sec->shdr.sh_type != SHT_REL_TYPE) in read_relocs()
556 sec->reltab = malloc(sec->shdr.sh_size); in read_relocs()
557 if (!sec->reltab) in read_relocs()
558 die("malloc of %" FMT " bytes for relocs failed\n", sec->shdr.sh_size); in read_relocs()
560 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_relocs()
561 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_relocs()
563 if (fread(sec->reltab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_relocs()
566 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in read_relocs()
567 Elf_Rel *rel = &sec->reltab[j]; in read_relocs()
593 struct section *sec = &secs[i]; in print_absolute_symbols() local
597 if (sec->shdr.sh_type != SHT_SYMTAB) in print_absolute_symbols()
600 sym_strtab = sec->link->strtab; in print_absolute_symbols()
602 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) { in print_absolute_symbols()
606 sym = &sec->symtab[j]; in print_absolute_symbols()
634 struct section *sec = &secs[i]; in print_absolute_relocs() local
640 if (sec->shdr.sh_type != SHT_REL_TYPE) in print_absolute_relocs()
643 sec_symtab = sec->link; in print_absolute_relocs()
644 sec_applies = &secs[sec->shdr.sh_info]; in print_absolute_relocs()
659 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in print_absolute_relocs()
664 rel = &sec->reltab[j]; in print_absolute_relocs()
721 static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel, in walk_relocs() argument
732 struct section *sec = &secs[i]; in walk_relocs() local
734 if (sec->shdr.sh_type != SHT_REL_TYPE) in walk_relocs()
737 sec_symtab = sec->link; in walk_relocs()
738 sec_applies = &secs[sec->shdr.sh_info]; in walk_relocs()
753 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in walk_relocs()
754 Elf_Rel *rel = &sec->reltab[j]; in walk_relocs()
758 process(sec, rel, sym, symname); in walk_relocs()
841 static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, in do_reloc64() argument
854 if (sec->shdr.sh_info == per_cpu_shndx) in do_reloc64()
928 static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, in do_reloc32() argument
971 static int do_reloc_real(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, const char *symname) in do_reloc_real() argument
1073 int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, const char *symname); in emit_relocs()
1152 static int do_reloc_info(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, in do_reloc_info() argument
1156 sec_name(sec->shdr.sh_info), in do_reloc_info()