Lines Matching refs:arch
154 libsym->arch.type = PPC_PLT_RESOLVED; in mark_as_resolved()
155 libsym->arch.resolved_value = value; in mark_as_resolved()
184 uint32_t insn1 = libsym->arch.resolved_value >> 32; in ppc32_delayed_symbol()
185 uint32_t insn2 = (uint32_t) libsym->arch.resolved_value; in ppc32_delayed_symbol()
190 == (arch_addr_t) (long) libsym->lib->arch.pltgot_addr))) in ppc32_delayed_symbol()
192 mark_as_resolved(libsym, libsym->arch.resolved_value); in ppc32_delayed_symbol()
204 &libsym->arch.resolved_value) < 0) { in arch_dynlink_done()
220 libsym->arch.plt_slot_addr in arch_dynlink_done()
245 if (lte->ehdr.e_machine == EM_PPC && lte->arch.secure_plt) { in arch_plt_sym_val()
246 assert(lte->arch.plt_stub_vma != 0); in arch_plt_sym_val()
247 return lte->arch.plt_stub_vma + PPC_PLT_STUB_SIZE * ndx; in arch_plt_sym_val()
274 assert(lte->arch.plt_stub_vma != 0); in arch_plt_sym_val()
275 return lte->arch.plt_stub_vma + PPC64_PLT_STUB_SIZE * ndx; in arch_plt_sym_val()
313 = (GElf_Addr)(uintptr_t)addr - lte->arch.opd_base; in arch_translate_address()
315 if (elf_read_u64(lte->arch.opd_data, offset, &value) < 0) { in arch_translate_address()
340 lte->arch.opd_data = elf_rawdata(sec, NULL); in load_opd_data()
341 if (lte->arch.opd_data == NULL) in load_opd_data()
344 lte->arch.opd_base = shdr.sh_addr + lte->bias; in load_opd_data()
345 lte->arch.opd_size = shdr.sh_size; in load_opd_data()
437 lte->arch.secure_plt = !(lte->plt_flags & SHF_EXECINSTR); in arch_elf_init()
443 if (lte->ehdr.e_machine == EM_PPC && !lte->arch.secure_plt) in arch_elf_init()
444 lib->arch.bss_plt_prelinked = nonzero_data(lte->plt_data); in arch_elf_init()
448 lib->arch.bss_plt_prelinked = -1; in arch_elf_init()
458 if ((lte->ehdr.e_machine == EM_PPC64 || lte->arch.secure_plt) in arch_elf_init()
478 if (lte->ehdr.e_machine == EM_PPC && lte->arch.secure_plt) { in arch_elf_init()
487 lte->arch.plt_stub_vma = glink_vma in arch_elf_init()
489 debug(1, "stub_vma is %#" PRIx64, lte->arch.plt_stub_vma); in arch_elf_init()
500 lte->arch.plt_stub_vma = glink_vma + 32; in arch_elf_init()
505 &lib->arch.pltgot_addr) < 0) { in arch_elf_init()
532 for (sym = lte->arch.stubs; sym != NULL; ) { in arch_elf_init()
538 lte->arch.stubs = NULL; in arch_elf_init()
583 libsym->arch.type = PPC64_PLT_STUB; in arch_elf_init()
584 libsym->next = lte->arch.stubs; in arch_elf_init()
585 lte->arch.stubs = libsym; in arch_elf_init()
718 if (! lte->arch.secure_plt) { in arch_elf_add_plt_entry()
735 for (symp = <e->arch.stubs; *symp != NULL; ) { in arch_elf_add_plt_entry()
783 libsym->arch.plt_slot_addr = plt_slot_addr; in arch_elf_add_plt_entry()
787 libsym->arch.type = PPC_PLT_UNRESOLVED; in arch_elf_add_plt_entry()
788 libsym->arch.resolved_value = plt_entry_addr; in arch_elf_add_plt_entry()
796 libsym->arch.type = PPC_PLT_NEED_UNRESOLVE; in arch_elf_add_plt_entry()
797 libsym->arch.data = malloc(sizeof *libsym->arch.data); in arch_elf_add_plt_entry()
798 if (libsym->arch.data == NULL) in arch_elf_add_plt_entry()
801 libsym->arch.data->self = libsym->arch.data; in arch_elf_add_plt_entry()
802 libsym->arch.data->plt_entry_addr = plt_entry_addr; in arch_elf_add_plt_entry()
803 libsym->arch.data->plt_slot_addr = plt_slot_addr; in arch_elf_add_plt_entry()
804 libsym->arch.data->plt_slot_value = plt_slot_value; in arch_elf_add_plt_entry()
805 libsym->arch.data->is_irelative = is_irelative; in arch_elf_add_plt_entry()
816 for (sym = lte->arch.stubs; sym != NULL; ) { in arch_elf_destroy()
829 struct process_stopping_handler *self = proc->arch.handler; in dl_plt_update_bp_on_hit()
834 if (read_plt_slot_value(proc, libsym->arch.plt_slot_addr, &value) < 0) in dl_plt_update_bp_on_hit()
839 unresolve_plt_slot(proc, libsym->arch.plt_slot_addr, in dl_plt_update_bp_on_hit()
840 libsym->arch.resolved_value); in dl_plt_update_bp_on_hit()
847 proc->arch.handler = NULL; in dl_plt_update_bp_on_hit()
856 assert(self->task_enabling_breakpoint->arch.handler == NULL); in cb_on_all_stopped()
857 self->task_enabling_breakpoint->arch.handler = self; in cb_on_all_stopped()
869 if (read_plt_slot_value(proc, libsym->arch.plt_slot_addr, &value) < 0) in cb_keep_stepping_p()
874 if (value == libsym->arch.resolved_value) in cb_keep_stepping_p()
883 && unresolve_plt_slot(proc, libsym->arch.plt_slot_addr, in cb_keep_stepping_p()
884 libsym->arch.resolved_value) < 0) in cb_keep_stepping_p()
913 if (leader == NULL || leader->arch.dl_plt_update_bp != NULL) in cb_keep_stepping_p()
920 leader->arch.dl_plt_update_bp = insert_breakpoint_at(proc, addr, NULL); in cb_keep_stepping_p()
921 if (leader->arch.dl_plt_update_bp == NULL) in cb_keep_stepping_p()
927 leader->arch.dl_plt_update_bp->cbs = &dl_plt_update_cbs; in cb_keep_stepping_p()
931 breakpoint_turn_off(leader->arch.dl_plt_update_bp, proc); in cb_keep_stepping_p()
945 (uintptr_t)bp->libsym->arch.resolved_value; in jump_to_entry_point()
956 assert(bp->arch.irel_libsym != NULL); in ppc_plt_bp_continue()
957 bp->libsym = bp->arch.irel_libsym; in ppc_plt_bp_continue()
958 bp->arch.irel_libsym = NULL; in ppc_plt_bp_continue()
961 switch (bp->libsym->arch.type) { in ppc_plt_bp_continue()
970 assert(bp->libsym->lib->arch.bss_plt_prelinked == 0); in ppc_plt_bp_continue()
979 if (leader != NULL && leader->arch.dl_plt_update_bp != NULL in ppc_plt_bp_continue()
980 && breakpoint_turn_on(leader->arch.dl_plt_update_bp, in ppc_plt_bp_continue()
1010 assert(bp->libsym->arch.type != bp->libsym->arch.type); in ppc_plt_bp_continue()
1050 && bp->libsym->arch.type == PPC_PLT_RESOLVED) { in ppc_plt_bp_retract()
1052 unresolve_plt_slot(proc, bp->libsym->arch.plt_slot_addr, in ppc_plt_bp_retract()
1053 bp->libsym->arch.resolved_value); in ppc_plt_bp_retract()
1063 libsym = bp->arch.irel_libsym; in ppc_plt_bp_install()
1066 if (libsym->arch.type == PPC_PLT_NEED_UNRESOLVE) { in ppc_plt_bp_install()
1076 struct ppc_unresolve_data *data = libsym->arch.data; in ppc_plt_bp_install()
1077 libsym->arch.data = NULL; in ppc_plt_bp_install()
1089 libsym->arch.type = PPC_PLT_IRELATIVE; in ppc_plt_bp_install()
1090 libsym->arch.resolved_value = plt_entry_addr; in ppc_plt_bp_install()
1126 libsym->arch.type = PPC_DEFAULT; in arch_library_symbol_init()
1133 if (libsym->arch.type == PPC_PLT_NEED_UNRESOLVE) { in arch_library_symbol_destroy()
1134 assert(libsym->arch.data->self == libsym->arch.data); in arch_library_symbol_destroy()
1135 free(libsym->arch.data); in arch_library_symbol_destroy()
1136 libsym->arch.data = NULL; in arch_library_symbol_destroy()
1144 retp->arch = libsym->arch; in arch_library_symbol_clone()
1154 bp->arch.irel_libsym = NULL; in arch_breakpoint_init()
1162 && bp->libsym->lib->arch.bss_plt_prelinked != 0) in arch_breakpoint_init()
1167 && bp->libsym->arch.type == PPC64_PLT_STUB) in arch_breakpoint_init()
1179 if (bp->libsym->arch.type == PPC_PLT_IRELATIVE) { in arch_breakpoint_init()
1180 bp->arch.irel_libsym = bp->libsym; in arch_breakpoint_init()
1195 retp->arch = sbp->arch; in arch_breakpoint_clone()
1202 proc->arch.dl_plt_update_bp = NULL; in arch_process_init()
1203 proc->arch.handler = NULL; in arch_process_init()
1215 retp->arch = proc->arch; in arch_process_clone()
1217 if (retp->arch.dl_plt_update_bp != NULL) { in arch_process_clone()
1221 retp->arch.dl_plt_update_bp in arch_process_clone()
1223 retp->arch.dl_plt_update_bp->addr); in arch_process_clone()
1225 assert(retp->arch.dl_plt_update_bp != NULL); in arch_process_clone()