Lines Matching refs:sec
234 spu_elf_new_section_hook (bfd *abfd, asection *sec) in spu_elf_new_section_hook() argument
236 if (!sec->used_by_bfd) in spu_elf_new_section_hook()
243 sec->used_by_bfd = sdata; in spu_elf_new_section_hook()
246 return _bfd_elf_new_section_hook (abfd, sec); in spu_elf_new_section_hook()
278 asection *sec = shdr->bfd_section; in spu_elf_object_p() local
279 spu_elf_section_data (sec)->u.o.ovl_index = num_ovl; in spu_elf_object_p()
280 spu_elf_section_data (sec)->u.o.ovl_buf = num_buf; in spu_elf_object_p()
388 asection *sec; member
1197 asection *sec; in build_stub() local
1243 sec = htab->stub_sec[ovl]; in build_stub()
1245 from = sec->size + sec->output_offset + sec->output_section->vma; in build_stub()
1261 bfd_put_32 (sec->owner, ILA + ((dest_ovl << 7) & 0x01ffff80) + 78, in build_stub()
1262 sec->contents + sec->size); in build_stub()
1263 bfd_put_32 (sec->owner, LNOP, in build_stub()
1264 sec->contents + sec->size + 4); in build_stub()
1265 bfd_put_32 (sec->owner, ILA + ((dest << 7) & 0x01ffff80) + 79, in build_stub()
1266 sec->contents + sec->size + 8); in build_stub()
1268 bfd_put_32 (sec->owner, BR + (((to - (from + 12)) << 5) & 0x007fff80), in build_stub()
1269 sec->contents + sec->size + 12); in build_stub()
1271 bfd_put_32 (sec->owner, BRA + ((to << 5) & 0x007fff80), in build_stub()
1272 sec->contents + sec->size + 12); in build_stub()
1278 bfd_put_32 (sec->owner, BRSL + (((to - from) << 5) & 0x007fff80) + 75, in build_stub()
1279 sec->contents + sec->size); in build_stub()
1281 bfd_put_32 (sec->owner, BRASL + ((to << 5) & 0x007fff80) + 75, in build_stub()
1282 sec->contents + sec->size); in build_stub()
1283 bfd_put_32 (sec->owner, (dest & 0x3ffff) | (dest_ovl << 18), in build_stub()
1284 sec->contents + sec->size + 4); in build_stub()
1388 bfd_put_32 (sec->owner, (set_id << 18) | (dest & 0x3ffff), in build_stub()
1389 sec->contents + sec->size); in build_stub()
1390 bfd_put_32 (sec->owner, BRASL + ((to << 5) & 0x007fff80) + 75, in build_stub()
1391 sec->contents + sec->size + 4); in build_stub()
1392 bfd_put_32 (sec->owner, (lrlive << 29) | (g->br_addr & 0x3ffff), in build_stub()
1393 sec->contents + sec->size + 8); in build_stub()
1397 bfd_put_32 (sec->owner, (patt << 5) & 0x007fff80, in build_stub()
1398 sec->contents + sec->size + 12); in build_stub()
1402 sec->size += 16; in build_stub()
1407 sec->size += ovl_stub_size (htab->params); in build_stub()
1446 h->root.u.def.section = sec; in build_stub()
1448 h->root.u.def.value = sec->size - h->size; in build_stub()
1857 overlay_index (asection *sec) in overlay_index() argument
1859 if (sec == NULL in overlay_index()
1860 || sec->output_section == bfd_abs_section_ptr) in overlay_index()
1862 return spu_elf_section_data (sec->output_section)->u.o.ovl_index; in overlay_index()
2185 find_function_stack_adjust (asection *sec, in find_function_stack_adjust() argument
2193 for ( ; offset + 4 <= sec->size; offset += 4) in find_function_stack_adjust()
2200 if (!bfd_get_section_contents (sec->owner, sec, buf, offset, 4)) in find_function_stack_adjust()
2354 alloc_stack_info (asection *sec, int max_fun) in alloc_stack_info() argument
2356 struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); in alloc_stack_info()
2371 maybe_insert_function (asection *sec, in maybe_insert_function() argument
2376 struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); in maybe_insert_function()
2383 sinfo = alloc_stack_info (sec, 20); in maybe_insert_function()
2446 sinfo->fun[i].sec = sec; in maybe_insert_function()
2455 sinfo->fun[i].stack = -find_function_stack_adjust (sec, off, in maybe_insert_function()
2467 asection *sec; in func_name() local
2477 sec = fun->sec; in func_name()
2480 size_t len = strlen (sec->name); in func_name()
2484 sprintf (name, "%s+%lx", sec->name, in func_name()
2488 ibfd = sec->owner; in func_name()
2490 return bfd_elf_sym_name (ibfd, symtab_hdr, fun->u.sym, sec); in func_name()
2497 is_nop (asection *sec, bfd_vma off) in is_nop() argument
2501 if (off + 4 > sec->size in is_nop()
2502 || !bfd_get_section_contents (sec->owner, sec, insn, off, 4)) in is_nop()
2519 while (off < limit && is_nop (fun->sec, off)) in insns_at_end()
2534 check_function_ranges (asection *sec, struct bfd_link_info *info) in check_function_ranges() argument
2536 struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); in check_function_ranges()
2563 if (sinfo->fun[sinfo->num_fun - 1].hi > sec->size) 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()
2580 find_function (asection *sec, bfd_vma offset, struct bfd_link_info *info) in find_function() argument
2582 struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); in find_function()
2599 sec, offset); in find_function()
2670 mark_functions_via_relocs (asection *sec, in mark_functions_via_relocs() argument
2680 if (!interesting_section (sec) in mark_functions_via_relocs()
2681 || sec->reloc_count == 0) in mark_functions_via_relocs()
2684 internal_relocs = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, in mark_functions_via_relocs()
2689 symtab_hdr = &elf_tdata (sec->owner)->symtab_hdr; in mark_functions_via_relocs()
2692 irelaend = irela + sec->reloc_count; in mark_functions_via_relocs()
2709 if (!get_sym_h (&h, &sym, &sym_sec, psyms, r_indx, sec->owner)) in mark_functions_via_relocs()
2721 if (!bfd_get_section_contents (sec->owner, sec, insn, in mark_functions_via_relocs()
2740 sec->owner, sec, irela->r_offset, in mark_functions_via_relocs()
2812 caller = find_function (sec, irela->r_offset, info); 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()
2843 if (sec->owner != sym_sec->owner) in mark_functions_via_relocs()
2883 pasted_function (asection *sec) in pasted_function() argument
2895 fake->st_size = sec->size; in pasted_function()
2897 = _bfd_elf_section_from_bfd_section (sec->owner, sec); in pasted_function()
2898 fun = maybe_insert_function (sec, fake, FALSE, FALSE); in pasted_function()
2904 for (l = sec->output_section->map_head.link_order; l != NULL; l = l->next) in pasted_function()
2906 if (l->u.indirect.section == sec) in pasted_function()
2967 asection *sec; in discover_functions() local
2981 for (sec = ibfd->sections; sec != NULL && !gaps; sec = sec->next) in discover_functions()
2982 if (interesting_section (sec)) in discover_functions()
3060 for (sec = ibfd->sections; sec != NULL && !gaps; sec = sec->next) in discover_functions()
3061 if (interesting_section (sec)) in discover_functions()
3062 gaps |= check_function_ranges (sec, info); in discover_functions()
3073 asection *sec; in discover_functions() local
3078 for (sec = ibfd->sections; sec != NULL; sec = sec->next) in discover_functions()
3079 if (!mark_functions_via_relocs (sec, info, FALSE)) in discover_functions()
3088 asection *sec; in discover_functions() local
3101 for (sec = ibfd->sections; sec != NULL && !gaps; sec = sec->next) in discover_functions()
3102 if (interesting_section (sec)) in discover_functions()
3103 gaps |= check_function_ranges (sec, info); in discover_functions()
3127 asection *sec; in discover_functions() local
3136 for (sec = ibfd->sections; sec != NULL; sec = sec->next) in discover_functions()
3137 if (interesting_section (sec)) in discover_functions()
3142 sec_data = spu_elf_section_data (sec); in discover_functions()
3147 bfd_vma hi = sec->size; in discover_functions()
3159 else if (!pasted_function (sec)) in discover_functions()
3199 asection *sec; in for_each_node() local
3204 for (sec = ibfd->sections; sec != NULL; sec = sec->next) in for_each_node()
3209 if ((sec_data = spu_elf_section_data (sec)) != NULL in for_each_node()
3348 asection *sec; in build_call_tree() local
3353 for (sec = ibfd->sections; sec != NULL; sec = sec->next) in build_call_tree()
3354 if (!mark_functions_via_relocs (sec, info, TRUE)) in build_call_tree()
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()
3551 BFD_ASSERT (!fun->sec->segment_mark); in mark_overlay_section()
3552 fun->sec->segment_mark = 1; 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()
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()
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()
3655 *lib_param->lib_sections++ = fun->sec; in collect_lib_sections()
3656 fun->sec->gc_mark = 0; in collect_lib_sections()
3725 asection *sec; in auto_ovl_lib_functions() local
3730 for (sec = ibfd->sections; sec != NULL; sec = sec->next) in auto_ovl_lib_functions()
3731 if (sec->linker_mark in auto_ovl_lib_functions()
3732 && sec->size < lib_size in auto_ovl_lib_functions()
3733 && (sec->flags & SEC_CODE) != 0) in auto_ovl_lib_functions()
3754 asection *sec; in auto_ovl_lib_functions() local
3758 sec = lib_sections[2 * i]; in auto_ovl_lib_functions()
3760 tmp = sec->size; in auto_ovl_lib_functions()
3767 && (sec_data = spu_elf_section_data (sec)) != NULL in auto_ovl_lib_functions()
3775 if (call->fun->sec->linker_mark) in auto_ovl_lib_functions()
3798 if (!p->fun->sec->linker_mark) in auto_ovl_lib_functions()
3807 if ((sec_data = spu_elf_section_data (sec)) != NULL in auto_ovl_lib_functions()
3817 if (call->fun->sec->linker_mark) in auto_ovl_lib_functions()
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()
3886 if (fun->sec->segment_mark) in collect_overlays()
3895 call_fun->sec->gc_mark = 0; in collect_overlays()
3903 while (call_fun->sec->segment_mark); in collect_overlays()
3917 if ((sec_data = spu_elf_section_data (fun->sec)) != NULL in collect_overlays()
4027 sprintf (name, "__stack_%x_%s", fun->sec->id & 0xffffffff, f1); in sum_stack()
4056 find_pasted_call (asection *sec) in find_pasted_call() argument
4058 struct _spu_elf_section_data *sec_data = spu_elf_section_data (sec); in find_pasted_call()
4095 asection *sec = ovly_sections[2 * j]; in print_one_overlay_section() local
4098 (sec->owner->my_archive != NULL in print_one_overlay_section()
4099 ? sec->owner->my_archive->filename : ""), in print_one_overlay_section()
4101 sec->owner->filename, in print_one_overlay_section()
4102 sec->name) <= 0) in print_one_overlay_section()
4104 if (sec->segment_mark) in print_one_overlay_section()
4106 struct call_info *call = find_pasted_call (sec); in print_one_overlay_section()
4110 sec = call_fun->sec; in print_one_overlay_section()
4112 (sec->owner->my_archive != NULL in print_one_overlay_section()
4113 ? sec->owner->my_archive->filename : ""), in print_one_overlay_section()
4115 sec->owner->filename, in print_one_overlay_section()
4116 sec->name) <= 0) in print_one_overlay_section()
4127 asection *sec = ovly_sections[2 * j + 1]; in print_one_overlay_section() local
4128 if (sec != NULL in print_one_overlay_section()
4130 (sec->owner->my_archive != NULL in print_one_overlay_section()
4131 ? sec->owner->my_archive->filename : ""), in print_one_overlay_section()
4133 sec->owner->filename, in print_one_overlay_section()
4134 sec->name) <= 0) in print_one_overlay_section()
4137 sec = ovly_sections[2 * j]; in print_one_overlay_section()
4138 if (sec->segment_mark) in print_one_overlay_section()
4140 struct call_info *call = find_pasted_call (sec); in print_one_overlay_section()
4144 sec = call_fun->rodata; in print_one_overlay_section()
4145 if (sec != NULL in print_one_overlay_section()
4147 (sec->owner->my_archive != NULL in print_one_overlay_section()
4148 ? sec->owner->my_archive->filename : ""), in print_one_overlay_section()
4150 sec->owner->filename, in print_one_overlay_section()
4151 sec->name) <= 0) in print_one_overlay_section()
4280 asection *sec; in spu_elf_auto_overlay() local
4287 for (sec = ibfd->sections; sec != NULL; sec = sec->next) in spu_elf_auto_overlay()
4288 if (sec->linker_mark) in spu_elf_auto_overlay()
4290 if ((sec->flags & SEC_CODE) != 0) in spu_elf_auto_overlay()
4292 fixed_size -= sec->size; in spu_elf_auto_overlay()
4293 total_overlay_size += sec->size; in spu_elf_auto_overlay()
4295 else if ((sec->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD) in spu_elf_auto_overlay()
4296 && sec->output_section->owner == info->output_bfd in spu_elf_auto_overlay()
4297 && strncmp (sec->output_section->name, ".ovl.init", 9) == 0) in spu_elf_auto_overlay()
4298 fixed_size -= sec->size; in spu_elf_auto_overlay()
4413 asection *sec, *rosec; in spu_elf_auto_overlay() local
4423 sec = ovly_sections[2 * i]; in spu_elf_auto_overlay()
4424 tmp = align_power (size, sec->alignment_power) + sec->size; in spu_elf_auto_overlay()
4435 if (sec->segment_mark) in spu_elf_auto_overlay()
4439 pasty = find_pasted_call (sec); in spu_elf_auto_overlay()
4443 tmp = (align_power (tmp, call_fun->sec->alignment_power) in spu_elf_auto_overlay()
4444 + call_fun->sec->size); in spu_elf_auto_overlay()
4464 sec_data = spu_elf_section_data (sec); in spu_elf_auto_overlay()
4473 else if (call->fun->sec->linker_mark) in spu_elf_auto_overlay()
4505 if (call->fun->sec == ovly_sections[2 * k]) in spu_elf_auto_overlay()
4728 spu_elf_count_relocs (struct bfd_link_info *info, asection *sec) in spu_elf_count_relocs() argument
4733 relocs = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, in spu_elf_count_relocs()
4738 Elf_Internal_Rela *relend = relocs + sec->reloc_count; in spu_elf_count_relocs()
4747 if (elf_section_data (sec)->relocs != relocs) in spu_elf_count_relocs()
4835 asection *sec; in spu_elf_relocate_section() local
4850 sec = NULL; in spu_elf_relocate_section()
4854 sec = local_sections[r_symndx]; in spu_elf_relocate_section()
4855 sym_name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec); in spu_elf_relocate_section()
4856 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); in spu_elf_relocate_section()
4878 sec = h->root.u.def.section; in spu_elf_relocate_section()
4879 if (sec == NULL in spu_elf_relocate_section()
4880 || sec->output_section == NULL) in spu_elf_relocate_section()
4888 + sec->output_section->vma in spu_elf_relocate_section()
4889 + sec->output_offset); in spu_elf_relocate_section()
4912 if (sec != NULL && discarded_section (sec)) in spu_elf_relocate_section()
4931 && sec != NULL in spu_elf_relocate_section()
4932 && sec->output_section == ea); in spu_elf_relocate_section()
4939 && (stub_type = needs_ovl_stub (h, sym, sec, input_section, rel, in spu_elf_relocate_section()
4975 unsigned int ovl = overlay_index (sec); in spu_elf_relocate_section()
5185 asection *sec; in spu_elf_additional_program_headers() local
5196 sec = bfd_get_section_by_name (abfd, ".toe"); in spu_elf_additional_program_headers()
5197 if (sec != NULL && (sec->flags & SEC_LOAD) != 0) in spu_elf_additional_program_headers()
5297 asection *sec) in spu_elf_fake_sections() argument
5299 if (strcmp (sec->name, SPU_PTNOTE_SPUNAME) == 0) in spu_elf_fake_sections()