Lines Matching refs:fragp

16756 mips16_extended_frag (fragS *fragp, asection *sec, long stretch)  in mips16_extended_frag()  argument
16764 if (RELAX_MIPS16_USER_SMALL (fragp->fr_subtype)) in mips16_extended_frag()
16766 if (RELAX_MIPS16_USER_EXT (fragp->fr_subtype)) in mips16_extended_frag()
16769 type = RELAX_MIPS16_TYPE (fragp->fr_subtype); in mips16_extended_frag()
16772 sym_frag = symbol_get_frag (fragp->fr_symbol); in mips16_extended_frag()
16773 val = S_GET_VALUE (fragp->fr_symbol); in mips16_extended_frag()
16774 symsec = S_GET_SEGMENT (fragp->fr_symbol); in mips16_extended_frag()
16791 if (RELAX_MIPS16_LONG_BRANCH (fragp->fr_subtype)) in mips16_extended_frag()
16799 fragp->fr_subtype = in mips16_extended_frag()
16800 RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype); in mips16_extended_frag()
16804 as_bad_where (fragp->fr_file, fragp->fr_line, in mips16_extended_frag()
16809 if (fragp != sym_frag && sym_frag->fr_address == 0) in mips16_extended_frag()
16824 && sym_frag->relax_marker != fragp->relax_marker) in mips16_extended_frag()
16834 for (f = fragp; f != NULL && f != sym_frag; f = f->fr_next) in mips16_extended_frag()
16851 addr = fragp->fr_address + fragp->fr_fix; in mips16_extended_frag()
16865 if (RELAX_MIPS16_EXTENDED (fragp->fr_subtype)) in mips16_extended_frag()
16872 else if (RELAX_MIPS16_JAL_DSLOT (fragp->fr_subtype)) in mips16_extended_frag()
16874 else if (RELAX_MIPS16_DSLOT (fragp->fr_subtype)) in mips16_extended_frag()
16886 fragp->fr_subtype = in mips16_extended_frag()
16887 RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype); in mips16_extended_frag()
16905 && ! RELAX_MIPS16_EXTENDED (fragp->fr_subtype) in mips16_extended_frag()
16908 fragp->fr_subtype = in mips16_extended_frag()
16909 RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype); in mips16_extended_frag()
16914 as_bad_where (fragp->fr_file, fragp->fr_line, _("unsupported relocation")); in mips16_extended_frag()
16925 relaxed_branch_length (fragS *fragp, asection *sec, int update) in relaxed_branch_length() argument
16930 if (fragp in relaxed_branch_length()
16931 && S_IS_DEFINED (fragp->fr_symbol) in relaxed_branch_length()
16932 && sec == S_GET_SEGMENT (fragp->fr_symbol)) in relaxed_branch_length()
16937 val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset; in relaxed_branch_length()
16939 addr = fragp->fr_address + fragp->fr_fix + 4; in relaxed_branch_length()
16945 else if (fragp) in relaxed_branch_length()
16953 if (fragp && update && toofar != RELAX_BRANCH_TOOFAR (fragp->fr_subtype)) in relaxed_branch_length()
16954 fragp->fr_subtype in relaxed_branch_length()
16955 = RELAX_BRANCH_ENCODE (RELAX_BRANCH_AT (fragp->fr_subtype), in relaxed_branch_length()
16956 RELAX_BRANCH_UNCOND (fragp->fr_subtype), in relaxed_branch_length()
16957 RELAX_BRANCH_LIKELY (fragp->fr_subtype), in relaxed_branch_length()
16958 RELAX_BRANCH_LINK (fragp->fr_subtype), in relaxed_branch_length()
16964 if (fragp ? RELAX_BRANCH_LIKELY (fragp->fr_subtype) : (update > 0)) in relaxed_branch_length()
16977 if (fragp ? !RELAX_BRANCH_UNCOND (fragp->fr_subtype) : (update >= 0)) in relaxed_branch_length()
16991 relaxed_micromips_32bit_branch_length (fragS *fragp, asection *sec, int update) in relaxed_micromips_32bit_branch_length() argument
16996 if (fragp in relaxed_micromips_32bit_branch_length()
16997 && S_IS_DEFINED (fragp->fr_symbol) in relaxed_micromips_32bit_branch_length()
16998 && sec == S_GET_SEGMENT (fragp->fr_symbol)) in relaxed_micromips_32bit_branch_length()
17003 val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset; in relaxed_micromips_32bit_branch_length()
17009 addr = fragp->fr_address + fragp->fr_fix + 4; in relaxed_micromips_32bit_branch_length()
17015 else if (fragp) in relaxed_micromips_32bit_branch_length()
17023 if (fragp && update in relaxed_micromips_32bit_branch_length()
17024 && toofar != RELAX_MICROMIPS_TOOFAR32 (fragp->fr_subtype)) in relaxed_micromips_32bit_branch_length()
17025 fragp->fr_subtype = (toofar in relaxed_micromips_32bit_branch_length()
17026 ? RELAX_MICROMIPS_MARK_TOOFAR32 (fragp->fr_subtype) in relaxed_micromips_32bit_branch_length()
17027 : RELAX_MICROMIPS_CLEAR_TOOFAR32 (fragp->fr_subtype)); in relaxed_micromips_32bit_branch_length()
17032 bfd_boolean compact_known = fragp != NULL; in relaxed_micromips_32bit_branch_length()
17037 compact = RELAX_MICROMIPS_COMPACT (fragp->fr_subtype); in relaxed_micromips_32bit_branch_length()
17038 if (fragp) in relaxed_micromips_32bit_branch_length()
17039 uncond = RELAX_MICROMIPS_UNCOND (fragp->fr_subtype); in relaxed_micromips_32bit_branch_length()
17086 relaxed_micromips_16bit_branch_length (fragS *fragp, asection *sec, int update) in relaxed_micromips_16bit_branch_length() argument
17090 if (fragp in relaxed_micromips_16bit_branch_length()
17091 && S_IS_DEFINED (fragp->fr_symbol) in relaxed_micromips_16bit_branch_length()
17092 && sec == S_GET_SEGMENT (fragp->fr_symbol)) in relaxed_micromips_16bit_branch_length()
17098 val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset; in relaxed_micromips_16bit_branch_length()
17105 addr = fragp->fr_address + fragp->fr_fix + 2; in relaxed_micromips_16bit_branch_length()
17112 type = RELAX_MICROMIPS_TYPE (fragp->fr_subtype); in relaxed_micromips_16bit_branch_length()
17125 if (fragp && update in relaxed_micromips_16bit_branch_length()
17126 && toofar != RELAX_MICROMIPS_TOOFAR16 (fragp->fr_subtype)) in relaxed_micromips_16bit_branch_length()
17127 fragp->fr_subtype in relaxed_micromips_16bit_branch_length()
17128 = toofar ? RELAX_MICROMIPS_MARK_TOOFAR16 (fragp->fr_subtype) in relaxed_micromips_16bit_branch_length()
17129 : RELAX_MICROMIPS_CLEAR_TOOFAR16 (fragp->fr_subtype); in relaxed_micromips_16bit_branch_length()
17143 md_estimate_size_before_relax (fragS *fragp, asection *segtype) in md_estimate_size_before_relax() argument
17147 if (RELAX_BRANCH_P (fragp->fr_subtype)) in md_estimate_size_before_relax()
17150 fragp->fr_var = relaxed_branch_length (fragp, segtype, FALSE); in md_estimate_size_before_relax()
17152 return fragp->fr_var; in md_estimate_size_before_relax()
17155 if (RELAX_MIPS16_P (fragp->fr_subtype)) in md_estimate_size_before_relax()
17158 return (RELAX_MIPS16_EXTENDED (fragp->fr_subtype) ? 4 : 2); in md_estimate_size_before_relax()
17160 if (RELAX_MICROMIPS_P (fragp->fr_subtype)) in md_estimate_size_before_relax()
17164 if (RELAX_MICROMIPS_TYPE (fragp->fr_subtype) != 0) in md_estimate_size_before_relax()
17165 length = relaxed_micromips_16bit_branch_length (fragp, segtype, FALSE); in md_estimate_size_before_relax()
17166 if (length == 4 && RELAX_MICROMIPS_RELAX32 (fragp->fr_subtype)) in md_estimate_size_before_relax()
17167 length = relaxed_micromips_32bit_branch_length (fragp, segtype, FALSE); in md_estimate_size_before_relax()
17168 fragp->fr_var = length; in md_estimate_size_before_relax()
17174 change = nopic_need_relax (fragp->fr_symbol, 0); in md_estimate_size_before_relax()
17176 change = pic_need_relax (fragp->fr_symbol, segtype); in md_estimate_size_before_relax()
17185 fragp->fr_subtype |= RELAX_USE_SECOND; in md_estimate_size_before_relax()
17186 return -RELAX_FIRST (fragp->fr_subtype); in md_estimate_size_before_relax()
17189 return -RELAX_SECOND (fragp->fr_subtype); in md_estimate_size_before_relax()
17354 mips_relax_frag (asection *sec, fragS *fragp, long stretch) in mips_relax_frag() argument
17356 if (RELAX_BRANCH_P (fragp->fr_subtype)) in mips_relax_frag()
17358 offsetT old_var = fragp->fr_var; in mips_relax_frag()
17360 fragp->fr_var = relaxed_branch_length (fragp, sec, TRUE); in mips_relax_frag()
17362 return fragp->fr_var - old_var; in mips_relax_frag()
17365 if (RELAX_MICROMIPS_P (fragp->fr_subtype)) in mips_relax_frag()
17367 offsetT old_var = fragp->fr_var; in mips_relax_frag()
17370 if (RELAX_MICROMIPS_TYPE (fragp->fr_subtype) != 0) in mips_relax_frag()
17371 new_var = relaxed_micromips_16bit_branch_length (fragp, sec, TRUE); in mips_relax_frag()
17372 if (new_var == 4 && RELAX_MICROMIPS_RELAX32 (fragp->fr_subtype)) in mips_relax_frag()
17373 new_var = relaxed_micromips_32bit_branch_length (fragp, sec, TRUE); in mips_relax_frag()
17374 fragp->fr_var = new_var; in mips_relax_frag()
17379 if (! RELAX_MIPS16_P (fragp->fr_subtype)) in mips_relax_frag()
17382 if (mips16_extended_frag (fragp, NULL, stretch)) in mips_relax_frag()
17384 if (RELAX_MIPS16_EXTENDED (fragp->fr_subtype)) in mips_relax_frag()
17386 fragp->fr_subtype = RELAX_MIPS16_MARK_EXTENDED (fragp->fr_subtype); in mips_relax_frag()
17391 if (! RELAX_MIPS16_EXTENDED (fragp->fr_subtype)) in mips_relax_frag()
17393 fragp->fr_subtype = RELAX_MIPS16_CLEAR_EXTENDED (fragp->fr_subtype); in mips_relax_frag()
17403 md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) in md_convert_frag() argument
17405 if (RELAX_BRANCH_P (fragp->fr_subtype)) in md_convert_frag()
17412 buf = fragp->fr_literal + fragp->fr_fix; in md_convert_frag()
17415 if (!RELAX_BRANCH_TOOFAR (fragp->fr_subtype)) in md_convert_frag()
17421 exp.X_add_symbol = fragp->fr_symbol; in md_convert_frag()
17422 exp.X_add_number = fragp->fr_offset; in md_convert_frag()
17424 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, TRUE, in md_convert_frag()
17426 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17427 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17435 as_warn_where (fragp->fr_file, fragp->fr_line, in md_convert_frag()
17438 if (RELAX_BRANCH_UNCOND (fragp->fr_subtype)) in md_convert_frag()
17441 if (!RELAX_BRANCH_LIKELY (fragp->fr_subtype)) in md_convert_frag()
17482 if (RELAX_BRANCH_LINK (fragp->fr_subtype)) in md_convert_frag()
17495 if (RELAX_BRANCH_LIKELY (fragp->fr_subtype)) in md_convert_frag()
17500 i = buf - fragp->fr_literal - fragp->fr_fix; in md_convert_frag()
17502 i = fragp->fr_var - i; in md_convert_frag()
17515 if (RELAX_BRANCH_LIKELY (fragp->fr_subtype)) in md_convert_frag()
17522 i = buf - fragp->fr_literal - fragp->fr_fix; in md_convert_frag()
17524 i = fragp->fr_var - i; in md_convert_frag()
17539 insn = (RELAX_BRANCH_LINK (fragp->fr_subtype) in md_convert_frag()
17542 exp.X_add_symbol = fragp->fr_symbol; in md_convert_frag()
17543 exp.X_add_number = fragp->fr_offset; in md_convert_frag()
17545 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, in md_convert_frag()
17547 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17548 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17554 unsigned long at = RELAX_BRANCH_AT (fragp->fr_subtype); in md_convert_frag()
17560 exp.X_add_symbol = fragp->fr_symbol; in md_convert_frag()
17561 exp.X_add_number = fragp->fr_offset; in md_convert_frag()
17563 if (fragp->fr_offset) in md_convert_frag()
17569 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, in md_convert_frag()
17571 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17572 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17584 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, in md_convert_frag()
17586 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17587 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17592 if (RELAX_BRANCH_LINK (fragp->fr_subtype)) in md_convert_frag()
17602 fragp->fr_fix += fragp->fr_var; in md_convert_frag()
17603 gas_assert (buf == fragp->fr_literal + fragp->fr_fix); in md_convert_frag()
17608 if (RELAX_MICROMIPS_P (fragp->fr_subtype)) in md_convert_frag()
17610 char *buf = fragp->fr_literal + fragp->fr_fix; in md_convert_frag()
17611 bfd_boolean compact = RELAX_MICROMIPS_COMPACT (fragp->fr_subtype); in md_convert_frag()
17612 bfd_boolean al = RELAX_MICROMIPS_LINK (fragp->fr_subtype); in md_convert_frag()
17613 int type = RELAX_MICROMIPS_TYPE (fragp->fr_subtype); in md_convert_frag()
17620 exp.X_add_symbol = fragp->fr_symbol; in md_convert_frag()
17621 exp.X_add_number = fragp->fr_offset; in md_convert_frag()
17623 fragp->fr_fix += fragp->fr_var; in md_convert_frag()
17626 if (type != 0 && !RELAX_MICROMIPS_TOOFAR16 (fragp->fr_subtype)) in md_convert_frag()
17632 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 2, &exp, TRUE, in md_convert_frag()
17635 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 2, &exp, TRUE, in md_convert_frag()
17640 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17641 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17651 if (!RELAX_MICROMIPS_RELAX32 (fragp->fr_subtype) in md_convert_frag()
17652 || !RELAX_MICROMIPS_TOOFAR32 (fragp->fr_subtype)) in md_convert_frag()
17657 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, TRUE, in md_convert_frag()
17659 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17660 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17686 if (!RELAX_MICROMIPS_RELAX32 (fragp->fr_subtype) in md_convert_frag()
17687 || !RELAX_MICROMIPS_TOOFAR32 (fragp->fr_subtype)) in md_convert_frag()
17690 gas_assert (buf == fragp->fr_literal + fragp->fr_fix); in md_convert_frag()
17698 as_warn_where (fragp->fr_file, fragp->fr_line, in md_convert_frag()
17704 if (!RELAX_MICROMIPS_UNCOND (fragp->fr_subtype)) in md_convert_frag()
17747 l = symbol_new (micromips_label_name (), asec, fragp->fr_fix, fragp); in md_convert_frag()
17752 fixp = fix_new (fragp, buf - fragp->fr_literal, 4, l, 0, TRUE, in md_convert_frag()
17754 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17755 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17771 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, FALSE, in md_convert_frag()
17773 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17774 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17783 unsigned long at = RELAX_MICROMIPS_AT (fragp->fr_subtype); in md_convert_frag()
17797 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, FALSE, in md_convert_frag()
17799 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17800 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17808 fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, FALSE, in md_convert_frag()
17810 fixp->fx_file = fragp->fr_file; in md_convert_frag()
17811 fixp->fx_line = fragp->fr_line; in md_convert_frag()
17822 gas_assert (buf == fragp->fr_literal + fragp->fr_fix); in md_convert_frag()
17826 if (RELAX_MIPS16_P (fragp->fr_subtype)) in md_convert_frag()
17836 type = RELAX_MIPS16_TYPE (fragp->fr_subtype); in md_convert_frag()
17839 ext = RELAX_MIPS16_EXTENDED (fragp->fr_subtype); in md_convert_frag()
17840 val = resolve_symbol_value (fragp->fr_symbol); in md_convert_frag()
17847 addr = fragp->fr_address + fragp->fr_fix; in md_convert_frag()
17860 else if (RELAX_MIPS16_JAL_DSLOT (fragp->fr_subtype)) in md_convert_frag()
17862 else if (RELAX_MIPS16_DSLOT (fragp->fr_subtype)) in md_convert_frag()
17875 && (RELAX_MIPS16_JAL_DSLOT (fragp->fr_subtype) in md_convert_frag()
17876 || RELAX_MIPS16_DSLOT (fragp->fr_subtype))) in md_convert_frag()
17877 as_warn_where (fragp->fr_file, fragp->fr_line, in md_convert_frag()
17880 buf = fragp->fr_literal + fragp->fr_fix; in md_convert_frag()
17886 if (RELAX_MIPS16_USER_EXT (fragp->fr_subtype)) in md_convert_frag()
17888 else if (RELAX_MIPS16_USER_SMALL (fragp->fr_subtype)) in md_convert_frag()
17893 mips16_immed (fragp->fr_file, fragp->fr_line, type, in md_convert_frag()
17899 fragp->fr_fix += length; in md_convert_frag()
17903 relax_substateT subtype = fragp->fr_subtype; in md_convert_frag()
17911 fixp = (fixS *) fragp->fr_opcode; in md_convert_frag()
17926 as_warn_where (fragp->fr_file, fragp->fr_line, "%s", msg); in md_convert_frag()
17940 as_warn_where (fragp->fr_file, fragp->fr_line, "%s", msg); in md_convert_frag()
17948 && fixp->fx_frag == fragp in md_convert_frag()
17949 && fixp->fx_where < fragp->fr_fix - second) in md_convert_frag()
17959 while (fixp && fixp->fx_frag == fragp) in md_convert_frag()
17973 start = fragp->fr_literal + fragp->fr_fix - first - second; in md_convert_frag()
17975 fragp->fr_fix -= first; in md_convert_frag()
17978 fragp->fr_fix -= second; in md_convert_frag()
18301 mips_handle_align (fragS *fragp) in mips_handle_align() argument
18308 if (fragp->fr_type != rs_align_code) in mips_handle_align()
18311 p = fragp->fr_literal + fragp->fr_fix; in mips_handle_align()
18330 bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; in mips_handle_align()
18338 fragp->fr_fix += excess; in mips_handle_align()
18360 fragp->fr_var = size; in mips_handle_align()
18519 char *fragp; in s_mips_end() local
18534 fragp = frag_more (7 * 4); in s_mips_end()
18536 md_number_to_chars (fragp, cur_proc_ptr->reg_mask, 4); in s_mips_end()
18537 md_number_to_chars (fragp + 4, cur_proc_ptr->reg_offset, 4); in s_mips_end()
18538 md_number_to_chars (fragp + 8, cur_proc_ptr->fpreg_mask, 4); in s_mips_end()
18539 md_number_to_chars (fragp + 12, cur_proc_ptr->fpreg_offset, 4); in s_mips_end()
18540 md_number_to_chars (fragp + 16, cur_proc_ptr->frame_offset, 4); in s_mips_end()
18541 md_number_to_chars (fragp + 20, cur_proc_ptr->frame_reg, 4); in s_mips_end()
18542 md_number_to_chars (fragp + 24, cur_proc_ptr->pc_reg, 4); in s_mips_end()