• Home
  • Raw
  • Download

Lines Matching refs:mod

91 cache_sections (Dwfl_Module *mod)  in cache_sections()  argument
97 if (unlikely (elf_getshstrndx (mod->main.elf, &shstrndx) < 0)) in cache_sections()
106 while ((scn = elf_nextscn (mod->main.elf, scn)) != NULL) in cache_sections()
116 if (__libdwfl_relocate_value (mod, mod->main.elf, &shstrndx, in cache_sections()
127 const char *name = elf_strptr (mod->main.elf, shstrndx, in cache_sections()
136 newref->start = shdr->sh_addr + mod->main.bias; in cache_sections()
143 if (mod->e_type == ET_REL in cache_sections()
146 && mod->dwfl->callbacks->section_address != NULL) in cache_sections()
151 Elf_Scn *tscn = elf_getscn (mod->main.elf, shdr->sh_info); in cache_sections()
166 mod->reloc_info = malloc (offsetof (struct dwfl_relocation, refs[nrefs])); in cache_sections()
167 if (mod->reloc_info == NULL) in cache_sections()
180 mod->reloc_info->count = nrefs; in cache_sections()
183 mod->reloc_info->refs[i].name = sortrefs[i]->name; in cache_sections()
184 mod->reloc_info->refs[i].scn = sortrefs[i]->scn; in cache_sections()
185 mod->reloc_info->refs[i].relocs = sortrefs[i]->relocs; in cache_sections()
186 mod->reloc_info->refs[i].start = sortrefs[i]->start; in cache_sections()
187 mod->reloc_info->refs[i].end = sortrefs[i]->end; in cache_sections()
197 while ((scn = elf_nextscn (mod->main.elf, scn)) != NULL) in cache_sections()
207 Elf_Scn *tscn = elf_getscn (mod->main.elf, shdr->sh_info); in cache_sections()
210 if (mod->reloc_info->refs[i].scn == tscn) in cache_sections()
212 mod->reloc_info->refs[i].relocs = scn; in cache_sections()
224 dwfl_module_relocations (Dwfl_Module *mod) in dwfl_module_relocations() argument
226 if (mod == NULL) in dwfl_module_relocations()
229 if (mod->reloc_info != NULL) in dwfl_module_relocations()
230 return mod->reloc_info->count; in dwfl_module_relocations()
232 switch (mod->e_type) in dwfl_module_relocations()
235 return cache_sections (mod); in dwfl_module_relocations()
241 assert (mod->main.bias == 0); in dwfl_module_relocations()
242 assert (mod->debug.bias == 0); in dwfl_module_relocations()
250 dwfl_module_relocation_info (Dwfl_Module *mod, unsigned int idx, in dwfl_module_relocation_info() argument
253 if (mod == NULL) in dwfl_module_relocation_info()
256 switch (mod->e_type) in dwfl_module_relocation_info()
272 if (unlikely (mod->reloc_info == NULL) && cache_sections (mod) < 0) in dwfl_module_relocation_info()
275 struct dwfl_relocation *sections = mod->reloc_info; in dwfl_module_relocation_info()
288 check_module (Dwfl_Module *mod) in check_module() argument
290 if (INTUSE(dwfl_module_getsymtab) (mod) < 0) in check_module()
300 if (mod->dw == NULL) in check_module()
303 if (INTUSE(dwfl_module_getdwarf) (mod, &bias) == NULL) in check_module()
319 find_section (Dwfl_Module *mod, Dwarf_Addr *addr) in find_section() argument
321 if (unlikely (mod->reloc_info == NULL) && cache_sections (mod) < 0) in find_section()
324 struct dwfl_relocation *sections = mod->reloc_info; in find_section()
355 dwfl_module_relocate_address (Dwfl_Module *mod, Dwarf_Addr *addr) in dwfl_module_relocate_address() argument
357 if (unlikely (check_module (mod))) in dwfl_module_relocate_address()
360 switch (mod->e_type) in dwfl_module_relocate_address()
363 return find_section (mod, addr); in dwfl_module_relocate_address()
367 *addr -= mod->low_addr; in dwfl_module_relocate_address()
381 dwfl_module_address_section (Dwfl_Module *mod, Dwarf_Addr *address, in INTDEF()
384 if (check_module (mod)) in INTDEF()
387 int idx = find_section (mod, address); in INTDEF()
391 if (mod->reloc_info->refs[idx].relocs != NULL) in INTDEF()
393 assert (mod->e_type == ET_REL); in INTDEF()
395 Elf_Scn *tscn = mod->reloc_info->refs[idx].scn; in INTDEF()
396 Elf_Scn *relocscn = mod->reloc_info->refs[idx].relocs; in INTDEF()
397 Dwfl_Error result = __libdwfl_relocate_section (mod, mod->main.elf, in INTDEF()
400 mod->reloc_info->refs[idx].relocs = NULL; in INTDEF()
408 *bias = mod->main.bias; in INTDEF()
409 return mod->reloc_info->refs[idx].scn; in INTDEF()