Lines Matching refs:sec

960 			 asection *sec,  in elf_xtensa_check_relocs()  argument
969 if (info->relocatable || (sec->flags & SEC_ALLOC) == 0) in elf_xtensa_check_relocs()
981 rel_end = relocs + sec->reloc_count; in elf_xtensa_check_relocs()
1071 if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) in elf_xtensa_check_relocs()
1080 && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) in elf_xtensa_check_relocs()
1237 elf_xtensa_gc_mark_hook (asection *sec, in elf_xtensa_gc_mark_hook() argument
1253 if (xtensa_is_property_section (sec)) in elf_xtensa_gc_mark_hook()
1264 return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); in elf_xtensa_gc_mark_hook()
1274 asection *sec, in elf_xtensa_gc_sweep_hook() argument
1289 if ((sec->flags & SEC_ALLOC) == 0) in elf_xtensa_gc_sweep_hook()
1295 relend = relocs + sec->reloc_count; in elf_xtensa_gc_sweep_hook()
2592 asection *sec; in elf_xtensa_relocate_section() local
2616 sec = NULL; in elf_xtensa_relocate_section()
2635 sec = local_sections[r_symndx]; in elf_xtensa_relocate_section()
2636 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); in elf_xtensa_relocate_section()
2644 h, sec, relocation, in elf_xtensa_relocate_section()
2655 if (sec != NULL && discarded_section (sec)) in elf_xtensa_relocate_section()
2709 sec = local_sections[r_symndx]; in elf_xtensa_relocate_section()
2710 rel->r_addend += sec->output_offset + sym->st_value; in elf_xtensa_relocate_section()
2786 name = bfd_section_name (input_bfd, sec); in elf_xtensa_relocate_section()
3613 asection *sec) in elf_xtensa_discard_info_for_section() argument
3620 if (sec->output_section in elf_xtensa_discard_info_for_section()
3621 && bfd_is_abs_section (sec->output_section)) in elf_xtensa_discard_info_for_section()
3624 if (xtensa_is_proptable_section (sec)) in elf_xtensa_discard_info_for_section()
3629 if (sec->size == 0 || sec->size % entry_size != 0) in elf_xtensa_discard_info_for_section()
3632 contents = retrieve_contents (abfd, sec, info->keep_memory); in elf_xtensa_discard_info_for_section()
3636 cookie->rels = retrieve_internal_relocs (abfd, sec, info->keep_memory); in elf_xtensa_discard_info_for_section()
3639 release_contents (sec, contents); in elf_xtensa_discard_info_for_section()
3645 qsort (cookie->rels, sec->reloc_count, sizeof (Elf_Internal_Rela), in elf_xtensa_discard_info_for_section()
3649 cookie->relend = cookie->rels + sec->reloc_count; in elf_xtensa_discard_info_for_section()
3651 for (offset = 0; offset < sec->size; offset += entry_size) in elf_xtensa_discard_info_for_section()
3675 if (offset + entry_size < sec->size) in elf_xtensa_discard_info_for_section()
3678 sec->size - offset - entry_size); in elf_xtensa_discard_info_for_section()
3712 memset (&contents[sec->size - removed_bytes], 0, removed_bytes); in elf_xtensa_discard_info_for_section()
3714 pin_contents (sec, contents); in elf_xtensa_discard_info_for_section()
3715 pin_internal_relocs (sec, cookie->rels); in elf_xtensa_discard_info_for_section()
3718 if (sec->rawsize == 0) in elf_xtensa_discard_info_for_section()
3719 sec->rawsize = sec->size; in elf_xtensa_discard_info_for_section()
3720 sec->size -= removed_bytes; in elf_xtensa_discard_info_for_section()
3722 if (xtensa_is_littable_section (sec)) in elf_xtensa_discard_info_for_section()
3731 release_contents (sec, contents); in elf_xtensa_discard_info_for_section()
3732 release_internal_relocs (sec, cookie->rels); in elf_xtensa_discard_info_for_section()
3744 asection *sec; in elf_xtensa_discard_info() local
3747 for (sec = abfd->sections; sec != NULL; sec = sec->next) in elf_xtensa_discard_info()
3749 if (xtensa_is_property_section (sec)) in elf_xtensa_discard_info()
3751 if (elf_xtensa_discard_info_for_section (abfd, cookie, info, sec)) in elf_xtensa_discard_info()
3761 elf_xtensa_ignore_discarded_relocs (asection *sec) in elf_xtensa_ignore_discarded_relocs() argument
3763 return xtensa_is_property_section (sec); in elf_xtensa_ignore_discarded_relocs()
3768 elf_xtensa_action_discarded (asection *sec) in elf_xtensa_action_discarded() argument
3770 if (strcmp (".xt_except_table", sec->name) == 0) in elf_xtensa_action_discarded()
3773 if (strcmp (".xt_except_desc", sec->name) == 0) in elf_xtensa_action_discarded()
3776 return _bfd_elf_default_action_discarded (sec); in elf_xtensa_action_discarded()
4035 asection *sec, in get_relocation_opcode() argument
4048 if (bfd_get_section_limit (abfd, sec) <= irel->r_offset) in get_relocation_opcode()
4059 sec->size - irel->r_offset); in get_relocation_opcode()
4071 asection *sec, in is_l32r_relocation() argument
4078 opcode = get_relocation_opcode (abfd, sec, contents, irel); in is_l32r_relocation()
4964 asection *sec; in r_reloc_is_defined() local
4968 sec = r_reloc_get_section (r_rel); in r_reloc_is_defined()
4969 if (sec == bfd_abs_section_ptr in r_reloc_is_defined()
4970 || sec == bfd_com_section_ptr in r_reloc_is_defined()
4971 || sec == bfd_und_section_ptr) in r_reloc_is_defined()
5016 asection *sec = r_reloc_get_section (r_rel); in print_r_reloc() local
5017 fprintf (fp, " %s(%s + ", sec->owner->filename, sec->name); in print_r_reloc()
5091 asection *sec, in find_source_reloc() argument
5098 if (src_relocs[i].source_sec == sec in find_source_reloc()
5410 asection *sec; /* Optional */ member
5428 find_fill_action (text_action_list *l, asection *sec, bfd_vma offset) in find_fill_action() argument
5433 if (sec->size == offset) in find_fill_action()
5450 asection *sec, in compute_removed_action_diff() argument
5465 if (sec->size == offset) in compute_removed_action_diff()
5472 added = ((1 << sec->alignment_power) - 1) & added; in compute_removed_action_diff()
5478 - (((1 << sec->alignment_power) - 1) & space)); in compute_removed_action_diff()
5499 asection *sec, in text_action_add() argument
5507 if (action == ta_fill && sec->size == offset) in text_action_add()
5537 ta->sec = sec; in text_action_add()
5554 asection *sec = r_reloc_get_section (loc); in text_action_add_literal() local
5571 ta->sec = sec; in text_action_add_literal()
5702 r->sec->owner->filename, in print_action_list()
5703 r->sec->name, (unsigned long) r->offset, t, r->removed_bytes); in print_action_list()
5859 elf_xtensa_new_section_hook (bfd *abfd, asection *sec) in elf_xtensa_new_section_hook() argument
5861 if (!sec->used_by_bfd) in elf_xtensa_new_section_hook()
5869 sec->used_by_bfd = sdata; in elf_xtensa_new_section_hook()
5872 return _bfd_elf_new_section_hook (abfd, sec); in elf_xtensa_new_section_hook()
5877 get_xtensa_relax_info (asection *sec) in get_xtensa_relax_info() argument
5882 if (!sec || sec == sec->output_section) in get_xtensa_relax_info()
5885 section_data = (struct elf_xtensa_section_data *) elf_section_data (sec); in get_xtensa_relax_info()
5891 init_xtensa_relax_info (asection *sec) in init_xtensa_relax_info() argument
5893 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec); in init_xtensa_relax_info()
5987 cache_fix_array (asection *sec) in cache_fix_array() argument
5991 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec); in cache_fix_array()
6018 get_bfd_fix (asection *sec, bfd_vma offset, unsigned type) in get_bfd_fix() argument
6020 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec); in get_bfd_fix()
6030 cache_fix_array (sec); in get_bfd_fix()
6046 asection *sec; member
6069 if (sec_cache->sec) in free_section_cache()
6071 release_contents (sec_cache->sec, sec_cache->contents); in free_section_cache()
6072 release_internal_relocs (sec_cache->sec, sec_cache->relocs); in free_section_cache()
6081 asection *sec, in section_cache_section() argument
6091 if (sec == NULL) in section_cache_section()
6093 if (sec == sec_cache->sec) in section_cache_section()
6096 abfd = sec->owner; in section_cache_section()
6097 sec_size = bfd_get_section_limit (abfd, sec); in section_cache_section()
6100 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in section_cache_section()
6105 internal_relocs = retrieve_internal_relocs (abfd, sec, in section_cache_section()
6109 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table, in section_cache_section()
6118 sec_cache->sec = sec; in section_cache_section()
6122 sec_cache->reloc_count = sec->reloc_count; in section_cache_section()
6129 release_contents (sec, contents); in section_cache_section()
6130 release_internal_relocs (sec, internal_relocs); in section_cache_section()
6152 asection *sec; member
6258 asection *sec, in init_ebb() argument
6267 ebb->sec = sec; in init_ebb()
6321 entry_end = the_entry->address - ebb->sec->vma + the_entry->size; in extend_ebb_bounds_forward()
6330 ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len); in extend_ebb_bounds_forward()
6335 if (ebb->end_offset == ebb->sec->size) in extend_ebb_bounds_forward()
6397 block_begin = the_entry->address - ebb->sec->vma; in extend_ebb_bounds_backward()
6406 ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len); in extend_ebb_bounds_backward()
6508 retrieve_internal_relocs (bfd *abfd, asection *sec, bfd_boolean keep_memory) in retrieve_internal_relocs() argument
6512 if ((sec->flags & SEC_LINKER_CREATED) != 0) in retrieve_internal_relocs()
6515 internal_relocs = elf_section_data (sec)->relocs; in retrieve_internal_relocs()
6518 (abfd, sec, NULL, NULL, keep_memory)); in retrieve_internal_relocs()
6524 pin_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs) in pin_internal_relocs() argument
6526 elf_section_data (sec)->relocs = internal_relocs; in pin_internal_relocs()
6531 release_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs) in release_internal_relocs() argument
6534 && elf_section_data (sec)->relocs != internal_relocs) in release_internal_relocs()
6540 retrieve_contents (bfd *abfd, asection *sec, bfd_boolean keep_memory) in retrieve_contents() argument
6545 sec_size = bfd_get_section_limit (abfd, sec); in retrieve_contents()
6546 contents = elf_section_data (sec)->this_hdr.contents; in retrieve_contents()
6550 if (!bfd_malloc_and_get_section (abfd, sec, &contents)) in retrieve_contents()
6557 elf_section_data (sec)->this_hdr.contents = contents; in retrieve_contents()
6564 pin_contents (asection *sec, bfd_byte *contents) in pin_contents() argument
6566 elf_section_data (sec)->this_hdr.contents = contents; in pin_contents()
6571 release_contents (asection *sec, bfd_byte *contents) in release_contents() argument
6573 if (contents && elf_section_data (sec)->this_hdr.contents != contents) in release_contents()
6668 asection *sec, in elf_xtensa_relax_section() argument
6690 if ((sec->flags & SEC_LINKER_CREATED) != 0) in elf_xtensa_relax_section()
6693 relax_info = get_xtensa_relax_info (sec); in elf_xtensa_relax_section()
6702 if (!compute_removed_literals (abfd, sec, link_info, values)) in elf_xtensa_relax_section()
6711 if (!relax_section (abfd, sec, link_info)) in elf_xtensa_relax_section()
6717 if (!relax_section_symbols (abfd, sec)) in elf_xtensa_relax_section()
6745 asection *sec; in analyze_relocations() local
6750 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
6752 init_xtensa_relax_info (sec); in analyze_relocations()
6757 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
6759 if (!find_relaxable_sections (abfd, sec, link_info, &is_relaxable)) in analyze_relocations()
6769 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
6773 relax_info = get_xtensa_relax_info (sec); in analyze_relocations()
6786 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
6788 if (!collect_source_relocs (abfd, sec, link_info)) in analyze_relocations()
6794 for (sec = abfd->sections; sec != NULL; sec = sec->next) in analyze_relocations()
6796 if (!compute_text_actions (abfd, sec, link_info)) in analyze_relocations()
6816 asection *sec, in find_relaxable_sections() argument
6827 internal_relocs = retrieve_internal_relocs (abfd, sec, in find_relaxable_sections()
6832 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in find_relaxable_sections()
6833 if (contents == NULL && sec->size != 0) in find_relaxable_sections()
6839 source_relax_info = get_xtensa_relax_info (sec); in find_relaxable_sections()
6840 for (i = 0; i < sec->reloc_count; i++) in find_relaxable_sections()
6856 if (is_resolvable_asm_expansion (abfd, sec, contents, irel, in find_relaxable_sections()
6866 bfd_get_section_limit (abfd, sec)); in find_relaxable_sections()
6880 get_relocation_opcode (abfd, sec, contents, irel); in find_relaxable_sections()
6899 release_contents (sec, contents); in find_relaxable_sections()
6900 release_internal_relocs (sec, internal_relocs); in find_relaxable_sections()
6911 asection *sec, in collect_source_relocs() argument
6920 internal_relocs = retrieve_internal_relocs (abfd, sec, in collect_source_relocs()
6925 sec_size = bfd_get_section_limit (abfd, sec); in collect_source_relocs()
6926 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in collect_source_relocs()
6934 for (i = 0; i < sec->reloc_count; i++) in collect_source_relocs()
6960 opcode = get_relocation_opcode (abfd, sec, contents, irel); in collect_source_relocs()
6971 opcode = get_relocation_opcode (abfd, sec, contents, irel); in collect_source_relocs()
6980 init_source_reloc (s_reloc, sec, &r_rel, opcode, opnd, in collect_source_relocs()
6992 for (i = 0; i < sec->reloc_count; i++) in collect_source_relocs()
6997 if (!is_resolvable_asm_expansion (abfd, sec, contents, irel, link_info, in collect_source_relocs()
7011 l32r_irel = find_associated_l32r_irel (abfd, sec, contents, in collect_source_relocs()
7033 sec, l32r_irel); in collect_source_relocs()
7043 pin_internal_relocs (sec, internal_relocs); in collect_source_relocs()
7051 pin_internal_relocs (sec, internal_relocs); in collect_source_relocs()
7056 release_contents (sec, contents); in collect_source_relocs()
7057 release_internal_relocs (sec, internal_relocs); in collect_source_relocs()
7070 asection *sec, in is_resolvable_asm_expansion() argument
7093 sec_size = bfd_get_section_limit (abfd, sec); in is_resolvable_asm_expansion()
7123 && (target_sec->output_section != sec->output_section in is_resolvable_asm_expansion()
7127 if (target_sec->output_section != sec->output_section) in is_resolvable_asm_expansion()
7147 self_address = sec->output_section->vma; in is_resolvable_asm_expansion()
7149 if (sec->output_section->vma > target_sec->output_section->vma) in is_resolvable_asm_expansion()
7150 self_address += sec->output_offset + irel->r_offset + 3; in is_resolvable_asm_expansion()
7159 self_address = (sec->output_section->vma in is_resolvable_asm_expansion()
7160 + sec->output_offset + irel->r_offset + 3); in is_resolvable_asm_expansion()
7178 asection *sec, in find_associated_l32r_irel() argument
7185 for (i = 0; i < sec->reloc_count; i++) in find_associated_l32r_irel()
7193 if (is_l32r_relocation (abfd, sec, contents, irel)) in find_associated_l32r_irel()
7203 asection *sec, in build_reloc_opcodes() argument
7209 (xtensa_opcode *) bfd_malloc (sizeof (xtensa_opcode) * sec->reloc_count); in build_reloc_opcodes()
7210 for (i = 0; i < sec->reloc_count; i++) in build_reloc_opcodes()
7213 reloc_opcodes[i] = get_relocation_opcode (abfd, sec, contents, irel); in build_reloc_opcodes()
7232 asection *sec, in compute_text_actions() argument
7245 relax_info = get_xtensa_relax_info (sec); in compute_text_actions()
7253 internal_relocs = retrieve_internal_relocs (abfd, sec, in compute_text_actions()
7257 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), in compute_text_actions()
7260 sec_size = bfd_get_section_limit (abfd, sec); in compute_text_actions()
7261 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in compute_text_actions()
7268 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table, in compute_text_actions()
7276 for (i = 0; i < sec->reloc_count; i++) in compute_text_actions()
7295 sec->owner, sec, r_offset); in compute_text_actions()
7302 sec->vma + irel->r_offset); in compute_text_actions()
7306 ta_convert_longcall, sec, r_offset, in compute_text_actions()
7330 init_ebb (ebb, sec, contents, sec_size, prop_table, ptblsize, in compute_text_actions()
7331 internal_relocs, sec->reloc_count); in compute_text_actions()
7341 reloc_opcodes = build_reloc_opcodes (abfd, sec, contents, in compute_text_actions()
7347 || !check_section_ebb_pcrels_fit (abfd, sec, contents, in compute_text_actions()
7357 ta_convert_longcall, sec, r_offset, 0); in compute_text_actions()
7363 text_action_add_proposed (&relax_info->action_list, &ebb_table, sec); in compute_text_actions()
7377 release_contents (sec, contents); in compute_text_actions()
7378 release_internal_relocs (sec, internal_relocs); in compute_text_actions()
7433 start_offset = entry->address - ebb->sec->vma; in compute_ebb_proposed_actions()
7434 end_offset = entry->address + entry->size - ebb->sec->vma; in compute_ebb_proposed_actions()
7442 if (offset == entry->address - ebb->sec->vma in compute_ebb_proposed_actions()
7555 ebb->sec->owner, ebb->sec, offset); in compute_ebb_proposed_actions()
7605 int align = (1 << ebb_table->ebb.sec->alignment_power); in compute_ebb_actions()
7751 && ebb_table->ebb.sec->alignment_power == 2) in compute_ebb_actions()
7761 && ebb_table->ebb.sec->alignment_power == 2) in compute_ebb_actions()
7793 if ((removed_bytes % (1 << ebb_table->ebb.sec->alignment_power)) != 0 in compute_ebb_actions()
7807 br = br & ((1 << ebb->sec->alignment_power ) - 1); in compute_ebb_actions()
7878 build_xlate_map (asection *sec, xtensa_relax_info *relax_info) in build_xlate_map() argument
7943 current_entry->size = (bfd_get_section_limit (sec->owner, sec) in build_xlate_map()
7970 asection *sec, in check_section_ebb_pcrels_fit() argument
7982 relax_info = get_xtensa_relax_info (sec); in check_section_ebb_pcrels_fit()
7984 if (relax_info && sec->reloc_count > 100) in check_section_ebb_pcrels_fit()
7986 xmap = build_xlate_map (sec, relax_info); in check_section_ebb_pcrels_fit()
7991 for (i = 0; i < sec->reloc_count; i++) in check_section_ebb_pcrels_fit()
8014 bfd_get_section_limit (abfd, sec)); in check_section_ebb_pcrels_fit()
8016 if (r_reloc_get_section (&r_rel) != sec) in check_section_ebb_pcrels_fit()
8069 opcode = get_relocation_opcode (abfd, sec, contents, irel); in check_section_ebb_pcrels_fit()
8120 asection *sec) in text_action_add_proposed() argument
8139 text_action_add (l, action->action, sec, action->offset, in text_action_add_proposed()
8188 asection *sec, in compute_removed_literals() argument
8208 relax_info = get_xtensa_relax_info (sec); in compute_removed_literals()
8213 internal_relocs = retrieve_internal_relocs (abfd, sec, in compute_removed_literals()
8216 sec_size = bfd_get_section_limit (abfd, sec); in compute_removed_literals()
8217 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in compute_removed_literals()
8228 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), in compute_removed_literals()
8231 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table, in compute_removed_literals()
8247 irel = get_irel_at_offset (sec, internal_relocs, in compute_removed_literals()
8273 sec, prop_table, ptblsize)) in compute_removed_literals()
8275 if (!remove_dead_literal (abfd, sec, link_info, internal_relocs, in compute_removed_literals()
8285 if (!identify_literal_placement (abfd, sec, contents, link_info, in compute_removed_literals()
8308 release_contents (sec, contents); in compute_removed_literals()
8309 release_internal_relocs (sec, internal_relocs); in compute_removed_literals()
8315 get_irel_at_offset (asection *sec, in get_irel_at_offset() argument
8328 irel = bsearch (&key, internal_relocs, sec->reloc_count, in get_irel_at_offset()
8342 for ( ; i < sec->reloc_count; i++) in get_irel_at_offset()
8359 asection *sec, in is_removable_literal() argument
8370 sec->vma + rel->r_rel.target_offset); in is_removable_literal()
8392 asection *sec, in remove_dead_literal() argument
8403 relax_info = get_xtensa_relax_info (sec); in remove_dead_literal()
8408 sec->vma + rel->r_rel.target_offset); in remove_dead_literal()
8414 ta_remove_literal, sec, rel->r_rel.target_offset, 4); in remove_dead_literal()
8417 if (sec->alignment_power > 2) in remove_dead_literal()
8426 entry_sec_offset = entry->address - sec->vma + entry->size; in remove_dead_literal()
8436 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset); in remove_dead_literal()
8437 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset, in remove_dead_literal()
8443 ta_fill, sec, entry_sec_offset, removed_diff); in remove_dead_literal()
8450 shrink_dynamic_reloc_sections (link_info, abfd, sec, irel); in remove_dead_literal()
8453 pin_internal_relocs (sec, internal_relocs); in remove_dead_literal()
8463 asection *sec, in identify_literal_placement() argument
8485 relax_info = get_xtensa_relax_info (sec); in identify_literal_placement()
8489 sec_size = bfd_get_section_limit (abfd, sec); in identify_literal_placement()
8520 == sec->output_section) in identify_literal_placement()
8522 && coalesce_shared_literal (sec, rel, prop_table, ptblsize, val_map)) in identify_literal_placement()
8535 if (target_sec && target_sec->output_section == sec->output_section) in identify_literal_placement()
8543 && move_shared_literal (sec, link_info, rel, in identify_literal_placement()
8591 asection *sec; in relocations_reach() local
8597 sec = r_reloc_get_section (r_rel); in relocations_reach()
8612 != sec->output_section) in relocations_reach()
8627 dest_address = (sec->output_section->vma in relocations_reach()
8628 + sec->output_offset in relocations_reach()
8645 coalesce_shared_literal (asection *sec, in coalesce_shared_literal() argument
8657 relax_info = get_xtensa_relax_info (sec); in coalesce_shared_literal()
8662 (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset); in coalesce_shared_literal()
8670 ta_remove_literal, sec, rel->r_rel.target_offset, 4); in coalesce_shared_literal()
8673 if (sec->alignment_power > 2) in coalesce_shared_literal()
8679 entry_sec_offset = entry->address - sec->vma + entry->size; in coalesce_shared_literal()
8691 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset); in coalesce_shared_literal()
8692 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset, in coalesce_shared_literal()
8698 ta_fill, sec, entry_sec_offset, removed_diff); in coalesce_shared_literal()
8710 move_shared_literal (asection *sec, in move_shared_literal() argument
8733 relax_info = get_xtensa_relax_info (sec); in move_shared_literal()
8746 (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset); in move_shared_literal()
8763 init_ebb (ebb, target_sec_cache->sec, target_sec_cache->contents, in move_shared_literal()
8822 ta_remove_literal, sec, rel->r_rel.target_offset, 4); in move_shared_literal()
8825 if (sec->alignment_power > 2 && target_entry != src_entry) in move_shared_literal()
8831 entry_sec_offset = src_entry->address - sec->vma + src_entry->size; in move_shared_literal()
8843 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset); in move_shared_literal()
8844 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset, in move_shared_literal()
8850 ta_fill, sec, entry_sec_offset, removed_diff); in move_shared_literal()
8864 relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info) in relax_section() argument
8875 sec_size = bfd_get_section_limit (abfd, sec); in relax_section()
8876 relax_info = get_xtensa_relax_info (sec); in relax_section()
8880 translate_section_fixes (sec); in relax_section()
8883 if (xtensa_is_property_section (sec)) in relax_section()
8886 return relax_property_section (abfd, sec, link_info); in relax_section()
8889 internal_relocs = retrieve_internal_relocs (abfd, sec, in relax_section()
8894 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in relax_section()
8903 for (i = 0; i < sec->reloc_count; i++) in relax_section()
8924 bfd_get_section_limit (abfd, sec)); in relax_section()
8932 pin_internal_relocs (sec, internal_relocs); in relax_section()
8940 shrink_dynamic_reloc_sections (link_info, abfd, sec, irel); in relax_section()
8963 (link_info, error_message, abfd, sec, in relax_section()
8994 if (! elf_xtensa_ignore_discarded_relocs (sec) in relax_section()
8995 && elf_xtensa_action_discarded (sec) == PRETEND in relax_section()
8996 && sec->sec_info_type != SEC_INFO_TYPE_STABS in relax_section()
9052 if (bfd_get_section_limit (abfd, sec) < old_source_offset) in relax_section()
9056 abfd, sec, old_source_offset); in relax_section()
9106 abfd, sec, old_source_offset); in relax_section()
9110 pin_contents (sec, contents); in relax_section()
9121 pin_internal_relocs (sec, internal_relocs); in relax_section()
9130 fix = reloc_bfd_fix_init (sec, source_offset, r_type, in relax_section()
9133 add_fix (sec, fix); in relax_section()
9151 bfd_size_type orig_size = sec->size; in relax_section()
9160 final_size = sec->size; in relax_section()
9285 pin_internal_relocs (sec, internal_relocs); in relax_section()
9286 pin_contents (sec, contents); in relax_section()
9288 if (!move_literal (abfd, link_info, sec, dup_dot, dup_contents, in relax_section()
9330 sec->contents = dup_contents; in relax_section()
9333 pin_contents (sec, contents); in relax_section()
9343 pin_contents (sec, contents); in relax_section()
9345 if (sec->rawsize == 0) in relax_section()
9346 sec->rawsize = sec->size; in relax_section()
9347 sec->size = final_size; in relax_section()
9351 release_internal_relocs (sec, internal_relocs); in relax_section()
9352 release_contents (sec, contents); in relax_section()
9358 translate_section_fixes (asection *sec) in translate_section_fixes() argument
9363 relax_info = get_xtensa_relax_info (sec); in translate_section_fixes()
9382 asection *sec; in translate_reloc_bfd_fix() local
9390 sec = fix->target_sec; in translate_reloc_bfd_fix()
9393 relax_info = get_xtensa_relax_info (sec); in translate_reloc_bfd_fix()
9434 if (new_sec != sec) in translate_reloc_bfd_fix()
9436 sec = new_sec; in translate_reloc_bfd_fix()
9437 relax_info = get_xtensa_relax_info (sec); in translate_reloc_bfd_fix()
9469 translate_reloc (const r_reloc *orig_rel, r_reloc *new_rel, asection *sec) in translate_reloc() argument
9479 return sec ; in translate_reloc()
9481 relax_info = get_xtensa_relax_info (sec); in translate_reloc()
9507 if (new_sec != sec) in translate_reloc()
9509 sec = new_sec; in translate_reloc()
9510 relax_info = get_xtensa_relax_info (sec); in translate_reloc()
9514 return sec; in translate_reloc()
9544 return sec; in translate_reloc()
9662 asection *sec, in move_literal() argument
9675 BFD_ASSERT (elf_section_data (sec)->relocs == *internal_relocs_p); in move_literal()
9697 fix = reloc_bfd_fix_init (sec, offset, r_type, in move_literal()
9702 sec->flags |= SEC_RELOC; in move_literal()
9706 add_fix (sec, fix); in move_literal()
9711 insert_at = sec->reloc_count; in move_literal()
9712 for (i = 0; i < sec->reloc_count; ++i) in move_literal()
9722 || sec->reloc_count + 1 > relax_info->allocated_relocs_count) in move_literal()
9725 || sec->reloc_count == relax_info->relocs_count); in move_literal()
9728 new_relocs_count = (sec->reloc_count + 2) * 2; in move_literal()
9744 if (insert_at != sec->reloc_count) in move_literal()
9747 (sec->reloc_count - insert_at) in move_literal()
9762 elf_section_data (sec)->relocs = new_relocs; in move_literal()
9763 sec->reloc_count++; in move_literal()
9764 relax_info->relocs_count = sec->reloc_count; in move_literal()
9769 if (insert_at != sec->reloc_count) in move_literal()
9772 for (idx = sec->reloc_count; idx > insert_at; idx--) in move_literal()
9776 sec->reloc_count++; in move_literal()
9778 relax_info->relocs_count = sec->reloc_count; in move_literal()
9792 asection *sec, in relax_property_section() argument
9805 sec_size = bfd_get_section_limit (abfd, sec); in relax_property_section()
9806 internal_relocs = retrieve_internal_relocs (abfd, sec, in relax_property_section()
9808 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in relax_property_section()
9815 is_full_prop_section = xtensa_is_proptable_section (sec); in relax_property_section()
9823 for (i = 0; i < sec->reloc_count; i++) in relax_property_section()
9912 pin_contents (sec, contents); in relax_property_section()
9919 pin_internal_relocs (sec, internal_relocs); in relax_property_section()
9930 || xtensa_is_littable_section (sec))) in relax_property_section()
9938 predef_flags = xtensa_get_property_predef_flags (sec); in relax_property_section()
9942 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela), in relax_property_section()
9945 pin_internal_relocs (sec, internal_relocs); in relax_property_section()
9946 pin_contents (sec, contents); in relax_property_section()
9949 rel_end = internal_relocs + sec->reloc_count; in relax_property_section()
9951 BFD_ASSERT (sec->size % entry_size == 0); in relax_property_section()
9953 for (offset = 0; offset < sec->size; offset += entry_size) in relax_property_section()
10094 if (offset + bytes_to_remove < sec->size) in relax_property_section()
10097 sec->size - offset - bytes_to_remove); in relax_property_section()
10108 memset (&contents[sec->size - removed_bytes], 0, removed_bytes); in relax_property_section()
10110 if (sec->rawsize == 0) in relax_property_section()
10111 sec->rawsize = sec->size; in relax_property_section()
10112 sec->size -= removed_bytes; in relax_property_section()
10114 if (xtensa_is_littable_section (sec)) in relax_property_section()
10124 release_internal_relocs (sec, internal_relocs); in relax_property_section()
10125 release_contents (sec, contents); in relax_property_section()
10135 relax_section_symbols (bfd *abfd, asection *sec) in relax_section_symbols() argument
10143 relax_info = get_xtensa_relax_info (sec); in relax_section_symbols()
10150 sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); in relax_section_symbols()
10188 && sym_hash->root.u.def.section == sec) in relax_section_symbols()
10215 asection *sec, *old_sec; in do_fix_for_relocatable_link() local
10246 sec = fix->target_sec; in do_fix_for_relocatable_link()
10247 rel->r_addend += ((sec->output_offset + fix->target_offset) in do_fix_for_relocatable_link()
10261 asection *sec; in do_fix_for_final_link() local
10273 sec = fix->target_sec; in do_fix_for_final_link()
10285 *relocationp = (sec->output_section->vma in do_fix_for_final_link()
10286 + sec->output_offset in do_fix_for_final_link()
10476 xtensa_is_property_section (asection *sec) in xtensa_is_property_section() argument
10478 if (xtensa_is_insntable_section (sec) in xtensa_is_property_section()
10479 || xtensa_is_littable_section (sec) in xtensa_is_property_section()
10480 || xtensa_is_proptable_section (sec)) in xtensa_is_property_section()
10488 xtensa_is_insntable_section (asection *sec) in xtensa_is_insntable_section() argument
10490 if (CONST_STRNEQ (sec->name, XTENSA_INSN_SEC_NAME) in xtensa_is_insntable_section()
10491 || CONST_STRNEQ (sec->name, ".gnu.linkonce.x.")) in xtensa_is_insntable_section()
10499 xtensa_is_littable_section (asection *sec) in xtensa_is_littable_section() argument
10501 if (CONST_STRNEQ (sec->name, XTENSA_LIT_SEC_NAME) in xtensa_is_littable_section()
10502 || CONST_STRNEQ (sec->name, ".gnu.linkonce.p.")) in xtensa_is_littable_section()
10510 xtensa_is_proptable_section (asection *sec) in xtensa_is_proptable_section() argument
10512 if (CONST_STRNEQ (sec->name, XTENSA_PROP_SEC_NAME) in xtensa_is_proptable_section()
10513 || CONST_STRNEQ (sec->name, ".gnu.linkonce.prop.")) in xtensa_is_proptable_section()
10558 match_section_group (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf) in match_section_group() argument
10561 const char *group_name = elf_group_name (sec); in match_section_group()
10573 xtensa_property_section_name (asection *sec, const char *base_name) in xtensa_property_section_name() argument
10578 group_name = elf_group_name (sec); in xtensa_property_section_name()
10581 suffix = strrchr (sec->name, '.'); in xtensa_property_section_name()
10582 if (suffix == sec->name) in xtensa_property_section_name()
10590 else if (strncmp (sec->name, ".gnu.linkonce.", linkonce_len) == 0) in xtensa_property_section_name()
10603 prop_sec_name = (char *) bfd_malloc (strlen (sec->name) in xtensa_property_section_name()
10608 suffix = sec->name + linkonce_len; in xtensa_property_section_name()
10623 xtensa_get_property_section (asection *sec, const char *base_name) in xtensa_get_property_section() argument
10628 prop_sec_name = xtensa_property_section_name (sec, base_name); in xtensa_get_property_section()
10629 prop_sec = bfd_get_section_by_name_if (sec->owner, prop_sec_name, in xtensa_get_property_section()
10631 (void *) elf_group_name (sec)); in xtensa_get_property_section()
10638 xtensa_make_property_section (asection *sec, const char *base_name) in xtensa_make_property_section() argument
10644 prop_sec_name = xtensa_property_section_name (sec, base_name); in xtensa_make_property_section()
10645 prop_sec = bfd_get_section_by_name_if (sec->owner, prop_sec_name, in xtensa_make_property_section()
10647 (void *) elf_group_name (sec)); in xtensa_make_property_section()
10652 flags |= (bfd_get_section_flags (sec->owner, sec) in xtensa_make_property_section()
10656 (sec->owner, strdup (prop_sec_name), flags); in xtensa_make_property_section()
10660 elf_group_name (prop_sec) = elf_group_name (sec); in xtensa_make_property_section()
10669 xtensa_get_property_predef_flags (asection *sec) in xtensa_get_property_predef_flags() argument
10671 if (xtensa_is_insntable_section (sec)) in xtensa_get_property_predef_flags()
10676 if (xtensa_is_littable_section (sec)) in xtensa_get_property_predef_flags()
10689 asection *sec, in xtensa_callback_required_dependence() argument
10700 sec_size = bfd_get_section_limit (abfd, sec); in xtensa_callback_required_dependence()
10704 if ((sec->flags & SEC_LINKER_CREATED) != 0 in xtensa_callback_required_dependence()
10705 && CONST_STRNEQ (sec->name, ".plt")) in xtensa_callback_required_dependence()
10710 if (sec->name[4] == '\0') in xtensa_callback_required_dependence()
10711 sgotplt = bfd_get_linker_section (sec->owner, ".got.plt"); in xtensa_callback_required_dependence()
10717 BFD_ASSERT (sec->name[4] == '.'); in xtensa_callback_required_dependence()
10718 chunk = strtol (&sec->name[5], NULL, 10); in xtensa_callback_required_dependence()
10721 sgotplt = bfd_get_linker_section (sec->owner, got_name); in xtensa_callback_required_dependence()
10728 (*callback) (sec, sec_size, sgotplt, 0, closure); in xtensa_callback_required_dependence()
10736 internal_relocs = retrieve_internal_relocs (abfd, sec, in xtensa_callback_required_dependence()
10739 || sec->reloc_count == 0) in xtensa_callback_required_dependence()
10743 contents = retrieve_contents (abfd, sec, link_info->keep_memory); in xtensa_callback_required_dependence()
10753 for (i = 0; i < sec->reloc_count; i++) in xtensa_callback_required_dependence()
10756 if (is_l32r_relocation (abfd, sec, contents, irel)) in xtensa_callback_required_dependence()
10771 (*callback) (sec, irel->r_offset, target_sec, target_offset, in xtensa_callback_required_dependence()
10777 release_internal_relocs (sec, internal_relocs); in xtensa_callback_required_dependence()
10778 release_contents (sec, contents); in xtensa_callback_required_dependence()