uint8_t sfd_ctx_abi_arch;
int8_t sfd_ctx_fixed_fp_offset;
int8_t sfd_ctx_fixed_ra_offset;
+ uint8_t dctx_version;
+ uint8_t ectx_version;
int encerr = 0;
struct elf_link_hash_table *htab;
if (!sfd_ctx_abi_arch)
return false;
- htab->sfe_info.sfe_ctx = sframe_encode (SFRAME_VERSION_1,
+ htab->sfe_info.sfe_ctx = sframe_encode (SFRAME_VERSION_2,
0, /* SFrame flags. */
sfd_ctx_abi_arch,
sfd_ctx_fixed_fp_offset,
return false;
}
+ /* Check that all .sframe sections being linked have the same version. */
+ dctx_version = sframe_decoder_get_version (sfd_ctx);
+ ectx_version = sframe_encoder_get_version (sfe_ctx);
+ if (dctx_version != SFRAME_VERSION_2 || dctx_version != ectx_version)
+ {
+ _bfd_error_handler
+ (_("input SFrame sections with different format versions prevent"
+ " .sframe generation"));
+ return false;
+ }
+
+
/* Iterate over the function descriptor entries and the FREs of the
function from the decoder context. Add each of them to the encoder
context, if suitable. */
for (i = 0; i < num_fidx; i++)
{
unsigned int num_fres = 0;
- int32_t func_start_address;
+ int32_t func_start_addr;
bfd_vma address;
uint32_t func_size = 0;
unsigned char func_info = 0;
unsigned int r_offset = 0;
bool pltn_reloc_by_hand = false;
unsigned int pltn_r_offset = 0;
+ uint8_t rep_block_size = 0;
- if (!sframe_decoder_get_funcdesc (sfd_ctx, i, &num_fres, &func_size,
- &func_start_address, &func_info))
+ if (!sframe_decoder_get_funcdesc_v2 (sfd_ctx, i, &num_fres, &func_size,
+ &func_start_addr, &func_info,
+ &rep_block_size))
{
/* If function belongs to a deleted section, skip editing the
function descriptor entry. */
/* FIXME For testing only. Cleanup later. */
// address += (sec->output_section->vma);
- func_start_address = address;
+ func_start_addr = address;
}
/* Update the encoder context with updated content. */
- int err = sframe_encoder_add_funcdesc (sfe_ctx, func_start_address,
- func_size, func_info,
- num_fres);
+ int err = sframe_encoder_add_funcdesc_v2 (sfe_ctx, func_start_addr,
+ func_size, func_info,
+ rep_block_size, num_fres);
cur_fidx++;
BFD_ASSERT (!err);
}