Lines Matching refs:sh
265 if (!gelf_getshdr(s, &sec->sh)) { in read_sections()
270 sec->name = elf_strptr(elf->elf, shstrndx, sec->sh.sh_name); in read_sections()
276 if (sec->sh.sh_size != 0) { in read_sections()
283 sec->data->d_size != sec->sh.sh_size) { in read_sections()
290 if (sec->sh.sh_flags & SHF_EXECINSTR) in read_sections()
291 elf->text_size += sec->sh.sh_size; in read_sections()
356 symbols_nr = symtab->sh.sh_size / symtab->sh.sh_entsize; in read_symbols()
389 sym->name = elf_strptr(elf->elf, symtab->sh.sh_link, in read_symbols()
512 sec->reloc->sh.sh_size += sec->reloc->sh.sh_entsize; in elf_add_reloc()
592 if ((sec->sh.sh_type != SHT_RELA) && in read_relocs()
593 (sec->sh.sh_type != SHT_REL)) in read_relocs()
596 sec->base = find_section_by_index(elf, sec->sh.sh_info); in read_relocs()
606 for (i = 0; i < sec->sh.sh_size / sec->sh.sh_entsize; i++) { in read_relocs()
613 switch (sec->sh.sh_type) { in read_relocs()
738 len = strtab->sh.sh_size; in elf_add_string()
739 strtab->sh.sh_size += data->d_size; in elf_add_string()
795 if (!gelf_getshdr(s, &sec->sh)) { in elf_create_section()
800 sec->sh.sh_size = size; in elf_create_section()
801 sec->sh.sh_entsize = entsize; in elf_create_section()
802 sec->sh.sh_type = SHT_PROGBITS; in elf_create_section()
803 sec->sh.sh_addralign = 1; in elf_create_section()
804 sec->sh.sh_flags = SHF_ALLOC | sh_flags; in elf_create_section()
814 sec->sh.sh_name = elf_add_string(elf, shstrtab, sec->name); in elf_create_section()
815 if (sec->sh.sh_name == -1) in elf_create_section()
848 sec->sh.sh_type = SHT_REL; in elf_create_rel_reloc_section()
849 sec->sh.sh_addralign = 8; in elf_create_rel_reloc_section()
850 sec->sh.sh_link = find_section_by_name(elf, ".symtab")->idx; in elf_create_rel_reloc_section()
851 sec->sh.sh_info = base->idx; in elf_create_rel_reloc_section()
852 sec->sh.sh_flags = SHF_INFO_LINK; in elf_create_rel_reloc_section()
878 sec->sh.sh_type = SHT_RELA; in elf_create_rela_reloc_section()
879 sec->sh.sh_addralign = 8; in elf_create_rela_reloc_section()
880 sec->sh.sh_link = find_section_by_name(elf, ".symtab")->idx; in elf_create_rela_reloc_section()
881 sec->sh.sh_info = base->idx; in elf_create_rela_reloc_section()
882 sec->sh.sh_flags = SHF_INFO_LINK; in elf_create_rela_reloc_section()
905 buf = malloc(sec->sh.sh_size); in elf_rebuild_rel_reloc_section()
912 sec->data->d_size = sec->sh.sh_size; in elf_rebuild_rel_reloc_section()
936 buf = malloc(sec->sh.sh_size); in elf_rebuild_rela_reloc_section()
943 sec->data->d_size = sec->sh.sh_size; in elf_rebuild_rela_reloc_section()
963 switch (sec->sh.sh_type) { in elf_rebuild_reloc_section()
993 if (sec->sh.sh_type == SHT_REL) { in elf_write_reloc()
1030 if (!gelf_update_shdr(s, &sec->sh)) { in elf_write()