#endif
#endif
+#ifndef R_N0SEL
+#define R_N0SEL 0xd8
+#endif
+
+#ifndef R_N1SEL
+#define R_N1SEL 0xd9
+#endif
+
/* Various structures and types used internally in tc-hppa.c. */
/* Unwind table and descriptor. FIXME: Sync this with GDB version. */
static void pa_import PARAMS ((int));
static void pa_label PARAMS ((int));
static void pa_leave PARAMS ((int));
+static void pa_level PARAMS ((int));
static void pa_origin PARAMS ((int));
static void pa_proc PARAMS ((int));
static void pa_procend PARAMS ((int));
{"label", pa_label, 0},
{"lcomm", pa_lcomm, 0},
{"leave", pa_leave, 0},
+ {"level", pa_level, 0},
{"long", pa_cons, 4},
{"lsym", pa_lsym, 0},
{"nsubspa", pa_subspace, 1},
first line of the input file. This is because the compiler outputs
#NO_APP at the beginning of its output.
- Also note that '/*' will always start a comment. */
+ Also note that C style comments will always work. */
const char line_comment_chars[] = "#";
/* This array holds the characters which act as line separators. */
/* pre-defined subsegments (subspaces) for the HPPA. */
#define SUBSEG_CODE 0
-#define SUBSEG_DATA 0
#define SUBSEG_LIT 1
+#define SUBSEG_MILLI 2
+#define SUBSEG_DATA 0
#define SUBSEG_BSS 2
#define SUBSEG_UNWIND 3
#define SUBSEG_GDB_STRINGS 0
{"$CODE$", 1, 1, 1, 0, 0, 0, 24, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_CODE},
{"$DATA$", 1, 1, 0, 0, 0, 0, 24, 0x1f, 1, 8, 1, 1, ".data", SUBSEG_DATA},
{"$LIT$", 1, 1, 0, 0, 0, 0, 16, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_LIT},
+ {"$MILLICODE$", 1, 1, 0, 0, 0, 0, 8, 0x2c, 0, 8, 0, 0, ".text", SUBSEG_MILLI},
{"$BSS$", 1, 1, 0, 0, 0, 1, 80, 0x1f, 1, 8, 1, 1, ".bss", SUBSEG_BSS},
#ifdef OBJ_ELF
{"$UNWIND$", 1, 1, 0, 0, 0, 0, 64, 0x2c, 0, 4, 0, 0, ".PARISC.unwind", SUBSEG_UNWIND},
relocs[i]->addend = fixp->fx_offset;
}
}
+
+ done:
#endif
-done:
return relocs;
}
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
struct hppa_fix_struct *hppa_fixP;
long new_val, result;
- unsigned int w1, w2, w;
+ unsigned int w1, w2, w, resulti;
hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data;
/* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can
|| fixP->fx_r_type == R_HPPA_EXIT
|| fixP->fx_r_type == R_HPPA_BEGIN_BRTAB
|| fixP->fx_r_type == R_HPPA_END_BRTAB)
- return;
+ return 1;
#endif
/* There should have been an HPPA specific fixup associated
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffffc000,
buf);
- low_sign_unext (new_val, 14, &result);
+ low_sign_unext (new_val, 14, &resulti);
+ result = resulti;
break;
/* Handle all opcodes with the 'k' operand type. */
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffe00000,
buf);
- dis_assemble_21 (new_val, &result);
+ dis_assemble_21 (new_val, &resulti);
+ result = resulti;
break;
/* Handle all the opcodes with the 'i' operand type. */
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffff800,
buf);
- low_sign_unext (new_val, 11, &result);
+ low_sign_unext (new_val, 11, &resulti);
+ result = resulti;
break;
/* Handle all the opcodes with the 'w' operand type. */
case 12:
- CHECK_FIELD (new_val, 8199, -8184, 0)
+ CHECK_FIELD (new_val, 8199, -8184, 0);
/* Mask off 11 bits to be changed. */
- sign_unext ((new_val - 8) >> 2, 12, &result);
+ sign_unext ((new_val - 8) >> 2, 12, &resulti);
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffffe002,
buf);
- dis_assemble_12 (result, &w1, &w);
+ dis_assemble_12 (resulti, &w1, &w);
result = ((w1 << 2) | w);
break;
bfd_put_32 (stdoutput,
bfd_get_32 (stdoutput, buf) & 0xffe0e002,
buf);
- sign_unext ((new_val - 8) >> 2, 17, &result);
- dis_assemble_17 (result, &w1, &w2, &w);
+ sign_unext ((new_val - 8) >> 2, 17, &resulti);
+ dis_assemble_17 (resulti, &w1, &w2, &w);
result = ((w2 << 2) | (w1 << 16) | w);
break;
default:
as_bad ("Unknown relocation encountered in md_apply_fix.");
- return;
+ return 0;
}
/* Insert the relocation. */
bfd_put_32 (stdoutput, bfd_get_32 (stdoutput, buf) | result, buf);
- return;
+ return 1;
}
else
{
printf ("no hppa_fixup entry for this fixup (fixP = 0x%x, type = 0x%x)\n",
(unsigned int) fixP, fixP->fx_r_type);
- return;
+ return 0;
}
}
ISBRANCH specifies whether or not this is parsing a condition
completer for a branch (vs a nullification completer for a
- computational instruction. */
+ computational instruction). */
static int
pa_parse_neg_add_cmpltr (s, isbranch)
abort ();
}
+/* Handle a .LEVEL pseudo-op. */
+
+static void
+pa_level (unused)
+ int unused;
+{
+ char *level;
+
+ level = input_line_pointer;
+ if (strncmp (level, "1.0", 3) == 0)
+ {
+ input_line_pointer += 3;
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, 10))
+ as_warn ("could not set architecture and machine");
+ }
+ else if (strncmp (level, "1.1", 3) == 0)
+ {
+ input_line_pointer += 3;
+ if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, 11))
+ as_warn ("could not set architecture and machine");
+ }
+ else
+ {
+ as_bad ("Unrecognized .LEVEL argument\n");
+ ignore_rest_of_line ();
+ }
+ demand_empty_rest_of_line ();
+}
+
/* Handle a .ORIGIN pseudo-op. */
static void
| SEC_READONLY
| SEC_HAS_CONTENTS));
}
+ else if (!strcmp (pa_def_subspaces[i].name, "$MILLICODE$")
+ && !USE_ALIASES)
+ {
+ applicable = bfd_applicable_section_flags (stdoutput);
+ bfd_set_section_flags (stdoutput, segment,
+ applicable & (SEC_ALLOC | SEC_LOAD
+ | SEC_RELOC
+ | SEC_READONLY
+ | SEC_HAS_CONTENTS));
+ }
else if (!strcmp (pa_def_subspaces[i].name, "$UNWIND$") && !USE_ALIASES)
{
applicable = bfd_applicable_section_flags (stdoutput);
return 0;
}
- /* We can't adjust DP relative relocs that use LR% and RR% field
- selectors. That confuses the optimization pass in HP linker. */
- if (fixp->fx_r_type == R_DP_RELATIVE
- && (hppa_fix->fx_r_field == e_lrsel
- || hppa_fix->fx_r_field == e_rrsel
- || hppa_fix->fx_r_field == e_nlrsel))
+ /* We can't adjust any relocs that use LR% and RR% field selectors.
+ That confuses the HP linker. */
+ if (hppa_fix->fx_r_field == e_lrsel
+ || hppa_fix->fx_r_field == e_rrsel
+ || hppa_fix->fx_r_field == e_nlrsel)
return 0;
#endif