Lines Matching refs:fragP
5030 md_convert_frag_1 (fragS *fragP) in md_convert_frag_1() argument
5036 int object_address = fragP->fr_fix + fragP->fr_address; in md_convert_frag_1()
5041 char *buffer_address = fragP->fr_literal; in md_convert_frag_1()
5042 buffer_address += fragP->fr_fix; in md_convert_frag_1()
5046 disp = fragP->fr_symbol ? S_GET_VALUE (fragP->fr_symbol) : 0; in md_convert_frag_1()
5047 disp = (disp + fragP->fr_offset) - object_address; in md_convert_frag_1()
5049 switch (fragP->fr_subtype) in md_convert_frag_1()
5058 as_bad_where (fragP->fr_file, fragP->fr_line, in md_convert_frag_1()
5060 fixP = fix_new (fragP, fragP->fr_fix - 1, 1, fragP->fr_symbol, in md_convert_frag_1()
5061 fragP->fr_offset, 1, RELAX_RELOC_PC8); in md_convert_frag_1()
5069 fragP->fr_opcode[1] = 0x00; in md_convert_frag_1()
5070 fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, in md_convert_frag_1()
5071 fragP->fr_offset, 1, RELAX_RELOC_PC16); in md_convert_frag_1()
5072 fragP->fr_fix += 2; in md_convert_frag_1()
5075 fragP->fr_opcode[1] = (char) 0xFF; in md_convert_frag_1()
5076 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5077 fragP->fr_offset, 1, RELAX_RELOC_PC32); in md_convert_frag_1()
5078 fragP->fr_fix += 4; in md_convert_frag_1()
5083 fragP->fr_opcode[0] = 0x66; /* bne */ in md_convert_frag_1()
5084 fragP->fr_opcode[1] = 0xFF; in md_convert_frag_1()
5085 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5086 fragP->fr_offset, 1, RELAX_RELOC_PC32); in md_convert_frag_1()
5087 fixP->fx_file = fragP->fr_file; in md_convert_frag_1()
5088 fixP->fx_line = fragP->fr_line; in md_convert_frag_1()
5089 fragP->fr_fix += 4; /* Skip first offset */ in md_convert_frag_1()
5093 fragP->fr_fix += 2; /* Skip second branch opcode */ in md_convert_frag_1()
5094 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5095 fragP->fr_offset, 1, RELAX_RELOC_PC32); in md_convert_frag_1()
5096 fragP->fr_fix += 4; in md_convert_frag_1()
5099 if (fragP->fr_opcode[0] == 0x61) /* jbsr */ in md_convert_frag_1()
5102 as_bad_where (fragP->fr_file, fragP->fr_line, in md_convert_frag_1()
5104 fragP->fr_opcode[0] = 0x4E; in md_convert_frag_1()
5105 fragP->fr_opcode[1] = (char) 0xB9; /* JSR with ABSL LONG operand. */ in md_convert_frag_1()
5106 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5107 fragP->fr_offset, 0, RELAX_RELOC_ABS32); in md_convert_frag_1()
5108 fragP->fr_fix += 4; in md_convert_frag_1()
5110 else if (fragP->fr_opcode[0] == 0x60) /* jbra */ in md_convert_frag_1()
5113 as_bad_where (fragP->fr_file, fragP->fr_line, in md_convert_frag_1()
5115 fragP->fr_opcode[0] = 0x4E; in md_convert_frag_1()
5116 fragP->fr_opcode[1] = (char) 0xF9; /* JMP with ABSL LONG operand. */ in md_convert_frag_1()
5117 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5118 fragP->fr_offset, 0, RELAX_RELOC_ABS32); in md_convert_frag_1()
5119 fragP->fr_fix += 4; in md_convert_frag_1()
5130 as_bad_where (fragP->fr_file, fragP->fr_line, in md_convert_frag_1()
5135 fragP->fr_opcode[0] ^= 0x01; /* Invert bcc. */ in md_convert_frag_1()
5136 fragP->fr_opcode[1] = 0x06; /* Branch offset = 6. */ in md_convert_frag_1()
5143 fragP->fr_fix += 2; /* Account for jmp instruction. */ in md_convert_frag_1()
5144 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5145 fragP->fr_offset, 0, RELAX_RELOC_ABS32); in md_convert_frag_1()
5146 fragP->fr_fix += 4; in md_convert_frag_1()
5149 know ((fragP->fr_opcode[1] & 0x40) == 0); in md_convert_frag_1()
5150 fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, in md_convert_frag_1()
5151 fragP->fr_offset, 1, RELAX_RELOC_PC16); in md_convert_frag_1()
5152 fragP->fr_fix += 2; in md_convert_frag_1()
5155 fragP->fr_opcode[1] |= 0x40; /* Turn on LONG bit. */ in md_convert_frag_1()
5156 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5157 fragP->fr_offset, 1, RELAX_RELOC_PC32); in md_convert_frag_1()
5158 fragP->fr_fix += 4; in md_convert_frag_1()
5162 fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, in md_convert_frag_1()
5163 fragP->fr_offset, 1, RELAX_RELOC_PC16); in md_convert_frag_1()
5164 fragP->fr_fix += 2; in md_convert_frag_1()
5177 fragP->fr_fix += 6; /* Account for bra/jmp instructions. */ in md_convert_frag_1()
5178 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5179 fragP->fr_offset, 1, RELAX_RELOC_PC32); in md_convert_frag_1()
5180 fragP->fr_fix += 4; in md_convert_frag_1()
5187 as_bad_where (fragP->fr_file, fragP->fr_line, in md_convert_frag_1()
5197 fragP->fr_fix += 6; /* Account for bra/jmp instructions. */ in md_convert_frag_1()
5198 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5199 fragP->fr_offset, 0, RELAX_RELOC_ABS32); in md_convert_frag_1()
5200 fragP->fr_fix += 4; in md_convert_frag_1()
5203 fragP->fr_opcode[1] &= ~0x3F; in md_convert_frag_1()
5204 fragP->fr_opcode[1] |= 0x3A; /* 072 - mode 7.2 */ in md_convert_frag_1()
5205 fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol, in md_convert_frag_1()
5206 fragP->fr_offset, 1, RELAX_RELOC_PC16); in md_convert_frag_1()
5207 fragP->fr_fix += 2; in md_convert_frag_1()
5214 fragP->fr_fix += 2; in md_convert_frag_1()
5215 fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol, in md_convert_frag_1()
5216 fragP->fr_offset, 1, RELAX_RELOC_PC32); in md_convert_frag_1()
5218 fragP->fr_fix += 4; in md_convert_frag_1()
5221 gas_assert (fragP->fr_fix >= 2); in md_convert_frag_1()
5223 fixP = fix_new (fragP, fragP->fr_fix - 1, 1, fragP->fr_symbol, in md_convert_frag_1()
5224 fragP->fr_offset, 1, RELAX_RELOC_PC8); in md_convert_frag_1()
5228 gas_assert (fragP->fr_fix >= 2); in md_convert_frag_1()
5231 fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol, in md_convert_frag_1()
5232 fragP->fr_offset, 1, RELAX_RELOC_PC16); in md_convert_frag_1()
5234 fragP->fr_fix += 2; in md_convert_frag_1()
5237 gas_assert (fragP->fr_fix >= 2); in md_convert_frag_1()
5240 fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol, in md_convert_frag_1()
5241 fragP->fr_offset, 1, RELAX_RELOC_PC32); in md_convert_frag_1()
5243 fragP->fr_fix += 4; in md_convert_frag_1()
5246 fixP = fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, in md_convert_frag_1()
5247 fragP->fr_offset, 1, RELAX_RELOC_PC16); in md_convert_frag_1()
5248 fragP->fr_fix += 2; in md_convert_frag_1()
5252 as_bad_where (fragP->fr_file, fragP->fr_line, in md_convert_frag_1()
5256 if ((fragP->fr_opcode[1] & 0x3F) != 0x3A) in md_convert_frag_1()
5258 fragP->fr_opcode[1] &= ~0x3F; in md_convert_frag_1()
5259 fragP->fr_opcode[1] |= 0x39; /* Mode 7.1 */ in md_convert_frag_1()
5260 fixP = fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, in md_convert_frag_1()
5261 fragP->fr_offset, 0, RELAX_RELOC_ABS32); in md_convert_frag_1()
5262 fragP->fr_fix += 4; in md_convert_frag_1()
5267 fixP->fx_file = fragP->fr_file; in md_convert_frag_1()
5268 fixP->fx_line = fragP->fr_line; in md_convert_frag_1()
5275 fragS *fragP) in md_convert_frag() argument
5277 md_convert_frag_1 (fragP); in md_convert_frag()
5284 md_estimate_size_before_relax (fragS *fragP, segT segment) in md_estimate_size_before_relax() argument
5287 switch (fragP->fr_subtype) in md_estimate_size_before_relax()
5294 if (S_GET_SEGMENT (fragP->fr_symbol) == segment in md_estimate_size_before_relax()
5295 && relaxable_symbol (fragP->fr_symbol)) in md_estimate_size_before_relax()
5297 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), BYTE); in md_estimate_size_before_relax()
5302 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); in md_estimate_size_before_relax()
5307 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), LONG); in md_estimate_size_before_relax()
5314 if (S_GET_SEGMENT (fragP->fr_symbol) == segment in md_estimate_size_before_relax()
5315 && relaxable_symbol (fragP->fr_symbol)) in md_estimate_size_before_relax()
5317 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), BYTE); in md_estimate_size_before_relax()
5322 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); in md_estimate_size_before_relax()
5332 if ((S_GET_SEGMENT (fragP->fr_symbol) == segment in md_estimate_size_before_relax()
5333 && relaxable_symbol (fragP->fr_symbol)) in md_estimate_size_before_relax()
5336 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); in md_estimate_size_before_relax()
5340 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), LONG); in md_estimate_size_before_relax()
5346 if ((S_GET_SEGMENT (fragP->fr_symbol) == segment in md_estimate_size_before_relax()
5347 && relaxable_symbol (fragP->fr_symbol))) in md_estimate_size_before_relax()
5349 fragP->fr_subtype = TAB (PCINDEX, BYTE); in md_estimate_size_before_relax()
5353 fragP->fr_subtype = TAB (PCINDEX, LONG); in md_estimate_size_before_relax()
5359 if ((S_GET_SEGMENT (fragP->fr_symbol) == segment in md_estimate_size_before_relax()
5360 && relaxable_symbol (fragP->fr_symbol))) in md_estimate_size_before_relax()
5362 fragP->fr_subtype = TAB (ABSTOPCREL, SHORT); in md_estimate_size_before_relax()
5366 fragP->fr_subtype = TAB (ABSTOPCREL, LONG); in md_estimate_size_before_relax()
5376 switch (fragP->fr_subtype) in md_estimate_size_before_relax()
5387 if (fragP->fr_symbol) in md_estimate_size_before_relax()
5391 sym_frag = symbol_get_frag (fragP->fr_symbol); in md_estimate_size_before_relax()
5392 if (S_GET_VALUE (fragP->fr_symbol) == sym_frag->fr_address) in md_estimate_size_before_relax()
5396 for (l = fragP->fr_next; l && l != sym_frag; l = l->fr_next) in md_estimate_size_before_relax()
5400 fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); in md_estimate_size_before_relax()
5407 return md_relax_table[fragP->fr_subtype].rlx_length; in md_estimate_size_before_relax()