Assuming GMSD is a special operand, marked as O_md1, the code:
    .set VREG, GMSD
    .set REG, VREG
    extsw REG, 2
...fails upon attempts to resolve the value of the symbol. This happens
since machine-dependent values are not handled in the giant op switch.
We introduce a custom md_resolve_symbol macro; the ports can use this
macro to customize the behavior when resolve_symbol_value hits O_md
operand.
 codes, are typically entered directly into the symbol table when @code{md_begin}
 is called.  One argument is passed, a @code{char *} for the symbol.
 
+@item md_resolve_symbol
+@cindex md_resolve_symbol
+If this macro is defined, GAS will call it upon resolving machine-dependent
+symbols (that is, for any symbol with operation O_md1..O_md32 inclusively).
+If this functions returns zero, then the symbol could not be resolved.
+
 @item md_operand
 @cindex md_operand
 GAS will call this function with one argument, an @code{expressionS}
 
          BAD_CASE (op);
          break;
 
+       case O_md1:
+       case O_md2:
+       case O_md3:
+       case O_md4:
+       case O_md5:
+       case O_md6:
+       case O_md7:
+       case O_md8:
+       case O_md9:
+       case O_md10:
+       case O_md11:
+       case O_md12:
+       case O_md13:
+       case O_md14:
+       case O_md15:
+       case O_md16:
+       case O_md17:
+       case O_md18:
+       case O_md19:
+       case O_md20:
+       case O_md21:
+       case O_md22:
+       case O_md23:
+       case O_md24:
+       case O_md25:
+       case O_md26:
+       case O_md27:
+       case O_md28:
+       case O_md29:
+       case O_md30:
+       case O_md31:
+       case O_md32:
+#ifdef md_resolve_symbol
+         resolved = md_resolve_symbol (symp, &final_val, &final_seg);
+         if (resolved)
+           break;
+#endif
+         goto exit_dont_set_value;
+
        case O_absent:
          final_val = 0;
          /* Fall through.  */