struct hppa_fix_struct
{
/* The field selector. */
- enum hppa_reloc_field_selector_type fx_r_field;
+ enum hppa_reloc_field_selector_type_alt fx_r_field;
/* Type of fixup. */
int fx_r_type;
static int reg_name_search PARAMS ((char *));
static int pa_chk_field_selector PARAMS ((char **));
static int is_same_frag PARAMS ((fragS *, fragS *));
-static void pa_build_unwind_subspace PARAMS ((struct call_info *));
static void process_exit PARAMS ((void));
static sd_chain_struct *pa_parse_space_stmt PARAMS ((char *, int));
static int log2 PARAMS ((int));
static int pa_next_subseg PARAMS ((sd_chain_struct *));
static unsigned int pa_stringer_aux PARAMS ((char *));
static void pa_spaces_begin PARAMS ((void));
+
+#ifdef OBJ_ELF
static void hppa_elf_mark_end_of_function PARAMS ((void));
+static void pa_build_unwind_subspace PARAMS ((struct call_info *));
+#endif
/* File and gloally scoped variable declarations. */
static const struct selector_entry selector_table[] =
{
- {"e", e_esel},
{"f", e_fsel},
{"l", e_lsel},
{"ld", e_ldsel},
expressionS *exp;
int pcrel;
bfd_reloc_code_real_type r_type;
- enum hppa_reloc_field_selector_type r_field;
+ enum hppa_reloc_field_selector_type_alt r_field;
int r_format;
long arg_reloc;
int* unwind_bits;
else
rel_type = R_HPPA;
- if (hppa_field_selector != e_psel && hppa_field_selector != e_fsel
- && hppa_field_selector != e_esel)
+ if (hppa_field_selector != e_psel && hppa_field_selector != e_fsel)
as_warn ("Invalid field selector. Assuming F%%.");
fix_new_hppa (frag, where, size,
fixp->fx_r_type,
hppa_fixp->fx_r_format,
hppa_fixp->fx_r_field,
- fixp->fx_subsy != NULL);
+ fixp->fx_subsy != NULL,
+ fixp->fx_addsy->bsym);
for (n_relocs = 0; codes[n_relocs]; n_relocs++)
;
{
case R_COMP2:
/* The only time we ever use a R_COMP2 fixup is for the difference
- of two symbols, or for an E% selector in exception handling
- tables. With that in mind we fill in all relocs here and break
- out of the loop. */
- if (fixp->fx_subsy != NULL)
- {
- assert (i == 1);
- relocs[0]->sym_ptr_ptr = &bfd_abs_symbol;
- relocs[0]->howto = bfd_reloc_type_lookup (stdoutput, *codes[0]);
- relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- relocs[0]->addend = 0;
- relocs[1]->sym_ptr_ptr = &fixp->fx_addsy->bsym;
- relocs[1]->howto = bfd_reloc_type_lookup (stdoutput, *codes[1]);
- relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- relocs[1]->addend = 0;
- relocs[2]->sym_ptr_ptr = &fixp->fx_subsy->bsym;
- relocs[2]->howto = bfd_reloc_type_lookup (stdoutput, *codes[2]);
- relocs[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- relocs[2]->addend = 0;
- relocs[3]->sym_ptr_ptr = &bfd_abs_symbol;
- relocs[3]->howto = bfd_reloc_type_lookup (stdoutput, *codes[3]);
- relocs[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- relocs[3]->addend = 0;
- relocs[4]->sym_ptr_ptr = &bfd_abs_symbol;
- relocs[4]->howto = bfd_reloc_type_lookup (stdoutput, *codes[4]);
- relocs[4]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- relocs[4]->addend = 0;
- goto done;
- }
- else
- {
- assert (i == 0);
- relocs[0]->sym_ptr_ptr = &fixp->fx_addsy->bsym;
- relocs[0]->howto = bfd_reloc_type_lookup (stdoutput, *codes[0]);
- relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- relocs[0]->addend = 0;
- relocs[1]->sym_ptr_ptr = &bfd_abs_symbol;
- relocs[1]->howto = bfd_reloc_type_lookup (stdoutput, *codes[1]);
- relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- relocs[1]->addend = 0;
- goto done;
- }
+ of two symbols. With that in mind we fill in all four
+ relocs now and break out of the loop. */
+ assert (i == 1);
+ relocs[0]->sym_ptr_ptr = &bfd_abs_symbol;
+ relocs[0]->howto = bfd_reloc_type_lookup (stdoutput, *codes[0]);
+ relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ relocs[0]->addend = 0;
+ relocs[1]->sym_ptr_ptr = &fixp->fx_addsy->bsym;
+ relocs[1]->howto = bfd_reloc_type_lookup (stdoutput, *codes[1]);
+ relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ relocs[1]->addend = 0;
+ relocs[2]->sym_ptr_ptr = &fixp->fx_subsy->bsym;
+ relocs[2]->howto = bfd_reloc_type_lookup (stdoutput, *codes[2]);
+ relocs[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ relocs[2]->addend = 0;
+ relocs[3]->sym_ptr_ptr = &bfd_abs_symbol;
+ relocs[3]->howto = bfd_reloc_type_lookup (stdoutput, *codes[3]);
+ relocs[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ relocs[3]->addend = 0;
+ relocs[4]->sym_ptr_ptr = &bfd_abs_symbol;
+ relocs[4]->howto = bfd_reloc_type_lookup (stdoutput, *codes[4]);
+ relocs[4]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ relocs[4]->addend = 0;
+ goto done;
case R_PCREL_CALL:
case R_ABS_CALL:
relocs[i]->addend = HPPA_R_ADDEND (hppa_fixp->fx_arg_reloc, 0);
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
struct hppa_fix_struct *hppa_fixP;
- long new_val, result;
+ long new_val, result = 0;
unsigned int w1, w2, w, resulti;
hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data;
|| hppa_fixP->fx_r_field == e_tsel
|| hppa_fixP->fx_r_field == e_rtsel
|| hppa_fixP->fx_r_field == e_ltsel
- || hppa_fixP->fx_r_field == e_esel
#endif
)
new_val = ((fmt == 12 || fmt == 17) ? 8 : 0);
|| hppa_fix->fx_r_field == e_ltsel
|| hppa_fix->fx_r_field == e_rtsel
|| hppa_fix->fx_r_field == e_psel
- || hppa_fix->fx_r_field == e_esel
|| hppa_fix->fx_r_field == e_rpsel
|| hppa_fix->fx_r_field == e_lpsel)
return 0;
number_to_chars_bigendian (f, insn, size > 4 ? 4 : size);
}
-#if 0
/* Create any fixups. */
for (i = 0; i < fc; i++)
{
implicitly 32bits. */
reloc_size = operand->bits;
+ offset = size - reloc_size / 8;
+
/* Is the reloc pc-relative? */
pcrel = (operand->flags & MN10200_OPERAND_PCREL) != 0;
- /* Gross. This disgusting hack is to make sure we
- get the right offset for the 16/32 bit reloc in
- "call" instructions. Basically they're a pain
- because the reloc isn't at the end of the instruction. */
- if ((size == 5 || size == 7)
- && (((insn >> 24) & 0xff) == 0xcd
- || ((insn >> 24) & 0xff) == 0xdd))
- size -= 2;
-
- /* Similarly for certain bit instructions which don't
- hav their 32bit reloc at the tail of the instruction. */
- if (size == 7
- && (((insn >> 16) & 0xffff) == 0xfe00
- || ((insn >> 16) & 0xffff) == 0xfe01
- || ((insn >> 16) & 0xffff) == 0xfe02))
- size -= 1;
-
- offset = size - reloc_size / 8;
/* Choose a proper BFD relocation type. */
if (pcrel)
{
- if (size == 6)
- reloc = BFD_RELOC_MN10200_32_PCREL;
- else if (size == 4)
- reloc = BFD_RELOC_MN10200_16_PCREL;
- else if (reloc_size == 32)
- reloc = BFD_RELOC_32_PCREL;
- else if (reloc_size == 16)
- reloc = BFD_RELOC_16_PCREL;
- else if (reloc_size == 8)
+ if (reloc_size == 8)
reloc = BFD_RELOC_8_PCREL;
+ else if (reloc_size == 24)
+ reloc = BFD_RELOC_24_PCREL;
else
abort ();
}
else
{
if (reloc_size == 32)
- reloc = BFD_RELOC_MN10200_32B;
+ reloc = BFD_RELOC_32;
else if (reloc_size == 16)
- reloc = BFD_RELOC_MN10200_16B;
+ reloc = BFD_RELOC_16;
else if (reloc_size == 8)
reloc = BFD_RELOC_8;
+ else if (reloc_size == 24)
+ reloc = BFD_RELOC_24;
else
abort ();
}
reloc_size = 0;
else if (reloc_size == 16)
reloc_size = 1;
- else if (reloc_size == 32)
+ else if (reloc_size == 32 || reloc_size == 24)
reloc_size = 2;
fix_new_exp (frag_now, f - frag_now->fr_literal + offset, reloc_size,
((bfd_reloc_code_real_type) reloc));
}
}
-#endif
}