Lines Matching refs:shdr
331 Elf_Shdr* shdr = (Elf_Shdr*)(ehdrC + ehdr->e_shoff); in findElfSection() local
332 char* sh_strtab = ehdrC + shdr[ehdr->e_shstrndx].sh_offset; in findElfSection()
337 if (shdr[i].sh_type == sh_type in findElfSection()
342 && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8) in findElfSection()
344 ptr = ehdrC + shdr[i].sh_offset; in findElfSection()
420 Elf_Shdr* shdr, int shnum, in do_Elf_Rel_relocations() argument
426 Elf_Rel* rtab = (Elf_Rel*) (ehdrC + shdr[shnum].sh_offset); in do_Elf_Rel_relocations()
427 int nent = shdr[shnum].sh_size / sizeof(Elf_Rel); in do_Elf_Rel_relocations()
428 int target_shndx = shdr[shnum].sh_info; in do_Elf_Rel_relocations()
429 int symtab_shndx = shdr[shnum].sh_link; in do_Elf_Rel_relocations()
431 stab = (Elf_Sym*) (ehdrC + shdr[ symtab_shndx ].sh_offset); in do_Elf_Rel_relocations()
432 targ = (Elf_Word*)(ehdrC + shdr[ target_shndx ].sh_offset); in do_Elf_Rel_relocations()
459 (ehdrC + shdr[ sym.st_shndx ].sh_offset in do_Elf_Rel_relocations()
546 Elf_Shdr* shdr, int shnum, in do_Elf_Rela_relocations() argument
552 Elf_Rela* rtab = (Elf_Rela*) (ehdrC + shdr[shnum].sh_offset); in do_Elf_Rela_relocations()
553 int nent = shdr[shnum].sh_size / sizeof(Elf_Rela); in do_Elf_Rela_relocations()
554 int target_shndx = shdr[shnum].sh_info; in do_Elf_Rela_relocations()
555 int symtab_shndx = shdr[shnum].sh_link; in do_Elf_Rela_relocations()
557 stab = (Elf_Sym*) (ehdrC + shdr[ symtab_shndx ].sh_offset); in do_Elf_Rela_relocations()
558 targ = (Elf_Addr) (ehdrC + shdr[ target_shndx ].sh_offset); in do_Elf_Rela_relocations()
594 (ehdrC + shdr[ sym.st_shndx ].sh_offset in do_Elf_Rela_relocations()
715 Elf_Shdr* shdr = (Elf_Shdr*) (ehdrC + ehdr->e_shoff); in ocResolve_ELF() local
716 char* sh_strtab = ehdrC + shdr[ehdr->e_shstrndx].sh_offset; in ocResolve_ELF()
736 if (0 == memcmp(".rel.stab", sh_strtab + shdr[shnum].sh_name, 9)) in ocResolve_ELF()
739 if (shdr[shnum].sh_type == SHT_REL ) { in ocResolve_ELF()
740 ok = do_Elf_Rel_relocations ( oc, ehdrC, shdr, in ocResolve_ELF()
745 if (shdr[shnum].sh_type == SHT_RELA) { in ocResolve_ELF()
746 ok = do_Elf_Rela_relocations ( oc, ehdrC, shdr, in ocResolve_ELF()
769 Elf_Shdr* shdr; in ocVerifyImage_ELF() local
830 shdr = (Elf_Shdr*) (ehdrC + ehdr->e_shoff); in ocVerifyImage_ELF()
839 sh_strtab = ehdrC + shdr[ehdr->e_shstrndx].sh_offset; in ocVerifyImage_ELF()
844 if (debug_linker>1) fprintf(stderr, "type=%2d ", (int)shdr[i].sh_type ); in ocVerifyImage_ELF()
845 if (debug_linker>1) fprintf(stderr, "size=%4d ", (int)shdr[i].sh_size ); in ocVerifyImage_ELF()
846 if (debug_linker>1) fprintf(stderr, "offs=%4d ", (int)shdr[i].sh_offset ); in ocVerifyImage_ELF()
848 ehdrC + shdr[i].sh_offset, in ocVerifyImage_ELF()
849 ehdrC + shdr[i].sh_offset + shdr[i].sh_size - 1); in ocVerifyImage_ELF()
851 if (shdr[i].sh_type == SHT_REL) { in ocVerifyImage_ELF()
853 } else if (shdr[i].sh_type == SHT_RELA) { in ocVerifyImage_ELF()
860 sh_strtab + shdr[i].sh_name ); in ocVerifyImage_ELF()
868 if (shdr[i].sh_type == SHT_STRTAB in ocVerifyImage_ELF()
873 && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8) in ocVerifyImage_ELF()
877 strtab = ehdrC + shdr[i].sh_offset; in ocVerifyImage_ELF()
889 if (shdr[i].sh_type != SHT_SYMTAB) continue; in ocVerifyImage_ELF()
892 stab = (Elf_Sym*) (ehdrC + shdr[i].sh_offset); in ocVerifyImage_ELF()
893 nent = shdr[i].sh_size / sizeof(Elf_Sym); in ocVerifyImage_ELF()
897 shdr[i].sh_size % sizeof(Elf_Sym) in ocVerifyImage_ELF()
899 if (0 != shdr[i].sh_size % sizeof(Elf_Sym)) { in ocVerifyImage_ELF()
959 Elf_Shdr* shdr = (Elf_Shdr*) (ehdrC + ehdr->e_shoff); in ocGetNames_ELF() local
961 char* sh_strtab = ehdrC + shdr[ehdr->e_shstrndx].sh_offset; in ocGetNames_ELF()
976 Elf_Shdr hdr = shdr[i]; in ocGetNames_ELF()
1005 if (is_bss && shdr[i].sh_size > 0) { in ocGetNames_ELF()
1009 char* zspace = calloc(1, shdr[i].sh_size); in ocGetNames_ELF()
1010 shdr[i].sh_offset = ((char*)zspace) - ((char*)ehdrC); in ocGetNames_ELF()
1021 sec_name = sh_strtab + shdr[i].sh_name; in ocGetNames_ELF()
1032 if (kind != SECTIONKIND_OTHER && shdr[i].sh_size > 0) { in ocGetNames_ELF()
1033 addProddableBlock(oc, ehdrC + shdr[i].sh_offset, shdr[i].sh_size); in ocGetNames_ELF()
1038 if (shdr[i].sh_type != SHT_SYMTAB) continue; in ocGetNames_ELF()
1041 stab = (Elf_Sym*) (ehdrC + shdr[i].sh_offset); in ocGetNames_ELF()
1042 nent = shdr[i].sh_size / sizeof(Elf_Sym); in ocGetNames_ELF()
1090 ad = ehdrC + shdr[ secno ].sh_offset + stab[j].st_value; in ocGetNames_ELF()