Lines Matching full:sec
424 struct section *sec = &secs[i]; in read_shdrs() local
429 sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name); in read_shdrs()
430 sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type); in read_shdrs()
431 sec->shdr.sh_flags = elf_xword_to_cpu(shdr.sh_flags); in read_shdrs()
432 sec->shdr.sh_addr = elf_addr_to_cpu(shdr.sh_addr); in read_shdrs()
433 sec->shdr.sh_offset = elf_off_to_cpu(shdr.sh_offset); in read_shdrs()
434 sec->shdr.sh_size = elf_xword_to_cpu(shdr.sh_size); in read_shdrs()
435 sec->shdr.sh_link = elf_word_to_cpu(shdr.sh_link); in read_shdrs()
436 sec->shdr.sh_info = elf_word_to_cpu(shdr.sh_info); in read_shdrs()
437 sec->shdr.sh_addralign = elf_xword_to_cpu(shdr.sh_addralign); in read_shdrs()
438 sec->shdr.sh_entsize = elf_xword_to_cpu(shdr.sh_entsize); in read_shdrs()
439 if (sec->shdr.sh_link < shnum) in read_shdrs()
440 sec->link = &secs[sec->shdr.sh_link]; in read_shdrs()
450 struct section *sec = &secs[i]; in read_strtabs() local
452 if (sec->shdr.sh_type != SHT_STRTAB) in read_strtabs()
455 sec->strtab = malloc(sec->shdr.sh_size); in read_strtabs()
456 if (!sec->strtab) in read_strtabs()
457 die("malloc of %" FMT " bytes for strtab failed\n", sec->shdr.sh_size); in read_strtabs()
459 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_strtabs()
460 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_strtabs()
462 if (fread(sec->strtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_strtabs()
472 struct section *sec = &secs[i]; in read_symtabs() local
475 switch (sec->shdr.sh_type) { in read_symtabs()
477 sec->xsymtab = malloc(sec->shdr.sh_size); in read_symtabs()
478 if (!sec->xsymtab) in read_symtabs()
479 die("malloc of %" FMT " bytes for xsymtab failed\n", sec->shdr.sh_size); in read_symtabs()
481 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_symtabs()
482 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_symtabs()
484 if (fread(sec->xsymtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_symtabs()
491 num_syms = sec->shdr.sh_size / sizeof(Elf_Sym); in read_symtabs()
493 sec->symtab = malloc(sec->shdr.sh_size); in read_symtabs()
494 if (!sec->symtab) in read_symtabs()
495 die("malloc of %" FMT " bytes for symtab failed\n", sec->shdr.sh_size); in read_symtabs()
497 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_symtabs()
498 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_symtabs()
500 if (fread(sec->symtab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_symtabs()
504 Elf_Sym *sym = &sec->symtab[j]; in read_symtabs()
526 struct section *sec = &secs[i]; in read_relocs() local
528 if (sec->shdr.sh_type != SHT_REL_TYPE) in read_relocs()
531 sec->reltab = malloc(sec->shdr.sh_size); in read_relocs()
532 if (!sec->reltab) in read_relocs()
533 die("malloc of %" FMT " bytes for relocs failed\n", sec->shdr.sh_size); in read_relocs()
535 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) in read_relocs()
536 die("Seek to %" FMT " failed: %s\n", sec->shdr.sh_offset, strerror(errno)); in read_relocs()
538 if (fread(sec->reltab, 1, sec->shdr.sh_size, fp) != sec->shdr.sh_size) in read_relocs()
541 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in read_relocs()
542 Elf_Rel *rel = &sec->reltab[j]; in read_relocs()
568 struct section *sec = &secs[i]; in print_absolute_symbols() local
572 if (sec->shdr.sh_type != SHT_SYMTAB) in print_absolute_symbols()
575 sym_strtab = sec->link->strtab; in print_absolute_symbols()
577 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) { in print_absolute_symbols()
581 sym = &sec->symtab[j]; in print_absolute_symbols()
609 struct section *sec = &secs[i]; in print_absolute_relocs() local
615 if (sec->shdr.sh_type != SHT_REL_TYPE) in print_absolute_relocs()
618 sec_symtab = sec->link; in print_absolute_relocs()
619 sec_applies = &secs[sec->shdr.sh_info]; in print_absolute_relocs()
634 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in print_absolute_relocs()
639 rel = &sec->reltab[j]; in print_absolute_relocs()
696 static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel, in walk_relocs() argument
707 struct section *sec = &secs[i]; in walk_relocs() local
709 if (sec->shdr.sh_type != SHT_REL_TYPE) in walk_relocs()
712 sec_symtab = sec->link; in walk_relocs()
713 sec_applies = &secs[sec->shdr.sh_info]; in walk_relocs()
728 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { in walk_relocs()
729 Elf_Rel *rel = &sec->reltab[j]; in walk_relocs()
733 process(sec, rel, sym, symname); in walk_relocs()
740 static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, in do_reloc64() argument
743 int headtext = !strcmp(sec_name(sec->shdr.sh_info), ".head.text"); in do_reloc64()
817 static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, in do_reloc32() argument
860 static int do_reloc_real(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, const char *symname) in do_reloc_real() argument
963 int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym, const char *symname); in emit_relocs()
1034 static int do_reloc_info(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym, in do_reloc_info() argument
1038 sec_name(sec->shdr.sh_info), in do_reloc_info()