Lines Matching refs:sec
277 struct section *sec = &secs[i];
283 if (sec->shdr.sh_type != SHT_SYMTAB)
286 nsyms = sec->shdr.sh_size/sizeof(Elf_Sym);
287 symtab = sec->symtab;
288 strtab = sec->link->strtab;
423 struct section *sec = &secs[i];
427 sec->shdr.sh_name = elf_word_to_cpu(shdr.sh_name);
428 sec->shdr.sh_type = elf_word_to_cpu(shdr.sh_type);
429 sec->shdr.sh_flags = elf_xword_to_cpu(shdr.sh_flags);
430 sec->shdr.sh_addr = elf_addr_to_cpu(shdr.sh_addr);
431 sec->shdr.sh_offset = elf_off_to_cpu(shdr.sh_offset);
432 sec->shdr.sh_size = elf_xword_to_cpu(shdr.sh_size);
433 sec->shdr.sh_link = elf_word_to_cpu(shdr.sh_link);
434 sec->shdr.sh_info = elf_word_to_cpu(shdr.sh_info);
435 sec->shdr.sh_addralign = elf_xword_to_cpu(shdr.sh_addralign);
436 sec->shdr.sh_entsize = elf_xword_to_cpu(shdr.sh_entsize);
437 if (sec->shdr.sh_link < shnum)
438 sec->link = &secs[sec->shdr.sh_link];
447 struct section *sec = &secs[i];
448 if (sec->shdr.sh_type != SHT_STRTAB) {
451 sec->strtab = malloc(sec->shdr.sh_size);
452 if (!sec->strtab) {
454 sec->shdr.sh_size);
456 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) {
458 sec->shdr.sh_offset, strerror(errno));
460 if (fread(sec->strtab, 1, sec->shdr.sh_size, fp)
461 != sec->shdr.sh_size) {
472 struct section *sec = &secs[i];
473 if (sec->shdr.sh_type != SHT_SYMTAB) {
476 sec->symtab = malloc(sec->shdr.sh_size);
477 if (!sec->symtab) {
479 sec->shdr.sh_size);
481 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) {
483 sec->shdr.sh_offset, strerror(errno));
485 if (fread(sec->symtab, 1, sec->shdr.sh_size, fp)
486 != sec->shdr.sh_size) {
490 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) {
491 Elf_Sym *sym = &sec->symtab[j];
505 struct section *sec = &secs[i];
506 if (sec->shdr.sh_type != SHT_REL_TYPE) {
509 sec->reltab = malloc(sec->shdr.sh_size);
510 if (!sec->reltab) {
512 sec->shdr.sh_size);
514 if (fseek(fp, sec->shdr.sh_offset, SEEK_SET) < 0) {
516 sec->shdr.sh_offset, strerror(errno));
518 if (fread(sec->reltab, 1, sec->shdr.sh_size, fp)
519 != sec->shdr.sh_size) {
523 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {
524 Elf_Rel *rel = &sec->reltab[j];
548 struct section *sec = &secs[i];
552 if (sec->shdr.sh_type != SHT_SYMTAB) {
555 sym_strtab = sec->link->strtab;
556 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Sym); j++) {
559 sym = &sec->symtab[j];
586 struct section *sec = &secs[i];
591 if (sec->shdr.sh_type != SHT_REL_TYPE) {
594 sec_symtab = sec->link;
595 sec_applies = &secs[sec->shdr.sh_info];
601 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {
605 rel = &sec->reltab[j];
664 static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
674 struct section *sec = &secs[i];
676 if (sec->shdr.sh_type != SHT_REL_TYPE) {
679 sec_symtab = sec->link;
680 sec_applies = &secs[sec->shdr.sh_info];
686 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {
687 Elf_Rel *rel = &sec->reltab[j];
691 process(sec, rel, sym, symname);
769 static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
782 if (sec->shdr.sh_info == per_cpu_shndx)
859 static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
904 static int do_reloc_real(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
1008 int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
1088 static int do_reloc_info(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
1092 sec_name(sec->shdr.sh_info),