Lines Matching refs:rsec
272 struct section *rsec; in find_reloc_by_dest_range() local
275 rsec = sec->rsec; in find_reloc_by_dest_range()
276 if (!rsec) in find_reloc_by_dest_range()
281 sec_offset_hash(rsec, o)) { in find_reloc_by_dest_range()
282 if (reloc->sec != rsec) in find_reloc_by_dest_range()
850 static struct reloc *elf_init_reloc(struct elf *elf, struct section *rsec, in elf_init_reloc() argument
857 if (reloc_idx >= sec_num_entries(rsec)) { in elf_init_reloc()
859 __func__, reloc_idx, rsec->name, sec_num_entries(rsec)); in elf_init_reloc()
863 reloc = &rsec->relocs[reloc_idx]; in elf_init_reloc()
867 __func__, rsec->name, reloc_idx); in elf_init_reloc()
871 reloc->sec = rsec; in elf_init_reloc()
915 return elf_init_reloc(elf, sec->rsec, reloc_idx, offset, sym, addend, in elf_init_reloc_text_sym()
931 return elf_init_reloc(elf, sec->rsec, reloc_idx, offset, sym, addend, in elf_init_reloc_data_sym()
938 struct section *rsec; in read_relocs() local
947 list_for_each_entry(rsec, &elf->sections, list) { in read_relocs()
948 if (!is_reloc_sec(rsec)) in read_relocs()
951 rsec->base = find_section_by_index(elf, rsec->sh.sh_info); in read_relocs()
952 if (!rsec->base) { in read_relocs()
954 rsec->name); in read_relocs()
958 rsec->base->rsec = rsec; in read_relocs()
961 rsec->relocs = calloc(sec_num_entries(rsec), sizeof(*reloc)); in read_relocs()
962 if (!rsec->relocs) { in read_relocs()
966 for (i = 0; i < sec_num_entries(rsec); i++) { in read_relocs()
967 reloc = &rsec->relocs[i]; in read_relocs()
969 reloc->sec = rsec; in read_relocs()
974 symndx, rsec->name); in read_relocs()
1174 struct section *rsec; in elf_create_rela_section() local
1185 rsec = elf_create_section(elf, rsec_name, elf_rela_size(elf), reloc_nr); in elf_create_rela_section()
1187 if (!rsec) in elf_create_rela_section()
1190 rsec->data->d_type = ELF_T_RELA; in elf_create_rela_section()
1191 rsec->sh.sh_type = SHT_RELA; in elf_create_rela_section()
1192 rsec->sh.sh_addralign = elf_addr_size(elf); in elf_create_rela_section()
1193 rsec->sh.sh_link = find_section_by_name(elf, ".symtab")->idx; in elf_create_rela_section()
1194 rsec->sh.sh_info = sec->idx; in elf_create_rela_section()
1195 rsec->sh.sh_flags = SHF_INFO_LINK; in elf_create_rela_section()
1197 rsec->relocs = calloc(sec_num_entries(rsec), sizeof(struct reloc)); in elf_create_rela_section()
1198 if (!rsec->relocs) { in elf_create_rela_section()
1203 sec->rsec = rsec; in elf_create_rela_section()
1204 rsec->base = sec; in elf_create_rela_section()
1206 return rsec; in elf_create_rela_section()