static void
s_riscv_leb128 (int sign)
{
- expressionS exp;
- char *save_in = input_line_pointer;
+ do
+ {
+ expressionS exp;
- expression (&exp);
- if (sign && exp.X_op != O_constant)
- as_bad (_("non-constant .sleb128 is not supported"));
- else if (!sign && exp.X_op != O_constant && exp.X_op != O_subtract)
- as_bad (_(".uleb128 only supports constant or subtract expressions"));
+ expression (&exp);
+ if (sign && exp.X_op != O_constant)
+ as_bad (_("non-constant .sleb128 is not supported"));
+ else if (!sign && exp.X_op != O_constant && exp.X_op != O_subtract)
+ as_bad (_(".uleb128 only supports constant or subtract expressions"));
+ else
+ emit_leb128_expr (&exp, sign);
+ }
+ while (*input_line_pointer++ == ',');
+ input_line_pointer--;
demand_empty_rest_of_line ();
-
- input_line_pointer = save_in;
- return s_leb128 (sign);
}
/* Parse the .insn directive. There are three formats,
thread local variables.
@cindex LEB128 directives
-@item .uleb128 @var{value}
-@itemx .sleb128 @var{value}
-Emits a signed or unsigned LEB128 value at the current position. This only
+@item .uleb128 @var{values}
+@itemx .sleb128 @var{values}
+Emits signed or unsigned LEB128 values at the current position. This only
accepts constant expressions, because symbol addresses can change with
relaxation, and we don't support relocations to modify LEB128 values at link
-time.
+time. An exception are differences between symbols, which may be used with
+@code{.uleb128}.
@cindex Option directive
@cindex @code{option} directive
#readelf: -wlL
#name: DWARF2 6
# These targets either do not support or do not evaluate the subtraction of symbols at assembly time.
-#xfail: cr16-* crx-* riscv*-*
+#xfail: cr16-* crx-*
Raw dump of debug contents of section .debug_line: