widthS = exp->X_op_symbol;
width = resolve_symbol_value (widthS);
- if (width < 0x100)
+ if (width < SFRAME_FRE_TYPE_ADDR1_LIMIT)
ret = 1;
- else if (width < 0x10000)
+ else if (width < SFRAME_FRE_TYPE_ADDR2_LIMIT)
ret = 2;
else
ret = 4;
{
fsizeS = frag->fr_symbol;
fsize = resolve_symbol_value (fsizeS);
- if (fsize < 0x100)
+ if (fsize < SFRAME_FRE_TYPE_ADDR1_LIMIT)
func_info = SFRAME_FRE_TYPE_ADDR1;
- else if (fsize < 0x10000)
+ else if (fsize < SFRAME_FRE_TYPE_ADDR2_LIMIT)
func_info = SFRAME_FRE_TYPE_ADDR2;
else
func_info = SFRAME_FRE_TYPE_ADDR4;
switch (frag->fr_subtype & 7)
{
case 1:
- gas_assert (fsize < 0x100);
+ gas_assert (fsize < SFRAME_FRE_TYPE_ADDR1_LIMIT);
frag->fr_literal[frag->fr_fix] = diff;
break;
case 2:
- gas_assert (fsize < 0x10000);
+ gas_assert (fsize < SFRAME_FRE_TYPE_ADDR2_LIMIT);
md_number_to_chars (frag->fr_literal + frag->fr_fix, diff, 2);
break;
case 4:
fi
*/
+/* Used when SFRAME_FRE_TYPE_ADDR1 is specified as FRE type. */
typedef struct sframe_frame_row_entry_addr1
{
/* Start address of the frame row entry. Encoded as an 1-byte unsigned
sframe_fre_info sfre_info;
} ATTRIBUTE_PACKED sframe_frame_row_entry_addr1;
+/* Upper limit of start address in sframe_frame_row_entry_addr1
+ is 0x100 (not inclusive). */
+#define SFRAME_FRE_TYPE_ADDR1_LIMIT ((SFRAME_FRE_TYPE_ADDR1 + 1) * 8)
+
+/* Used when SFRAME_FRE_TYPE_ADDR2 is specified as FRE type. */
typedef struct sframe_frame_row_entry_addr2
{
/* Start address of the frame row entry. Encoded as an 2-byte unsigned
sframe_fre_info sfre_info;
} ATTRIBUTE_PACKED sframe_frame_row_entry_addr2;
+/* Upper limit of start address in sframe_frame_row_entry_addr2
+ is 0x10000 (not inclusive). */
+#define SFRAME_FRE_TYPE_ADDR2_LIMIT ((SFRAME_FRE_TYPE_ADDR2 * 2) * 8)
+
+/* Used when SFRAME_FRE_TYPE_ADDR4 is specified as FRE type. */
typedef struct sframe_frame_row_entry_addr4
{
/* Start address of the frame row entry. Encoded as a 4-byte unsigned
sframe_fre_info sfre_info;
} ATTRIBUTE_PACKED sframe_frame_row_entry_addr4;
+/* Upper limit of start address in sframe_frame_row_entry_addr2
+ is 0x100000000 (not inclusive). */
+#define SFRAME_FRE_TYPE_ADDR4_LIMIT ((SFRAME_FRE_TYPE_ADDR4 * 2) * 8)
+
#ifdef __cplusplus
}
#endif
sframe_calc_fre_type (unsigned int func_size)
{
unsigned int fre_type = 0;
- if (func_size <= 0xff)
+ if (func_size < SFRAME_FRE_TYPE_ADDR1_LIMIT)
fre_type = SFRAME_FRE_TYPE_ADDR1;
- else if (func_size <= 0xffff)
+ else if (func_size < SFRAME_FRE_TYPE_ADDR2_LIMIT)
fre_type = SFRAME_FRE_TYPE_ADDR2;
- else if (func_size <= 0xffffffff)
+ else if (func_size < SFRAME_FRE_TYPE_ADDR4_LIMIT)
fre_type = SFRAME_FRE_TYPE_ADDR4;
return fre_type;
}