Lines Matching refs:sec

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