Lines Matching refs:sec
757 asection *sec, in elf_xtensa_check_relocs() argument
771 rel_end = relocs + sec->reloc_count; in elf_xtensa_check_relocs()
804 if ((sec->flags & SEC_ALLOC) != 0) in elf_xtensa_check_relocs()
819 if ((sec->flags & SEC_ALLOC) != 0) in elf_xtensa_check_relocs()
844 if ((sec->flags & SEC_ALLOC) != 0) in elf_xtensa_check_relocs()
910 if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) in elf_xtensa_check_relocs()
917 if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) in elf_xtensa_check_relocs()
971 elf_xtensa_gc_mark_hook (asection *sec, in elf_xtensa_gc_mark_hook() argument
1001 return bfd_section_from_elf_index (sec->owner, sym->st_shndx); in elf_xtensa_gc_mark_hook()
1013 asection *sec, in elf_xtensa_gc_sweep_hook() argument
1021 if ((sec->flags & SEC_ALLOC) == 0) in elf_xtensa_gc_sweep_hook()
1028 relend = relocs + sec->reloc_count; in elf_xtensa_gc_sweep_hook()
2044 asection *sec; in elf_xtensa_relocate_section() local
2110 sec = local_sections[r_symndx]; in elf_xtensa_relocate_section()
2111 rel->r_addend += sec->output_offset + sym->st_value; in elf_xtensa_relocate_section()
2148 sec = NULL; in elf_xtensa_relocate_section()
2166 sec = local_sections[r_symndx]; in elf_xtensa_relocate_section()
2167 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); in elf_xtensa_relocate_section()
2173 h, sec, relocation, in elf_xtensa_relocate_section()
2338 name = bfd_section_name (input_bfd, sec); in elf_xtensa_relocate_section()
2864 asection *sec) in elf_xtensa_discard_info_for_section() argument
2871 section_size = sec->size; in elf_xtensa_discard_info_for_section()
2875 if (sec->output_section in elf_xtensa_discard_info_for_section()
2876 && bfd_is_abs_section (sec->output_section)) in elf_xtensa_discard_info_for_section()
2879 contents = retrieve_contents (abfd, sec, info->keep_memory); in elf_xtensa_discard_info_for_section()
2883 cookie->rels = retrieve_internal_relocs (abfd, sec, info->keep_memory); in elf_xtensa_discard_info_for_section()
2886 release_contents (sec, contents); in elf_xtensa_discard_info_for_section()
2891 cookie->relend = cookie->rels + sec->reloc_count; in elf_xtensa_discard_info_for_section()
2956 pin_contents (sec, contents); in elf_xtensa_discard_info_for_section()
2957 pin_internal_relocs (sec, cookie->rels); in elf_xtensa_discard_info_for_section()
2960 sec->size = section_size - removed_bytes; in elf_xtensa_discard_info_for_section()
2962 if (xtensa_is_littable_section (sec)) in elf_xtensa_discard_info_for_section()
2976 release_contents (sec, contents); in elf_xtensa_discard_info_for_section()
2977 release_internal_relocs (sec, cookie->rels); in elf_xtensa_discard_info_for_section()
2989 asection *sec; in elf_xtensa_discard_info() local
2992 for (sec = abfd->sections; sec != NULL; sec = sec->next) in elf_xtensa_discard_info()
2994 if (xtensa_is_property_section (sec)) in elf_xtensa_discard_info()
2996 if (elf_xtensa_discard_info_for_section (abfd, cookie, info, sec)) in elf_xtensa_discard_info()
3006 elf_xtensa_ignore_discarded_relocs (asection *sec) in elf_xtensa_ignore_discarded_relocs() argument
3008 return xtensa_is_property_section (sec); in elf_xtensa_ignore_discarded_relocs()
3244 asection *sec, in get_relocation_opcode() argument
3257 if (bfd_get_section_limit (abfd, sec) <= irel->r_offset) in get_relocation_opcode()
3268 sec->size - irel->r_offset); in get_relocation_opcode()
3280 asection *sec, in is_l32r_relocation() argument
3287 opcode = get_relocation_opcode (abfd, sec, contents, irel); in is_l32r_relocation()
4132 asection *sec; in r_reloc_is_defined() local
4136 sec = r_reloc_get_section (r_rel); in r_reloc_is_defined()
4137 if (sec == bfd_abs_section_ptr in r_reloc_is_defined()
4138 || sec == bfd_com_section_ptr in r_reloc_is_defined()
4139 || sec == bfd_und_section_ptr) in r_reloc_is_defined()
4184 asection *sec = r_reloc_get_section (r_rel); in print_r_reloc() local
4185 fprintf (fp, " %s(%s + ", sec->owner->filename, sec->name); in print_r_reloc()
4259 asection *sec, in find_source_reloc() argument
4266 if (src_relocs[i].source_sec == sec in find_source_reloc()
4578 asection *sec; /* Optional */ member
4596 find_fill_action (text_action_list *l, asection *sec, bfd_vma offset) in find_fill_action() argument
4601 if (sec->size == offset) in find_fill_action()
4618 asection *sec, in compute_removed_action_diff() argument
4633 if (sec->size == offset) in compute_removed_action_diff()
4640 added = ((1 << sec->alignment_power) - 1) & added; in compute_removed_action_diff()
4646 - (((1 << sec->alignment_power) - 1) & space)); in compute_removed_action_diff()
4667 asection *sec, in text_action_add() argument
4675 if (action == ta_fill && sec->size == offset) in text_action_add()
4697 ta->sec = sec; in text_action_add()
4714 asection *sec = r_reloc_get_section (loc); in text_action_add_literal() local
4731 ta->sec = sec; in text_action_add_literal()
4851 r->sec->owner->filename, in print_action_list()
4852 r->sec->name, r->offset, t, r->removed_bytes); in print_action_list()
5008 elf_xtensa_new_section_hook (bfd *abfd, asection *sec) in elf_xtensa_new_section_hook() argument
5016 sec->used_by_bfd = (void *) sdata; in elf_xtensa_new_section_hook()
5018 return _bfd_elf_new_section_hook (abfd, sec); in elf_xtensa_new_section_hook()
5023 get_xtensa_relax_info (asection *sec) in get_xtensa_relax_info() argument
5028 if (!sec || sec == sec->output_section) in get_xtensa_relax_info()
5031 section_data = (struct elf_xtensa_section_data *) elf_section_data (sec); in get_xtensa_relax_info()
5037 init_xtensa_relax_info (asection *sec) in init_xtensa_relax_info() argument
5039 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec); in init_xtensa_relax_info()
5136 cache_fix_array (asection *sec) in cache_fix_array() argument
5140 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec); in cache_fix_array()
5167 get_bfd_fix (asection *sec, bfd_vma offset, unsigned type) in get_bfd_fix() argument
5169 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec); in get_bfd_fix()
5179 cache_fix_array (sec); in get_bfd_fix()
5195 asection *sec; member
5218 if (sec_cache->sec) in clear_section_cache()
5220 release_contents (sec_cache->sec, sec_cache->contents); in clear_section_cache()
5221 release_internal_relocs (sec_cache->sec, sec_cache->relocs); in clear_section_cache()
5231 asection *sec, in section_cache_section() argument
5241 if (sec == NULL) in section_cache_section()
5243 if (sec == sec_cache->sec) in section_cache_section()
5246 abfd = sec->owner; in section_cache_section()
5247 sec_size = bfd_get_section_limit (abfd, sec); in section_cache_section()
5250 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in section_cache_section()
5255 internal_relocs = retrieve_internal_relocs (abfd, sec, in section_cache_section()
5259 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table, in section_cache_section()
5268 sec_cache->sec = sec; in section_cache_section()
5272 sec_cache->reloc_count = sec->reloc_count; in section_cache_section()
5279 release_contents (sec, contents); in section_cache_section()
5280 release_internal_relocs (sec, internal_relocs); in section_cache_section()
5302 asection *sec; member
5408 asection *sec, in init_ebb() argument
5417 ebb->sec = sec; in init_ebb()
5471 entry_end = the_entry->address - ebb->sec->vma + the_entry->size; in extend_ebb_bounds_forward()
5480 ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len); in extend_ebb_bounds_forward()
5485 if (ebb->end_offset == ebb->sec->size) in extend_ebb_bounds_forward()
5547 block_begin = the_entry->address - ebb->sec->vma; in extend_ebb_bounds_backward()
5556 ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len); in extend_ebb_bounds_backward()
5658 retrieve_internal_relocs (bfd *abfd, asection *sec, bfd_boolean keep_memory) in retrieve_internal_relocs() argument
5662 if ((sec->flags & SEC_LINKER_CREATED) != 0) in retrieve_internal_relocs()
5665 internal_relocs = elf_section_data (sec)->relocs; in retrieve_internal_relocs()
5668 (abfd, sec, NULL, NULL, keep_memory)); in retrieve_internal_relocs()
5674 pin_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs) in pin_internal_relocs() argument
5676 elf_section_data (sec)->relocs = internal_relocs; in pin_internal_relocs()
5681 release_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs) in release_internal_relocs() argument
5684 && elf_section_data (sec)->relocs != internal_relocs) in release_internal_relocs()
5690 retrieve_contents (bfd *abfd, asection *sec, bfd_boolean keep_memory) in retrieve_contents() argument
5695 sec_size = bfd_get_section_limit (abfd, sec); in retrieve_contents()
5696 contents = elf_section_data (sec)->this_hdr.contents; in retrieve_contents()
5700 if (!bfd_malloc_and_get_section (abfd, sec, &contents)) in retrieve_contents()
5707 elf_section_data (sec)->this_hdr.contents = contents; in retrieve_contents()
5714 pin_contents (asection *sec, bfd_byte *contents) in pin_contents() argument
5716 elf_section_data (sec)->this_hdr.contents = contents; in pin_contents()
5721 release_contents (asection *sec, bfd_byte *contents) in release_contents() argument
5723 if (contents && elf_section_data (sec)->this_hdr.contents != contents) in release_contents()
5817 asection *sec, in elf_xtensa_relax_section() argument
5839 if ((sec->flags & SEC_LINKER_CREATED) != 0) in elf_xtensa_relax_section()
5842 relax_info = get_xtensa_relax_info (sec); in elf_xtensa_relax_section()
5851 if (!compute_removed_literals (abfd, sec, link_info, values)) in elf_xtensa_relax_section()
5860 if (!relax_section (abfd, sec, link_info)) in elf_xtensa_relax_section()
5866 if (!relax_section_symbols (abfd, sec)) in elf_xtensa_relax_section()
5894 asection *sec; in analyze_relocations() local
5899 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
5901 init_xtensa_relax_info (sec); in analyze_relocations()
5906 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
5908 if (!find_relaxable_sections (abfd, sec, link_info, &is_relaxable)) in analyze_relocations()
5918 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
5922 relax_info = get_xtensa_relax_info (sec); in analyze_relocations()
5933 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
5935 if (!collect_source_relocs (abfd, sec, link_info)) in analyze_relocations()
5941 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
5943 if (!compute_text_actions (abfd, sec, link_info)) in analyze_relocations()
5963 asection *sec, in find_relaxable_sections() argument
5973 internal_relocs = retrieve_internal_relocs (abfd, sec, in find_relaxable_sections()
5978 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in find_relaxable_sections()
5979 if (contents == NULL && sec->size != 0) in find_relaxable_sections()
5985 source_relax_info = get_xtensa_relax_info (sec); in find_relaxable_sections()
5986 for (i = 0; i < sec->reloc_count; i++) in find_relaxable_sections()
6002 if (is_resolvable_asm_expansion (abfd, sec, contents, irel, in find_relaxable_sections()
6012 bfd_get_section_limit (abfd, sec)); in find_relaxable_sections()
6024 || is_l32r_relocation (abfd, sec, contents, irel))) in find_relaxable_sections()
6027 if (is_l32r_relocation (abfd, sec, contents, irel) in find_relaxable_sections()
6037 release_contents (sec, contents); in find_relaxable_sections()
6038 release_internal_relocs (sec, internal_relocs); in find_relaxable_sections()
6049 asection *sec, in collect_source_relocs() argument
6058 internal_relocs = retrieve_internal_relocs (abfd, sec, in collect_source_relocs()
6063 sec_size = bfd_get_section_limit (abfd, sec); in collect_source_relocs()
6064 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in collect_source_relocs()
6072 for (i = 0; i < sec->reloc_count; i++) in collect_source_relocs()
6098 opcode = get_relocation_opcode (abfd, sec, contents, irel); in collect_source_relocs()
6109 opcode = get_relocation_opcode (abfd, sec, contents, irel); in collect_source_relocs()
6118 init_source_reloc (s_reloc, sec, &r_rel, opcode, opnd, in collect_source_relocs()
6130 for (i = 0; i < sec->reloc_count; i++) in collect_source_relocs()
6135 if (!is_resolvable_asm_expansion (abfd, sec, contents, irel, link_info, in collect_source_relocs()
6149 l32r_irel = find_associated_l32r_irel (abfd, sec, contents, in collect_source_relocs()
6171 sec, l32r_irel); in collect_source_relocs()
6181 pin_internal_relocs (sec, internal_relocs); in collect_source_relocs()
6189 pin_internal_relocs (sec, internal_relocs); in collect_source_relocs()
6194 release_contents (sec, contents); in collect_source_relocs()
6195 release_internal_relocs (sec, internal_relocs); in collect_source_relocs()
6208 asection *sec, in is_resolvable_asm_expansion() argument
6231 sec_size = bfd_get_section_limit (abfd, sec); in is_resolvable_asm_expansion()
6261 && (target_sec->output_section != sec->output_section in is_resolvable_asm_expansion()
6265 self_address = (sec->output_section->vma in is_resolvable_asm_expansion()
6266 + sec->output_offset + irel->r_offset + 3); in is_resolvable_asm_expansion()
6283 asection *sec, in find_associated_l32r_irel() argument
6290 for (i = 0; i < sec->reloc_count; i++) in find_associated_l32r_irel()
6298 if (is_l32r_relocation (abfd, sec, contents, irel)) in find_associated_l32r_irel()
6308 asection *sec, in build_reloc_opcodes() argument
6314 (xtensa_opcode *) bfd_malloc (sizeof (xtensa_opcode) * sec->reloc_count); in build_reloc_opcodes()
6315 for (i = 0; i < sec->reloc_count; i++) in build_reloc_opcodes()
6318 reloc_opcodes[i] = get_relocation_opcode (abfd, sec, contents, irel); in build_reloc_opcodes()
6337 asection *sec, in compute_text_actions() argument
6355 relax_info = get_xtensa_relax_info (sec); in compute_text_actions()
6360 internal_relocs = retrieve_internal_relocs (abfd, sec, in compute_text_actions()
6364 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), in compute_text_actions()
6367 sec_size = bfd_get_section_limit (abfd, sec); in compute_text_actions()
6368 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in compute_text_actions()
6375 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table, in compute_text_actions()
6383 for (i = 0; i < sec->reloc_count; i++) in compute_text_actions()
6402 sec->owner, sec, r_offset); in compute_text_actions()
6409 sec->vma + irel->r_offset); in compute_text_actions()
6413 ta_convert_longcall, sec, r_offset, in compute_text_actions()
6437 init_ebb (ebb, sec, contents, sec_size, prop_table, ptblsize, in compute_text_actions()
6438 internal_relocs, sec->reloc_count); in compute_text_actions()
6448 reloc_opcodes = build_reloc_opcodes (abfd, sec, contents, in compute_text_actions()
6454 || !check_section_ebb_pcrels_fit (abfd, sec, contents, in compute_text_actions()
6464 ta_convert_longcall, sec, r_offset, 0); in compute_text_actions()
6470 text_action_add_proposed (&relax_info->action_list, &ebb_table, sec); in compute_text_actions()
6484 release_contents (sec, contents); in compute_text_actions()
6485 release_internal_relocs (sec, internal_relocs); in compute_text_actions()
6512 start_offset = entry->address - ebb->sec->vma; in compute_ebb_proposed_actions()
6513 end_offset = entry->address + entry->size - ebb->sec->vma; in compute_ebb_proposed_actions()
6521 if (offset == entry->address - ebb->sec->vma in compute_ebb_proposed_actions()
6537 ebb->sec->owner, ebb->sec, offset); in compute_ebb_proposed_actions()
6573 ebb->sec->owner, ebb->sec, offset); in compute_ebb_proposed_actions()
6591 ebb->sec->owner, ebb->sec, offset); in compute_ebb_proposed_actions()
6686 int align = (1 << ebb_table->ebb.sec->alignment_power); in compute_ebb_actions()
6832 && ebb_table->ebb.sec->alignment_power == 2) in compute_ebb_actions()
6842 && ebb_table->ebb.sec->alignment_power == 2) in compute_ebb_actions()
6872 if ((removed_bytes % (1 << ebb_table->ebb.sec->alignment_power)) != 0 in compute_ebb_actions()
6886 br = br & ((1 << ebb->sec->alignment_power ) - 1); in compute_ebb_actions()
6962 build_xlate_map (asection *sec, xtensa_relax_info *relax_info) in build_xlate_map() argument
7027 current_entry->size = (bfd_get_section_limit (sec->owner, sec) in build_xlate_map()
7054 asection *sec, in check_section_ebb_pcrels_fit() argument
7066 relax_info = get_xtensa_relax_info (sec); in check_section_ebb_pcrels_fit()
7068 if (relax_info && sec->reloc_count > 100) in check_section_ebb_pcrels_fit()
7070 xmap = build_xlate_map (sec, relax_info); in check_section_ebb_pcrels_fit()
7075 for (i = 0; i < sec->reloc_count; i++) in check_section_ebb_pcrels_fit()
7097 bfd_get_section_limit (abfd, sec)); in check_section_ebb_pcrels_fit()
7099 if (r_reloc_get_section (&r_rel) != sec) in check_section_ebb_pcrels_fit()
7152 opcode = get_relocation_opcode (abfd, sec, contents, irel); in check_section_ebb_pcrels_fit()
7203 asection *sec) in text_action_add_proposed() argument
7222 text_action_add (l, action->action, sec, action->offset, in text_action_add_proposed()
7271 asection *sec, in compute_removed_literals() argument
7291 relax_info = get_xtensa_relax_info (sec); in compute_removed_literals()
7296 internal_relocs = retrieve_internal_relocs (abfd, sec, in compute_removed_literals()
7299 sec_size = bfd_get_section_limit (abfd, sec); in compute_removed_literals()
7300 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in compute_removed_literals()
7311 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), in compute_removed_literals()
7314 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table, in compute_removed_literals()
7330 irel = get_irel_at_offset (sec, internal_relocs, in compute_removed_literals()
7357 if (!remove_dead_literal (abfd, sec, link_info, internal_relocs, in compute_removed_literals()
7367 if (!identify_literal_placement (abfd, sec, contents, link_info, in compute_removed_literals()
7389 release_contents (sec, contents); in compute_removed_literals()
7390 release_internal_relocs (sec, internal_relocs); in compute_removed_literals()
7396 get_irel_at_offset (asection *sec, in get_irel_at_offset() argument
7409 irel = bsearch (&key, internal_relocs, sec->reloc_count, in get_irel_at_offset()
7423 for ( ; i < sec->reloc_count; i++) in get_irel_at_offset()
7463 asection *sec, in remove_dead_literal() argument
7474 relax_info = get_xtensa_relax_info (sec); in remove_dead_literal()
7479 sec->vma + rel->r_rel.target_offset); in remove_dead_literal()
7485 ta_remove_literal, sec, rel->r_rel.target_offset, 4); in remove_dead_literal()
7488 if (sec->alignment_power > 2) in remove_dead_literal()
7497 entry_sec_offset = entry->address - sec->vma + entry->size; in remove_dead_literal()
7507 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset); in remove_dead_literal()
7508 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset, in remove_dead_literal()
7514 ta_fill, sec, entry_sec_offset, removed_diff); in remove_dead_literal()
7521 shrink_dynamic_reloc_sections (link_info, abfd, sec, irel); in remove_dead_literal()
7524 pin_internal_relocs (sec, internal_relocs); in remove_dead_literal()
7534 asection *sec, in identify_literal_placement() argument
7556 relax_info = get_xtensa_relax_info (sec); in identify_literal_placement()
7560 sec_size = bfd_get_section_limit (abfd, sec); in identify_literal_placement()
7591 == sec->output_section) in identify_literal_placement()
7593 && coalesce_shared_literal (sec, rel, prop_table, ptblsize, val_map)) in identify_literal_placement()
7606 if (target_sec && target_sec->output_section == sec->output_section) in identify_literal_placement()
7614 && move_shared_literal (sec, link_info, rel, in identify_literal_placement()
7662 asection *sec; in relocations_reach() local
7668 sec = r_reloc_get_section (r_rel); in relocations_reach()
7683 != sec->output_section) in relocations_reach()
7698 dest_address = (sec->output_section->vma in relocations_reach()
7699 + sec->output_offset in relocations_reach()
7716 coalesce_shared_literal (asection *sec, in coalesce_shared_literal() argument
7728 relax_info = get_xtensa_relax_info (sec); in coalesce_shared_literal()
7733 (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset); in coalesce_shared_literal()
7741 ta_remove_literal, sec, rel->r_rel.target_offset, 4); in coalesce_shared_literal()
7744 if (sec->alignment_power > 2) in coalesce_shared_literal()
7750 entry_sec_offset = entry->address - sec->vma + entry->size; in coalesce_shared_literal()
7762 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset); in coalesce_shared_literal()
7763 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset, in coalesce_shared_literal()
7769 ta_fill, sec, entry_sec_offset, removed_diff); in coalesce_shared_literal()
7781 move_shared_literal (asection *sec, in move_shared_literal() argument
7804 relax_info = get_xtensa_relax_info (sec); in move_shared_literal()
7817 (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset); in move_shared_literal()
7834 init_ebb (ebb, target_sec_cache->sec, target_sec_cache->contents, in move_shared_literal()
7893 ta_remove_literal, sec, rel->r_rel.target_offset, 4); in move_shared_literal()
7896 if (sec->alignment_power > 2 && target_entry != src_entry) in move_shared_literal()
7902 entry_sec_offset = src_entry->address - sec->vma + src_entry->size; in move_shared_literal()
7914 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset); in move_shared_literal()
7915 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset, in move_shared_literal()
7921 ta_fill, sec, entry_sec_offset, removed_diff); in move_shared_literal()
7935 relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) in relax_section() argument
7946 sec_size = bfd_get_section_limit (abfd, sec); in relax_section()
7947 relax_info = get_xtensa_relax_info (sec); in relax_section()
7951 translate_section_fixes (sec); in relax_section()
7954 if (xtensa_is_property_section (sec)) in relax_section()
7957 return relax_property_section (abfd, sec, link_info); in relax_section()
7960 internal_relocs = retrieve_internal_relocs (abfd, sec, in relax_section()
7962 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in relax_section()
7971 for (i = 0; i < sec->reloc_count; i++) in relax_section()
7992 bfd_get_section_limit (abfd, sec)); in relax_section()
8006 shrink_dynamic_reloc_sections (link_info, abfd, sec, irel); in relax_section()
8010 pin_internal_relocs (sec, internal_relocs); in relax_section()
8030 (link_info, error_message, abfd, sec, in relax_section()
8073 if (bfd_get_section_limit (abfd, sec) < old_source_offset) in relax_section()
8077 abfd, sec, old_source_offset); in relax_section()
8126 abfd, sec, old_source_offset); in relax_section()
8130 pin_contents (sec, contents); in relax_section()
8140 fix = reloc_bfd_fix_init (sec, source_offset, r_type, 0, in relax_section()
8143 add_fix (sec, fix); in relax_section()
8146 pin_internal_relocs (sec, internal_relocs); in relax_section()
8158 bfd_size_type size = sec->size; in relax_section()
8172 final_size = sec->size; in relax_section()
8297 pin_internal_relocs (sec, internal_relocs); in relax_section()
8298 pin_contents (sec, contents); in relax_section()
8300 if (!move_literal (abfd, link_info, sec, dup_dot, dup_contents, in relax_section()
8343 sec->contents = dup_contents; in relax_section()
8346 pin_contents (sec, contents); in relax_section()
8356 pin_contents (sec, contents); in relax_section()
8358 sec->size = final_size; in relax_section()
8362 release_internal_relocs (sec, internal_relocs); in relax_section()
8363 release_contents (sec, contents); in relax_section()
8369 translate_section_fixes (asection *sec) in translate_section_fixes() argument
8374 relax_info = get_xtensa_relax_info (sec); in translate_section_fixes()
8393 asection *sec; in translate_reloc_bfd_fix() local
8401 sec = fix->target_sec; in translate_reloc_bfd_fix()
8404 relax_info = get_xtensa_relax_info (sec); in translate_reloc_bfd_fix()
8445 if (new_sec != sec) in translate_reloc_bfd_fix()
8447 sec = new_sec; in translate_reloc_bfd_fix()
8448 relax_info = get_xtensa_relax_info (sec); in translate_reloc_bfd_fix()
8482 asection *sec; in translate_reloc() local
8491 sec = r_reloc_get_section (orig_rel); in translate_reloc()
8493 relax_info = get_xtensa_relax_info (sec); in translate_reloc()
8522 if (new_sec != sec) in translate_reloc()
8524 sec = new_sec; in translate_reloc()
8525 relax_info = get_xtensa_relax_info (sec); in translate_reloc()
8660 asection *sec, in move_literal() argument
8673 BFD_ASSERT (elf_section_data (sec)->relocs == *internal_relocs_p); in move_literal()
8697 fix = reloc_bfd_fix_init (sec, offset, r_type, r_rel->abfd, in move_literal()
8702 sec->flags |= SEC_RELOC; in move_literal()
8706 add_fix (sec, fix); in move_literal()
8711 insert_at = sec->reloc_count; in move_literal()
8712 for (i = 0; i < sec->reloc_count; ++i) in move_literal()
8722 || sec->reloc_count + 1 > relax_info->allocated_relocs_count) in move_literal()
8725 || sec->reloc_count == relax_info->relocs_count); in move_literal()
8728 new_relocs_count = (sec->reloc_count + 2) * 2; in move_literal()
8744 if (insert_at != sec->reloc_count) in move_literal()
8747 (sec->reloc_count - insert_at) in move_literal()
8762 elf_section_data (sec)->relocs = new_relocs; in move_literal()
8763 sec->reloc_count++; in move_literal()
8764 relax_info->relocs_count = sec->reloc_count; in move_literal()
8769 if (insert_at != sec->reloc_count) in move_literal()
8772 for (idx = sec->reloc_count; idx > insert_at; idx--) in move_literal()
8776 sec->reloc_count++; in move_literal()
8778 relax_info->relocs_count = sec->reloc_count; in move_literal()
8792 asection *sec, in relax_property_section() argument
8804 sec_size = bfd_get_section_limit (abfd, sec); in relax_property_section()
8805 internal_relocs = retrieve_internal_relocs (abfd, sec, in relax_property_section()
8807 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in relax_property_section()
8815 ((strcmp (sec->name, XTENSA_PROP_SEC_NAME) == 0) in relax_property_section()
8816 || (strncmp (sec->name, ".gnu.linkonce.prop.", in relax_property_section()
8821 for (i = 0; i < sec->reloc_count; i++) in relax_property_section()
8917 pin_contents (sec, contents); in relax_property_section()
8924 pin_internal_relocs (sec, internal_relocs); in relax_property_section()
8935 || strcmp (sec->name, XTENSA_LIT_SEC_NAME) == 0)) in relax_property_section()
8949 predef_flags = xtensa_get_property_predef_flags (sec); in relax_property_section()
8953 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), in relax_property_section()
8957 pin_internal_relocs (sec, internal_relocs); in relax_property_section()
8958 pin_contents (sec, contents); in relax_property_section()
8961 section_size = sec->size; in relax_property_section()
8981 for (i = nexti; i < sec->reloc_count; i++) in relax_property_section()
8991 for (nexti = i + 1; nexti < sec->reloc_count; nexti++) in relax_property_section()
9113 sec->size = section_size - removed_bytes; in relax_property_section()
9115 if (xtensa_is_littable_section (sec)) in relax_property_section()
9130 release_internal_relocs (sec, internal_relocs); in relax_property_section()
9131 release_contents (sec, contents); in relax_property_section()
9141 relax_section_symbols (bfd *abfd, asection *sec) in relax_section_symbols() argument
9149 relax_info = get_xtensa_relax_info (sec); in relax_section_symbols()
9156 sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); in relax_section_symbols()
9199 && sym_hash->root.u.def.section == sec) in relax_section_symbols()
9231 asection *sec, *old_sec; in do_fix_for_relocatable_link() local
9262 sec = fix->target_sec; in do_fix_for_relocatable_link()
9263 rel->r_addend += ((sec->output_offset + fix->target_offset) in do_fix_for_relocatable_link()
9277 asection *sec; in do_fix_for_final_link() local
9289 sec = fix->target_sec; in do_fix_for_final_link()
9301 *relocationp = (sec->output_section->vma in do_fix_for_final_link()
9302 + sec->output_offset in do_fix_for_final_link()
9484 xtensa_is_property_section (asection *sec) in xtensa_is_property_section() argument
9486 if (strncmp (XTENSA_INSN_SEC_NAME, sec->name, insn_sec_len) == 0 in xtensa_is_property_section()
9487 || strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0 in xtensa_is_property_section()
9488 || strncmp (XTENSA_PROP_SEC_NAME, sec->name, prop_sec_len) == 0) in xtensa_is_property_section()
9491 if (strncmp (".gnu.linkonce.", sec->name, linkonce_len) == 0 in xtensa_is_property_section()
9492 && (strncmp (&sec->name[linkonce_len], "x.", 2) == 0 in xtensa_is_property_section()
9493 || strncmp (&sec->name[linkonce_len], "p.", 2) == 0 in xtensa_is_property_section()
9494 || strncmp (&sec->name[linkonce_len], "prop.", 5) == 0)) in xtensa_is_property_section()
9502 xtensa_is_littable_section (asection *sec) in xtensa_is_littable_section() argument
9504 if (strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0) in xtensa_is_littable_section()
9507 if (strncmp (".gnu.linkonce.", sec->name, linkonce_len) == 0 in xtensa_is_littable_section()
9508 && sec->name[linkonce_len] == 'p' in xtensa_is_littable_section()
9509 && sec->name[linkonce_len + 1] == '.') in xtensa_is_littable_section()
9552 xtensa_get_property_section_name (asection *sec, const char *base_name) in xtensa_get_property_section_name() argument
9554 if (strncmp (sec->name, ".gnu.linkonce.", linkonce_len) == 0) in xtensa_get_property_section_name()
9569 prop_sec_name = (char *) bfd_malloc (strlen (sec->name) in xtensa_get_property_section_name()
9574 suffix = sec->name + linkonce_len; in xtensa_get_property_section_name()
9589 xtensa_get_property_predef_flags (asection *sec) in xtensa_get_property_predef_flags() argument
9591 if (strcmp (sec->name, XTENSA_INSN_SEC_NAME) == 0 in xtensa_get_property_predef_flags()
9592 || strncmp (sec->name, ".gnu.linkonce.x.", in xtensa_get_property_predef_flags()
9598 if (xtensa_is_littable_section (sec)) in xtensa_get_property_predef_flags()
9611 asection *sec, in xtensa_callback_required_dependence() argument
9622 sec_size = bfd_get_section_limit (abfd, sec); in xtensa_callback_required_dependence()
9626 if ((sec->flags & SEC_LINKER_CREATED) != 0 in xtensa_callback_required_dependence()
9627 && strncmp (sec->name, ".plt", 4) == 0) in xtensa_callback_required_dependence()
9632 if (sec->name[4] == '\0') in xtensa_callback_required_dependence()
9633 sgotplt = bfd_get_section_by_name (sec->owner, ".got.plt"); in xtensa_callback_required_dependence()
9639 BFD_ASSERT (sec->name[4] == '.'); in xtensa_callback_required_dependence()
9640 chunk = strtol (&sec->name[5], NULL, 10); in xtensa_callback_required_dependence()
9643 sgotplt = bfd_get_section_by_name (sec->owner, got_name); in xtensa_callback_required_dependence()
9650 (*callback) (sec, sec_size, sgotplt, 0, closure); in xtensa_callback_required_dependence()
9653 internal_relocs = retrieve_internal_relocs (abfd, sec, in xtensa_callback_required_dependence()
9656 || sec->reloc_count == 0) in xtensa_callback_required_dependence()
9660 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in xtensa_callback_required_dependence()
9670 for (i = 0; i < sec->reloc_count; i++) in xtensa_callback_required_dependence()
9673 if (is_l32r_relocation (abfd, sec, contents, irel)) in xtensa_callback_required_dependence()
9688 (*callback) (sec, irel->r_offset, target_sec, target_offset, in xtensa_callback_required_dependence()
9694 release_internal_relocs (sec, internal_relocs); in xtensa_callback_required_dependence()
9695 release_contents (sec, contents); in xtensa_callback_required_dependence()