Lines Matching refs:shdr
156 Elf_Shdr *shdr;
176 shdr = NULL;
235 error = ko->ko_read(ko, (void **)&shdr, ko->ko_shdrsz, hdr->e_shoff,
241 ko->ko_shdr = shdr;
249 switch (shdr[i].sh_type) {
257 symstrindex = shdr[i].sh_link;
260 if (shdr[shdr[i].sh_info].sh_type != SHT_PROGBITS)
265 if (shdr[shdr[i].sh_info].sh_type != SHT_PROGBITS)
288 shdr[symstrindex].sh_type != SHT_STRTAB) {
328 ko->ko_symcnt = shdr[symtabindex].sh_size / sizeof(Elf_Sym);
336 shdr[symtabindex].sh_offset, true);
345 ko->ko_strtabsz = shdr[symstrindex].sh_size;
352 shdr[symstrindex].sh_offset, true);
377 if (shdr[hdr->e_shstrndx].sh_size != 0 &&
378 shdr[hdr->e_shstrndx].sh_type == SHT_STRTAB) {
379 ko->ko_shstrtabsz = shdr[hdr->e_shstrndx].sh_size;
381 shdr[hdr->e_shstrndx].sh_size,
382 shdr[hdr->e_shstrndx].sh_offset, true);
398 if (shdr[i].sh_type != SHT_PROGBITS &&
399 shdr[i].sh_type != SHT_NOBITS)
401 alignmask = shdr[i].sh_addralign - 1;
402 if ((shdr[i].sh_flags & SHF_EXECINSTR)) {
405 map_text_size += shdr[i].sh_size;
406 } else if (!(shdr[i].sh_flags & SHF_WRITE)) {
409 map_rodata_size += shdr[i].sh_size;
413 map_data_size += shdr[i].sh_size;
474 switch (shdr[i].sh_type) {
477 alignmask = shdr[i].sh_addralign - 1;
478 if ((shdr[i].sh_flags & SHF_EXECINSTR)) {
482 map_text_base += shdr[i].sh_size;
483 } else if (!(shdr[i].sh_flags & SHF_WRITE)) {
487 map_rodata_base += shdr[i].sh_size;
492 map_data_base += shdr[i].sh_size;
496 if (shdr[i].sh_type == SHT_PROGBITS) {
499 shdr[i].sh_size, shdr[i].sh_offset, false);
506 memset(addr, 0, shdr[i].sh_size);
509 ko->ko_progtab[pb].size = shdr[i].sh_size;
511 if (ko->ko_shstrtab != NULL && shdr[i].sh_name != 0) {
513 ko->ko_shstrtab + shdr[i].sh_name;
527 if (shdr[shdr[i].sh_info].sh_type != SHT_PROGBITS)
529 ko->ko_reltab[rl].size = shdr[i].sh_size;
531 shdr[i].sh_size % sizeof(Elf_Rel);
534 shdr[i].sh_size / sizeof(Elf_Rel);
535 ko->ko_reltab[rl].sec = shdr[i].sh_info;
539 shdr[i].sh_offset, true);
549 if (shdr[shdr[i].sh_info].sh_type != SHT_PROGBITS)
551 ko->ko_relatab[ra].size = shdr[i].sh_size;
553 shdr[i].sh_size % sizeof(Elf_Rela);
556 shdr[i].sh_size / sizeof(Elf_Rela);
557 ko->ko_relatab[ra].sec = shdr[i].sh_info;
560 shdr[i].sh_size,
561 shdr[i].sh_offset, true);