uint32_t func_size = 0;
unsigned char func_info = 0;
unsigned int r_offset = 0;
- bool pltn_reloc_by_hand = false;
+ bool pltn_reloc = false;
unsigned int pltn_r_offset = 0;
uint8_t rep_block_size = 0;
of PLT_SFRAME_FDE_START_OFFSET is also set to the
same. */
r_offset = sframe_decoder_get_hdr_size (sfd_ctx);
+
/* For any further SFrame FDEs, the generator has already put
in an offset in place of sfde_func_start_address of the
corresponding FDE. We will use it by hand to relocate. */
{
pltn_r_offset
= r_offset + (i * sizeof (sframe_func_desc_entry));
- pltn_reloc_by_hand = true;
+ pltn_reloc = true;
}
}
/* Get the SFrame FDE function start address after relocation. */
address = sframe_read_value (abfd, contents, r_offset, 4);
- if (pltn_reloc_by_hand)
+ if (pltn_reloc)
address += sframe_read_value (abfd, contents,
pltn_r_offset, 4);
- address += (sec->output_offset + r_offset);
-
- /* FIXME For testing only. Cleanup later. */
- // address += (sec->output_section->vma);
+ address += sec->output_offset;
func_start_addr = address;
}
{
bfd_vma plt_start = htab->elf.splt->output_section->vma;
bfd_vma sframe_start = htab->plt_sframe->output_section->vma
- + htab->plt_sframe->output_offset
- + PLT_SFRAME_FDE_START_OFFSET;
+ + htab->plt_sframe->output_offset;
#if 0 /* FIXME Testing only. Remove before review. */
bfd_vma test_value = (plt_start - sframe_start)
+ htab->plt_sframe->output_section->vma
bfd_vma plt_start = htab->plt_second->output_section->vma;
bfd_vma sframe_start
= (htab->plt_second_sframe->output_section->vma
- + htab->plt_second_sframe->output_offset
- + PLT_SFRAME_FDE_START_OFFSET);
+ + htab->plt_second_sframe->output_offset);
#if 0 /* FIXME Testing only. Remove before review. */
bfd_vma test_value = (plt_start - sframe_start)
+ htab->plt_second_sframe->output_section->vma
bfd_vma plt_start = htab->plt_got->output_section->vma;
bfd_vma sframe_start
= (htab->plt_got_sframe->output_section->vma
- + htab->plt_got_sframe->output_offset
- + PLT_SFRAME_FDE_START_OFFSET);
+ + htab->plt_got_sframe->output_offset);
bfd_put_signed_32 (dynobj, plt_start - sframe_start,
htab->plt_got_sframe->contents
+ PLT_SFRAME_FDE_START_OFFSET);
}
static void
-output_sframe_funcdesc (symbolS *start_of_fre_section,
+output_sframe_funcdesc (symbolS *sframe_start,
+ symbolS *start_of_fre_section,
symbolS *fre_symbol,
struct sframe_func_entry *sframe_fde)
{
/* Start address of the function. */
exp.X_op = O_subtract;
exp.X_add_symbol = dw_fde_start_addrS; /* to location. */
- exp.X_op_symbol = symbol_temp_new_now (); /* from location. */
+ exp.X_op_symbol = sframe_start; /* from location. */
exp.X_add_number = 0;
emit_expr (&exp, addr_size);
int fixed_ra_offset = SFRAME_CFA_FIXED_RA_INVALID;
unsigned int addr_size;
+ symbolS *sframe_start = symbol_temp_new_now ();
+
addr_size = SFRAME_RELOC_SIZE;
/* The function descriptor entries as dumped by the assembler are not
i = 0;
for (sframe_fde = all_sframe_fdes; sframe_fde; sframe_fde = sframe_fde->next)
{
- output_sframe_funcdesc (start_of_fre_section,
+ output_sframe_funcdesc (sframe_start, start_of_fre_section,
fre_symbols[i], sframe_fde);
i += sframe_fde->num_fres;
}
output_sframe (segT sframe_seg)
{
(void) sframe_seg;
-
/* Setup the version specific access functions. */
sframe_set_version (SFRAME_VERSION_2);
typedef struct sframe_func_desc_entry
{
/* Function start address. Encoded as a signed offset, relative to the
- beginning of the current FDE. */
+ beginning of the SFrame section. */
int32_t sfde_func_start_address;
/* Size of the function in bytes. */
uint32_t sfde_func_size;