+static const char *
+parse_disp21 (CGEN_CPU_DESC cd,
+ const char ** strp,
+ int opindex,
+ int opinfo ATTRIBUTE_UNUSED,
+ enum cgen_parse_operand_result * resultp,
+ bfd_vma * valuep)
+{
+ const char *str = *strp;
+ const char *errmsg = NULL;
+ bfd_reloc_code_real_type reloc = BFD_RELOC_OR1K_PCREL_PG21;
+
+ if (strncasecmp (str, "got(", 4) == 0)
+ {
+ *strp = str + 4;
+ reloc = BFD_RELOC_OR1K_GOT_PG21;
+ }
+ else if (strncasecmp (str, "tlsgd(", 6) == 0)
+ {
+ *strp = str + 6;
+ reloc = BFD_RELOC_OR1K_TLS_GD_PG21;
+ }
+ else if (strncasecmp (str, "tlsldm(", 7) == 0)
+ {
+ *strp = str + 7;
+ reloc = BFD_RELOC_OR1K_TLS_LDM_PG21;
+ }
+ else if (strncasecmp (str, "gottp(", 6) == 0)
+ {
+ *strp = str + 6;
+ reloc = BFD_RELOC_OR1K_TLS_IE_PG21;
+ }
+
+ errmsg = cgen_parse_address (cd, strp, opindex, reloc, resultp, valuep);
+
+ if (reloc != BFD_RELOC_OR1K_PCREL_PG21)
+ {
+ if (**strp != ')')
+ errmsg = MISSING_CLOSING_PARENTHESIS;
+ else
+ ++*strp;
+ }
+
+ return errmsg;
+}
+
+enum or1k_rclass
+{
+ RCLASS_DIRECT = 0,
+ RCLASS_GOT = 1,
+ RCLASS_GOTPC = 2,
+ RCLASS_GOTOFF = 3,
+ RCLASS_TLSGD = 4,
+ RCLASS_TLSLDM = 5,
+ RCLASS_DTPOFF = 6,
+ RCLASS_GOTTPOFF = 7,
+ RCLASS_TPOFF = 8,
+};
+
+enum or1k_rtype
+{