Lines Matching refs:fun
365 struct function_info *fun; member
429 struct function_info fun[1]; member
2402 if (sinfo->fun[i].lo <= off) in maybe_insert_function()
2409 if (sinfo->fun[i].lo == off) in maybe_insert_function()
2412 if (global && !sinfo->fun[i].global) in maybe_insert_function()
2414 sinfo->fun[i].global = TRUE; in maybe_insert_function()
2415 sinfo->fun[i].u.h = sym_h; in maybe_insert_function()
2418 sinfo->fun[i].is_func = TRUE; in maybe_insert_function()
2419 return &sinfo->fun[i]; in maybe_insert_function()
2422 else if (sinfo->fun[i].hi > off && size == 0) in maybe_insert_function()
2423 return &sinfo->fun[i]; in maybe_insert_function()
2442 memmove (&sinfo->fun[i + 1], &sinfo->fun[i], in maybe_insert_function()
2443 (sinfo->num_fun - i) * sizeof (sinfo->fun[i])); in maybe_insert_function()
2444 sinfo->fun[i].is_func = is_func; in maybe_insert_function()
2445 sinfo->fun[i].global = global; in maybe_insert_function()
2446 sinfo->fun[i].sec = sec; in maybe_insert_function()
2448 sinfo->fun[i].u.h = sym_h; in maybe_insert_function()
2450 sinfo->fun[i].u.sym = sym_h; in maybe_insert_function()
2451 sinfo->fun[i].lo = off; in maybe_insert_function()
2452 sinfo->fun[i].hi = off + size; in maybe_insert_function()
2453 sinfo->fun[i].lr_store = -1; in maybe_insert_function()
2454 sinfo->fun[i].sp_adjust = -1; in maybe_insert_function()
2455 sinfo->fun[i].stack = -find_function_stack_adjust (sec, off, in maybe_insert_function()
2456 &sinfo->fun[i].lr_store, in maybe_insert_function()
2457 &sinfo->fun[i].sp_adjust); in maybe_insert_function()
2459 return &sinfo->fun[i]; in maybe_insert_function()
2465 func_name (struct function_info *fun) in func_name() argument
2471 while (fun->start != NULL) in func_name()
2472 fun = fun->start; in func_name()
2474 if (fun->global) in func_name()
2475 return fun->u.h->root.root.string; in func_name()
2477 sec = fun->sec; in func_name()
2478 if (fun->u.sym->st_name == 0) in func_name()
2485 (unsigned long) fun->u.sym->st_value & 0xffffffff); in func_name()
2490 return bfd_elf_sym_name (ibfd, symtab_hdr, fun->u.sym, sec); in func_name()
2515 insns_at_end (struct function_info *fun, bfd_vma limit) in insns_at_end() argument
2517 bfd_vma off = (fun->hi + 3) & -4; in insns_at_end()
2519 while (off < limit && is_nop (fun->sec, off)) in insns_at_end()
2523 fun->hi = off; in insns_at_end()
2526 fun->hi = limit; in insns_at_end()
2545 if (sinfo->fun[i - 1].hi > sinfo->fun[i].lo) in check_function_ranges()
2548 const char *f1 = func_name (&sinfo->fun[i - 1]); in check_function_ranges()
2549 const char *f2 = func_name (&sinfo->fun[i]); in check_function_ranges()
2552 sinfo->fun[i - 1].hi = sinfo->fun[i].lo; in check_function_ranges()
2554 else if (insns_at_end (&sinfo->fun[i - 1], sinfo->fun[i].lo)) in check_function_ranges()
2561 if (sinfo->fun[0].lo != 0) in check_function_ranges()
2563 if (sinfo->fun[sinfo->num_fun - 1].hi > sec->size) in check_function_ranges()
2565 const char *f1 = func_name (&sinfo->fun[sinfo->num_fun - 1]); in check_function_ranges()
2568 sinfo->fun[sinfo->num_fun - 1].hi = sec->size; in check_function_ranges()
2570 else if (insns_at_end (&sinfo->fun[sinfo->num_fun - 1], sec->size)) in check_function_ranges()
2591 if (offset < sinfo->fun[mid].lo) in find_function()
2593 else if (offset >= sinfo->fun[mid].hi) in find_function()
2596 return &sinfo->fun[mid]; in find_function()
2614 if (p->fun == callee->fun) in insert_callee()
2621 p->fun->start = NULL; in insert_callee()
2622 p->fun->is_func = TRUE; in insert_callee()
2788 struct function_info *fun; in mark_functions_via_relocs() local
2801 fun = maybe_insert_function (sym_sec, sym, FALSE, is_call); in mark_functions_via_relocs()
2803 fun = maybe_insert_function (sym_sec, h, TRUE, is_call); in mark_functions_via_relocs()
2804 if (fun == NULL) in mark_functions_via_relocs()
2807 && fun->u.sym != sym) in mark_functions_via_relocs()
2819 callee->fun = find_function (sym_sec, val, info); in mark_functions_via_relocs()
2820 if (callee->fun == NULL) in mark_functions_via_relocs()
2827 if (callee->fun->last_caller != sec) in mark_functions_via_relocs()
2829 callee->fun->last_caller = sec; in mark_functions_via_relocs()
2830 callee->fun->call_count += 1; in mark_functions_via_relocs()
2835 && !callee->fun->is_func in mark_functions_via_relocs()
2836 && callee->fun->stack == 0) in mark_functions_via_relocs()
2845 callee->fun->start = NULL; in mark_functions_via_relocs()
2846 callee->fun->is_func = TRUE; in mark_functions_via_relocs()
2848 else if (callee->fun->start == NULL) in mark_functions_via_relocs()
2854 if (caller_start != callee->fun) in mark_functions_via_relocs()
2855 callee->fun->start = caller_start; in mark_functions_via_relocs()
2861 callee_start = callee->fun; in mark_functions_via_relocs()
2869 callee->fun->start = NULL; in mark_functions_via_relocs()
2870 callee->fun->is_func = TRUE; in mark_functions_via_relocs()
2889 struct function_info *fun, *fun_start; in pasted_function() local
2898 fun = maybe_insert_function (sec, fake, FALSE, FALSE); in pasted_function()
2899 if (!fun) in pasted_function()
2914 fun->start = fun_start; in pasted_function()
2915 callee->fun = fun; in pasted_function()
2931 fun_start = &sinfo->fun[sinfo->num_fun - 1]; in pasted_function()
3151 sinfo->fun[fun_idx].hi = hi; in discover_functions()
3152 hi = sinfo->fun[fun_idx].lo; in discover_functions()
3155 sinfo->fun[0].lo = 0; in discover_functions()
3214 if (!root_only || !sinfo->fun[i].non_root) in for_each_node()
3215 if (!doit (&sinfo->fun[i], info, param)) in for_each_node()
3227 transfer_calls (struct function_info *fun, in transfer_calls() argument
3231 struct function_info *start = fun->start; in transfer_calls()
3239 for (call = fun->call_list; call != NULL; call = call_next) in transfer_calls()
3245 fun->call_list = NULL; in transfer_calls()
3253 mark_non_root (struct function_info *fun, in mark_non_root() argument
3259 if (fun->visit1) in mark_non_root()
3261 fun->visit1 = TRUE; in mark_non_root()
3262 for (call = fun->call_list; call; call = call->next) in mark_non_root()
3264 call->fun->non_root = TRUE; in mark_non_root()
3265 mark_non_root (call->fun, 0, 0); in mark_non_root()
3273 remove_cycles (struct function_info *fun, in remove_cycles() argument
3281 fun->depth = depth; in remove_cycles()
3282 fun->visit2 = TRUE; in remove_cycles()
3283 fun->marking = TRUE; in remove_cycles()
3285 callp = &fun->call_list; in remove_cycles()
3289 if (!call->fun->visit2) in remove_cycles()
3291 if (!remove_cycles (call->fun, info, &call->max_depth)) in remove_cycles()
3296 else if (call->fun->marking) in remove_cycles()
3303 const char *f1 = func_name (fun); in remove_cycles()
3304 const char *f2 = func_name (call->fun); in remove_cycles()
3315 fun->marking = FALSE; in remove_cycles()
3326 mark_detached_root (struct function_info *fun, in mark_detached_root() argument
3330 if (fun->visit2) in mark_detached_root()
3332 fun->non_root = FALSE; in mark_detached_root()
3334 return remove_cycles (fun, info, param); in mark_detached_root()
3419 mark_overlay_section (struct function_info *fun, in mark_overlay_section() argument
3428 if (fun->visit4) in mark_overlay_section()
3431 fun->visit4 = TRUE; in mark_overlay_section()
3432 if (!fun->sec->linker_mark in mark_overlay_section()
3435 || strncmp (fun->sec->name, ".text.ia.", 9) == 0 in mark_overlay_section()
3436 || strcmp (fun->sec->name, ".init") == 0 in mark_overlay_section()
3437 || strcmp (fun->sec->name, ".fini") == 0)) in mark_overlay_section()
3441 fun->sec->linker_mark = 1; in mark_overlay_section()
3442 fun->sec->gc_mark = 1; in mark_overlay_section()
3443 fun->sec->segment_mark = 0; in mark_overlay_section()
3447 fun->sec->flags |= SEC_CODE; in mark_overlay_section()
3449 size = fun->sec->size; in mark_overlay_section()
3456 if (strcmp (fun->sec->name, ".text") == 0) in mark_overlay_section()
3463 else if (strncmp (fun->sec->name, ".text.", 6) == 0) in mark_overlay_section()
3465 size_t len = strlen (fun->sec->name); in mark_overlay_section()
3470 memcpy (name + 7, fun->sec->name + 5, len - 4); in mark_overlay_section()
3472 else if (strncmp (fun->sec->name, ".gnu.linkonce.t.", 16) == 0) in mark_overlay_section()
3474 size_t len = strlen (fun->sec->name) + 1; in mark_overlay_section()
3478 memcpy (name, fun->sec->name, len); in mark_overlay_section()
3485 asection *group_sec = elf_section_data (fun->sec)->next_in_group; in mark_overlay_section()
3487 rodata = bfd_get_section_by_name (fun->sec->owner, name); in mark_overlay_section()
3489 while (group_sec != NULL && group_sec != fun->sec) in mark_overlay_section()
3498 fun->rodata = rodata; in mark_overlay_section()
3499 if (fun->rodata) in mark_overlay_section()
3501 size += fun->rodata->size; in mark_overlay_section()
3505 size -= fun->rodata->size; in mark_overlay_section()
3506 fun->rodata = NULL; in mark_overlay_section()
3510 fun->rodata->linker_mark = 1; in mark_overlay_section()
3511 fun->rodata->gc_mark = 1; in mark_overlay_section()
3512 fun->rodata->flags &= ~SEC_CODE; in mark_overlay_section()
3522 for (count = 0, call = fun->call_list; call != NULL; call = call->next) in mark_overlay_section()
3531 for (count = 0, call = fun->call_list; call != NULL; call = call->next) in mark_overlay_section()
3536 fun->call_list = NULL; in mark_overlay_section()
3540 calls[count]->next = fun->call_list; in mark_overlay_section()
3541 fun->call_list = calls[count]; in mark_overlay_section()
3546 for (call = fun->call_list; call != NULL; call = call->next) in mark_overlay_section()
3551 BFD_ASSERT (!fun->sec->segment_mark); in mark_overlay_section()
3552 fun->sec->segment_mark = 1; in mark_overlay_section()
3555 && !mark_overlay_section (call->fun, info, param)) in mark_overlay_section()
3561 if (fun->lo + fun->sec->output_offset + fun->sec->output_section->vma in mark_overlay_section()
3563 || strncmp (fun->sec->output_section->name, ".ovl.init", 9) == 0) in mark_overlay_section()
3565 fun->sec->linker_mark = 0; in mark_overlay_section()
3566 if (fun->rodata != NULL) in mark_overlay_section()
3567 fun->rodata->linker_mark = 0; in mark_overlay_section()
3586 unmark_overlay_section (struct function_info *fun, in unmark_overlay_section() argument
3594 if (fun->visit5) in unmark_overlay_section()
3597 fun->visit5 = TRUE; in unmark_overlay_section()
3600 if (fun->sec == uos_param->exclude_input_section in unmark_overlay_section()
3601 || fun->sec->output_section == uos_param->exclude_output_section) in unmark_overlay_section()
3609 fun->sec->linker_mark = 0; in unmark_overlay_section()
3610 if (fun->rodata) in unmark_overlay_section()
3611 fun->rodata->linker_mark = 0; in unmark_overlay_section()
3614 for (call = fun->call_list; call != NULL; call = call->next) in unmark_overlay_section()
3616 && !unmark_overlay_section (call->fun, info, param)) in unmark_overlay_section()
3634 collect_lib_sections (struct function_info *fun, in collect_lib_sections() argument
3642 if (fun->visit6) in collect_lib_sections()
3645 fun->visit6 = TRUE; in collect_lib_sections()
3646 if (!fun->sec->linker_mark || !fun->sec->gc_mark || fun->sec->segment_mark) in collect_lib_sections()
3649 size = fun->sec->size; in collect_lib_sections()
3650 if (fun->rodata) in collect_lib_sections()
3651 size += fun->rodata->size; in collect_lib_sections()
3655 *lib_param->lib_sections++ = fun->sec; in collect_lib_sections()
3656 fun->sec->gc_mark = 0; in collect_lib_sections()
3657 if (fun->rodata && fun->rodata->linker_mark && fun->rodata->gc_mark) in collect_lib_sections()
3659 *lib_param->lib_sections++ = fun->rodata; in collect_lib_sections()
3660 fun->rodata->gc_mark = 0; in collect_lib_sections()
3666 for (call = fun->call_list; call != NULL; call = call->next) in collect_lib_sections()
3668 collect_lib_sections (call->fun, info, param); in collect_lib_sections()
3690 delta -= sinfo->fun[i].call_count; in sort_lib()
3698 delta += sinfo->fun[i].call_count; in sort_lib()
3774 for (call = sinfo->fun[k].call_list; call; call = call->next) in auto_ovl_lib_functions()
3775 if (call->fun->sec->linker_mark) in auto_ovl_lib_functions()
3779 if (p->fun == call->fun) in auto_ovl_lib_functions()
3798 if (!p->fun->sec->linker_mark) in auto_ovl_lib_functions()
3814 for (call = sinfo->fun[k].call_list; in auto_ovl_lib_functions()
3817 if (call->fun->sec->linker_mark) in auto_ovl_lib_functions()
3849 collect_overlays (struct function_info *fun, in collect_overlays() argument
3857 if (fun->visit7) in collect_overlays()
3860 fun->visit7 = TRUE; in collect_overlays()
3861 for (call = fun->call_list; call != NULL; call = call->next) in collect_overlays()
3864 if (!collect_overlays (call->fun, info, ovly_sections)) in collect_overlays()
3870 if (fun->sec->linker_mark && fun->sec->gc_mark) in collect_overlays()
3872 fun->sec->gc_mark = 0; in collect_overlays()
3873 *(*ovly_sections)++ = fun->sec; in collect_overlays()
3874 if (fun->rodata && fun->rodata->linker_mark && fun->rodata->gc_mark) in collect_overlays()
3876 fun->rodata->gc_mark = 0; in collect_overlays()
3877 *(*ovly_sections)++ = fun->rodata; in collect_overlays()
3886 if (fun->sec->segment_mark) in collect_overlays()
3888 struct function_info *call_fun = fun; in collect_overlays()
3894 call_fun = call->fun; in collect_overlays()
3907 for (call = fun->call_list; call != NULL; call = call->next) in collect_overlays()
3909 && !collect_overlays (call->fun, info, ovly_sections)) in collect_overlays()
3917 if ((sec_data = spu_elf_section_data (fun->sec)) != NULL in collect_overlays()
3922 if (!collect_overlays (&sinfo->fun[i], info, ovly_sections)) in collect_overlays()
3939 sum_stack (struct function_info *fun, in sum_stack() argument
3951 cum_stack = fun->stack; in sum_stack()
3953 if (fun->visit3) in sum_stack()
3958 for (call = fun->call_list; call; call = call->next) in sum_stack()
3964 if (!sum_stack (call->fun, info, sum_stack_param)) in sum_stack()
3970 if (!call->is_tail || call->is_pasted || call->fun->start != NULL) in sum_stack()
3971 stack += fun->stack; in sum_stack()
3975 max = call->fun; in sum_stack()
3980 stack = fun->stack; in sum_stack()
3982 fun->stack = cum_stack; in sum_stack()
3983 fun->visit3 = TRUE; in sum_stack()
3985 if (!fun->non_root in sum_stack()
3993 f1 = func_name (fun); in sum_stack()
3996 if (!fun->non_root) in sum_stack()
4004 for (call = fun->call_list; call; call = call->next) in sum_stack()
4007 const char *f2 = func_name (call->fun); in sum_stack()
4008 const char *ann1 = call->fun == max ? "*" : " "; in sum_stack()
4024 if (fun->global || ELF_ST_BIND (fun->u.sym->st_info) == STB_GLOBAL) in sum_stack()
4027 sprintf (name, "__stack_%x_%s", fun->sec->id & 0xffffffff, f1); in sum_stack()
4064 for (call = sinfo->fun[k].call_list; call != NULL; call = call->next) in find_pasted_call()
4109 struct function_info *call_fun = call->fun; in print_one_overlay_section()
4143 struct function_info *call_fun = call->fun; in print_one_overlay_section()
4442 struct function_info *call_fun = pasty->fun; in spu_elf_auto_overlay()
4467 for (call = sinfo->fun[k].call_list; call; call = call->next) in spu_elf_auto_overlay()
4473 else if (call->fun->sec->linker_mark) in spu_elf_auto_overlay()
4480 struct function_info *call_fun = pasty->fun; in spu_elf_auto_overlay()
4505 if (call->fun->sec == ovly_sections[2 * k]) in spu_elf_auto_overlay()