Lines Matching refs:sec

753 			 asection *sec,
767 rel_end = relocs + sec->reloc_count;
800 if ((sec->flags & SEC_ALLOC) != 0)
815 if ((sec->flags & SEC_ALLOC) != 0)
840 if ((sec->flags & SEC_ALLOC) != 0)
906 if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
913 if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
967 elf_xtensa_gc_mark_hook (asection *sec,
997 return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
1009 asection *sec,
1017 if ((sec->flags & SEC_ALLOC) == 0)
1024 relend = relocs + sec->reloc_count;
2043 asection *sec;
2109 sec = local_sections[r_symndx];
2110 rel->r_addend += sec->output_offset + sym->st_value;
2147 sec = NULL;
2165 sec = local_sections[r_symndx];
2166 relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
2172 h, sec, relocation,
2336 name = bfd_section_name (input_bfd, sec);
2864 asection *sec)
2871 section_size = sec->size;
2875 if (sec->output_section
2876 && bfd_is_abs_section (sec->output_section))
2879 contents = retrieve_contents (abfd, sec, info->keep_memory);
2883 cookie->rels = retrieve_internal_relocs (abfd, sec, info->keep_memory);
2886 release_contents (sec, contents);
2891 cookie->relend = cookie->rels + sec->reloc_count;
2956 pin_contents (sec, contents);
2957 pin_internal_relocs (sec, cookie->rels);
2960 sec->size = section_size - removed_bytes;
2962 if (xtensa_is_littable_section (sec))
2976 release_contents (sec, contents);
2977 release_internal_relocs (sec, cookie->rels);
2989 asection *sec;
2992 for (sec = abfd->sections; sec != NULL; sec = sec->next)
2994 if (xtensa_is_property_section (sec))
2996 if (elf_xtensa_discard_info_for_section (abfd, cookie, info, sec))
3006 elf_xtensa_ignore_discarded_relocs (asection *sec)
3008 return xtensa_is_property_section (sec);
3246 asection *sec,
3259 if (bfd_get_section_limit (abfd, sec) <= irel->r_offset)
3270 sec->size - irel->r_offset);
3282 asection *sec,
3289 opcode = get_relocation_opcode (abfd, sec, contents, irel);
4137 asection *sec;
4141 sec = r_reloc_get_section (r_rel);
4142 if (sec == bfd_abs_section_ptr
4143 || sec == bfd_com_section_ptr
4144 || sec == bfd_und_section_ptr)
4189 asection *sec = r_reloc_get_section (r_rel);
4190 fprintf (fp, " %s(%s + ", sec->owner->filename, sec->name);
4265 asection *sec,
4272 if (src_relocs[i].source_sec == sec
4586 asection *sec; /* Optional */
4604 find_fill_action (text_action_list *l, asection *sec, bfd_vma offset)
4609 if (sec->size == offset)
4626 asection *sec,
4641 if (sec->size == offset)
4648 added = ((1 << sec->alignment_power) - 1) & added;
4654 - (((1 << sec->alignment_power) - 1) & space));
4675 asection *sec,
4683 if (action == ta_fill && sec->size == offset)
4705 ta->sec = sec;
4722 asection *sec = r_reloc_get_section (loc);
4739 ta->sec = sec;
4846 r->sec->owner->filename,
4847 r->sec->name, r->offset, t, r->removed_bytes);
5005 elf_xtensa_new_section_hook (bfd *abfd, asection *sec)
5013 sec->used_by_bfd = (void *) sdata;
5015 return _bfd_elf_new_section_hook (abfd, sec);
5020 get_xtensa_relax_info (asection *sec)
5025 if (!sec || sec == sec->output_section)
5028 section_data = (struct elf_xtensa_section_data *) elf_section_data (sec);
5034 init_xtensa_relax_info (asection *sec)
5036 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec);
5134 cache_fix_array (asection *sec)
5138 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec);
5165 get_bfd_fix (asection *sec, bfd_vma offset, unsigned type)
5167 xtensa_relax_info *relax_info = get_xtensa_relax_info (sec);
5177 cache_fix_array (sec);
5194 asection *sec;
5217 if (sec_cache->sec)
5219 release_contents (sec_cache->sec, sec_cache->contents);
5220 release_internal_relocs (sec_cache->sec, sec_cache->relocs);
5230 asection *sec,
5240 if (sec == NULL)
5242 if (sec == sec_cache->sec)
5245 abfd = sec->owner;
5246 sec_size = bfd_get_section_limit (abfd, sec);
5249 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
5254 internal_relocs = retrieve_internal_relocs (abfd, sec,
5258 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table,
5267 sec_cache->sec = sec;
5271 sec_cache->reloc_count = sec->reloc_count;
5278 release_contents (sec, contents);
5279 release_internal_relocs (sec, internal_relocs);
5302 asection *sec;
5408 asection *sec,
5417 ebb->sec = sec;
5471 entry_end = the_entry->address - ebb->sec->vma + the_entry->size;
5480 ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len);
5485 if (ebb->end_offset == ebb->sec->size)
5547 block_begin = the_entry->address - ebb->sec->vma;
5556 ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len);
5658 retrieve_internal_relocs (bfd *abfd, asection *sec, bfd_boolean keep_memory)
5662 if ((sec->flags & SEC_LINKER_CREATED) != 0)
5665 internal_relocs = elf_section_data (sec)->relocs;
5668 (abfd, sec, NULL, NULL, keep_memory));
5674 pin_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs)
5676 elf_section_data (sec)->relocs = internal_relocs;
5681 release_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs)
5684 && elf_section_data (sec)->relocs != internal_relocs)
5690 retrieve_contents (bfd *abfd, asection *sec, bfd_boolean keep_memory)
5695 sec_size = bfd_get_section_limit (abfd, sec);
5696 contents = elf_section_data (sec)->this_hdr.contents;
5700 if (!bfd_malloc_and_get_section (abfd, sec, &contents))
5707 elf_section_data (sec)->this_hdr.contents = contents;
5714 pin_contents (asection *sec, bfd_byte *contents)
5716 elf_section_data (sec)->this_hdr.contents = contents;
5721 release_contents (asection *sec, bfd_byte *contents)
5723 if (contents && elf_section_data (sec)->this_hdr.contents != contents)
5817 asection *sec,
5839 if ((sec->flags & SEC_LINKER_CREATED) != 0)
5842 relax_info = get_xtensa_relax_info (sec);
5851 if (!compute_removed_literals (abfd, sec, link_info, values))
5860 if (!relax_section (abfd, sec, link_info))
5866 if (!relax_section_symbols (abfd, sec))
5895 asection *sec;
5900 for (sec = abfd->sections; sec != NULL; sec = sec->next)
5902 init_xtensa_relax_info (sec);
5907 for (sec = abfd->sections; sec != NULL; sec = sec->next)
5909 if (!find_relaxable_sections (abfd, sec, link_info, &is_relaxable))
5919 for (sec = abfd->sections; sec != NULL; sec = sec->next)
5923 relax_info = get_xtensa_relax_info (sec);
5934 for (sec = abfd->sections; sec != NULL; sec = sec->next)
5936 if (!collect_source_relocs (abfd, sec, link_info))
5942 for (sec = abfd->sections; sec != NULL; sec = sec->next)
5944 if (!compute_text_actions (abfd, sec, link_info))
5964 asection *sec,
5974 internal_relocs = retrieve_internal_relocs (abfd, sec,
5979 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
5980 if (contents == NULL && sec->size != 0)
5986 source_relax_info = get_xtensa_relax_info (sec);
5987 for (i = 0; i < sec->reloc_count; i++)
6003 if (is_resolvable_asm_expansion (abfd, sec, contents, irel,
6013 bfd_get_section_limit (abfd, sec));
6025 || is_l32r_relocation (abfd, sec, contents, irel)))
6028 if (is_l32r_relocation (abfd, sec, contents, irel)
6038 release_contents (sec, contents);
6039 release_internal_relocs (sec, internal_relocs);
6050 asection *sec,
6059 internal_relocs = retrieve_internal_relocs (abfd, sec,
6064 sec_size = bfd_get_section_limit (abfd, sec);
6065 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
6073 for (i = 0; i < sec->reloc_count; i++)
6099 opcode = get_relocation_opcode (abfd, sec, contents, irel);
6110 opcode = get_relocation_opcode (abfd, sec, contents, irel);
6119 init_source_reloc (s_reloc, sec, &r_rel, opcode, opnd,
6131 for (i = 0; i < sec->reloc_count; i++)
6136 if (!is_resolvable_asm_expansion (abfd, sec, contents, irel, link_info,
6150 l32r_irel = find_associated_l32r_irel (abfd, sec, contents,
6172 sec, l32r_irel);
6182 pin_internal_relocs (sec, internal_relocs);
6190 pin_internal_relocs (sec, internal_relocs);
6195 release_contents (sec, contents);
6196 release_internal_relocs (sec, internal_relocs);
6209 asection *sec,
6232 sec_size = bfd_get_section_limit (abfd, sec);
6262 && (target_sec->output_section != sec->output_section
6266 self_address = (sec->output_section->vma
6267 + sec->output_offset + irel->r_offset + 3);
6284 asection *sec,
6291 for (i = 0; i < sec->reloc_count; i++)
6299 if (is_l32r_relocation (abfd, sec, contents, irel))
6320 asection *sec,
6337 relax_info = get_xtensa_relax_info (sec);
6342 internal_relocs = retrieve_internal_relocs (abfd, sec,
6346 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
6349 sec_size = bfd_get_section_limit (abfd, sec);
6350 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
6357 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table,
6365 for (i = 0; i < sec->reloc_count; i++)
6384 sec->owner, sec, r_offset);
6391 sec->vma + irel->r_offset);
6395 ta_convert_longcall, sec, r_offset,
6419 init_ebb (ebb, sec, contents, sec_size, prop_table, ptblsize,
6420 internal_relocs, sec->reloc_count);
6431 || !check_section_ebb_pcrels_fit (abfd, sec, contents,
6440 ta_convert_longcall, sec, r_offset, 0);
6446 text_action_add_proposed (&relax_info->action_list, &ebb_table, sec);
6460 release_contents (sec, contents);
6461 release_internal_relocs (sec, internal_relocs);
6486 start_offset = entry->address - ebb->sec->vma;
6487 end_offset = entry->address + entry->size - ebb->sec->vma;
6495 if (offset == entry->address - ebb->sec->vma
6511 ebb->sec->owner, ebb->sec, offset);
6547 ebb->sec->owner, ebb->sec, offset);
6565 ebb->sec->owner, ebb->sec, offset);
6660 int align = (1 << ebb_table->ebb.sec->alignment_power);
6806 && ebb_table->ebb.sec->alignment_power == 2)
6816 && ebb_table->ebb.sec->alignment_power == 2)
6846 if ((removed_bytes % (1 << ebb_table->ebb.sec->alignment_power)) != 0
6860 br = br & ((1 << ebb->sec->alignment_power ) - 1);
6874 asection *sec,
6883 relax_info = get_xtensa_relax_info (sec);
6885 for (i = 0; i < sec->reloc_count; i++)
6907 bfd_get_section_limit (abfd, sec));
6909 if (r_reloc_get_section (&r_rel) != sec)
6957 opcode = get_relocation_opcode (abfd, sec, contents, irel);
6996 asection *sec)
7015 text_action_add (l, action->action, sec, action->offset,
7065 asection *sec,
7085 relax_info = get_xtensa_relax_info (sec);
7090 internal_relocs = retrieve_internal_relocs (abfd, sec,
7093 sec_size = bfd_get_section_limit (abfd, sec);
7094 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
7105 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
7108 ptblsize = xtensa_read_table_entries (abfd, sec, &prop_table,
7124 irel = get_irel_at_offset (sec, internal_relocs,
7151 if (!remove_dead_literal (abfd, sec, link_info, internal_relocs,
7161 if (!identify_literal_placement (abfd, sec, contents, link_info,
7183 release_contents (sec, contents);
7184 release_internal_relocs (sec, internal_relocs);
7190 get_irel_at_offset (asection *sec,
7203 irel = bsearch (&key, internal_relocs, sec->reloc_count,
7217 for ( ; i < sec->reloc_count; i++)
7257 asection *sec,
7268 relax_info = get_xtensa_relax_info (sec);
7273 sec->vma + rel->r_rel.target_offset);
7279 ta_remove_literal, sec, rel->r_rel.target_offset, 4);
7282 if (sec->alignment_power > 2)
7291 entry_sec_offset = entry->address - sec->vma + entry->size;
7301 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset);
7302 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset,
7308 ta_fill, sec, entry_sec_offset, removed_diff);
7315 shrink_dynamic_reloc_sections (link_info, abfd, sec, irel);
7318 pin_internal_relocs (sec, internal_relocs);
7328 asection *sec,
7350 relax_info = get_xtensa_relax_info (sec);
7354 sec_size = bfd_get_section_limit (abfd, sec);
7385 == sec->output_section)
7387 && coalesce_shared_literal (sec, rel, prop_table, ptblsize, val_map))
7400 if (target_sec && target_sec->output_section == sec->output_section)
7408 && move_shared_literal (sec, link_info, rel,
7456 asection *sec;
7462 sec = r_reloc_get_section (r_rel);
7477 != sec->output_section)
7487 dest_address = (sec->output_section->vma
7488 + sec->output_offset
7505 coalesce_shared_literal (asection *sec,
7517 relax_info = get_xtensa_relax_info (sec);
7522 (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset);
7530 ta_remove_literal, sec, rel->r_rel.target_offset, 4);
7533 if (sec->alignment_power > 2)
7539 entry_sec_offset = entry->address - sec->vma + entry->size;
7551 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset);
7552 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset,
7558 ta_fill, sec, entry_sec_offset, removed_diff);
7570 move_shared_literal (asection *sec,
7593 relax_info = get_xtensa_relax_info (sec);
7606 (prop_table, ptblsize, sec->vma + rel->r_rel.target_offset);
7623 init_ebb (ebb, target_sec_cache->sec, target_sec_cache->contents,
7682 ta_remove_literal, sec, rel->r_rel.target_offset, 4);
7685 if (sec->alignment_power > 2 && target_entry != src_entry)
7691 entry_sec_offset = src_entry->address - sec->vma + src_entry->size;
7703 fa = find_fill_action (&relax_info->action_list, sec, entry_sec_offset);
7704 removed_diff = compute_removed_action_diff (fa, sec, entry_sec_offset,
7710 ta_fill, sec, entry_sec_offset, removed_diff);
7725 relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
7736 sec_size = bfd_get_section_limit (abfd, sec);
7737 relax_info = get_xtensa_relax_info (sec);
7741 translate_section_fixes (sec);
7744 if (xtensa_is_property_section (sec))
7747 return relax_property_section (abfd, sec, link_info);
7750 internal_relocs = retrieve_internal_relocs (abfd, sec,
7752 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
7761 for (i = 0; i < sec->reloc_count; i++)
7782 bfd_get_section_limit (abfd, sec));
7796 shrink_dynamic_reloc_sections (link_info, abfd, sec, irel);
7800 pin_internal_relocs (sec, internal_relocs);
7820 (link_info, error_message, abfd, sec,
7863 if (bfd_get_section_limit (abfd, sec) < old_source_offset)
7867 abfd, sec, old_source_offset);
7916 abfd, sec, old_source_offset);
7920 pin_contents (sec, contents);
7930 fix = reloc_bfd_fix_init (sec, source_offset, r_type, 0,
7933 add_fix (sec, fix);
7936 pin_internal_relocs (sec, internal_relocs);
7948 bfd_size_type size = sec->size;
7962 final_size = sec->size;
8087 pin_internal_relocs (sec, internal_relocs);
8088 pin_contents (sec, contents);
8090 if (!move_literal (abfd, link_info, sec, dup_dot, dup_contents,
8133 sec->contents = dup_contents;
8136 pin_contents (sec, contents);
8146 pin_contents (sec, contents);
8148 sec->size = final_size;
8152 release_internal_relocs (sec, internal_relocs);
8153 release_contents (sec, contents);
8159 translate_section_fixes (asection *sec)
8164 relax_info = get_xtensa_relax_info (sec);
8183 asection *sec;
8191 sec = fix->target_sec;
8194 relax_info = get_xtensa_relax_info (sec);
8235 if (new_sec != sec)
8237 sec = new_sec;
8238 relax_info = get_xtensa_relax_info (sec);
8272 asection *sec;
8281 sec = r_reloc_get_section (orig_rel);
8283 relax_info = get_xtensa_relax_info (sec);
8312 if (new_sec != sec)
8314 sec = new_sec;
8315 relax_info = get_xtensa_relax_info (sec);
8450 asection *sec,
8463 BFD_ASSERT (elf_section_data (sec)->relocs == *internal_relocs_p);
8487 fix = reloc_bfd_fix_init (sec, offset, r_type, r_rel->abfd,
8492 sec->flags |= SEC_RELOC;
8496 add_fix (sec, fix);
8501 insert_at = sec->reloc_count;
8502 for (i = 0; i < sec->reloc_count; ++i)
8512 || sec->reloc_count + 1 > relax_info->allocated_relocs_count)
8515 || sec->reloc_count == relax_info->relocs_count);
8518 new_relocs_count = (sec->reloc_count + 2) * 2;
8534 if (insert_at != sec->reloc_count)
8537 (sec->reloc_count - insert_at)
8552 elf_section_data (sec)->relocs = new_relocs;
8553 sec->reloc_count++;
8554 relax_info->relocs_count = sec->reloc_count;
8559 if (insert_at != sec->reloc_count)
8562 for (idx = sec->reloc_count; idx > insert_at; idx--)
8566 sec->reloc_count++;
8568 relax_info->relocs_count = sec->reloc_count;
8582 asection *sec,
8594 sec_size = bfd_get_section_limit (abfd, sec);
8595 internal_relocs = retrieve_internal_relocs (abfd, sec,
8597 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
8605 ((strcmp (sec->name, XTENSA_PROP_SEC_NAME) == 0)
8606 || (strncmp (sec->name, ".gnu.linkonce.prop.",
8611 for (i = 0; i < sec->reloc_count; i++)
8707 pin_contents (sec, contents);
8714 pin_internal_relocs (sec, internal_relocs);
8725 || strcmp (sec->name, XTENSA_LIT_SEC_NAME) == 0))
8739 predef_flags = xtensa_get_property_predef_flags (sec);
8743 qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
8747 pin_internal_relocs (sec, internal_relocs);
8748 pin_contents (sec, contents);
8751 section_size = sec->size;
8771 for (i = nexti; i < sec->reloc_count; i++)
8781 for (nexti = i + 1; nexti < sec->reloc_count; nexti++)
8903 sec->size = section_size - removed_bytes;
8905 if (xtensa_is_littable_section (sec))
8920 release_internal_relocs (sec, internal_relocs);
8921 release_contents (sec, contents);
8932 relax_section_symbols (bfd *abfd, asection *sec)
8940 relax_info = get_xtensa_relax_info (sec);
8947 sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
8990 && sym_hash->root.u.def.section == sec)
9023 asection *sec, *old_sec;
9054 sec = fix->target_sec;
9055 rel->r_addend += ((sec->output_offset + fix->target_offset)
9069 asection *sec;
9081 sec = fix->target_sec;
9093 *relocationp = (sec->output_section->vma
9094 + sec->output_offset
9277 xtensa_is_property_section (asection *sec)
9279 if (strncmp (XTENSA_INSN_SEC_NAME, sec->name, insn_sec_len) == 0
9280 || strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0
9281 || strncmp (XTENSA_PROP_SEC_NAME, sec->name, prop_sec_len) == 0)
9284 if (strncmp (".gnu.linkonce.", sec->name, linkonce_len) == 0
9285 && (strncmp (&sec->name[linkonce_len], "x.", 2) == 0
9286 || strncmp (&sec->name[linkonce_len], "p.", 2) == 0
9287 || strncmp (&sec->name[linkonce_len], "prop.", 5) == 0))
9295 xtensa_is_littable_section (asection *sec)
9297 if (strncmp (XTENSA_LIT_SEC_NAME, sec->name, lit_sec_len) == 0)
9300 if (strncmp (".gnu.linkonce.", sec->name, linkonce_len) == 0
9301 && sec->name[linkonce_len] == 'p'
9302 && sec->name[linkonce_len + 1] == '.')
9345 xtensa_get_property_section_name (asection *sec, const char *base_name)
9347 if (strncmp (sec->name, ".gnu.linkonce.", linkonce_len) == 0)
9362 prop_sec_name = (char *) bfd_malloc (strlen (sec->name)
9367 suffix = sec->name + linkonce_len;
9382 xtensa_get_property_predef_flags (asection *sec)
9384 if (strcmp (sec->name, XTENSA_INSN_SEC_NAME) == 0
9385 || strncmp (sec->name, ".gnu.linkonce.x.",
9391 if (xtensa_is_littable_section (sec))
9405 asection *sec,
9416 sec_size = bfd_get_section_limit (abfd, sec);
9420 if ((sec->flags & SEC_LINKER_CREATED) != 0
9421 && strncmp (sec->name, ".plt", 4) == 0)
9426 if (sec->name[4] == '\0')
9427 sgotplt = bfd_get_section_by_name (sec->owner, ".got.plt");
9433 BFD_ASSERT (sec->name[4] == '.');
9434 chunk = strtol (&sec->name[5], NULL, 10);
9437 sgotplt = bfd_get_section_by_name (sec->owner, got_name);
9444 (*callback) (sec, sec_size, sgotplt, 0, closure);
9447 internal_relocs = retrieve_internal_relocs (abfd, sec,
9450 || sec->reloc_count == 0)
9454 contents = retrieve_contents (abfd, sec, link_info->keep_memory);
9464 for (i = 0; i < sec->reloc_count; i++)
9467 if (is_l32r_relocation (abfd, sec, contents, irel))
9482 (*callback) (sec, irel->r_offset, target_sec, target_offset,
9488 release_internal_relocs (sec, internal_relocs);
9489 release_contents (sec, contents);