[binutils-gdb] gas: have print_expr() recognize O_index

Jan Beulich jbeulich@sourceware.org
Fri Apr 10 06:44:03 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ae8e32dbc67455677437b313e8dc3bbf18bdc7b5

commit ae8e32dbc67455677437b313e8dc3bbf18bdc7b5
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Apr 10 08:41:47 2026 +0200

    gas: have print_expr() recognize O_index
    
    If expr.h is to be trusted, ->X_add_number shouldn't be taken into
    consideration here.

Diff:
---
 gas/symbols.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gas/symbols.c b/gas/symbols.c
index a0f8fcebeb8..42a0779e321 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -3399,6 +3399,16 @@ print_expr_1 (FILE *file, expressionS *exp)
       print_symbol_value_1 (file, exp->X_op_symbol);
       fprintf (file, ">");
       goto maybe_print_addnum;
+    case O_index:
+      indent_level++;
+      fprintf (file, "index\n%*s<", indent_level * 4, "");
+      if (exp->X_add_symbol != NULL)
+	print_symbol_value_1 (file, exp->X_add_symbol);
+      fprintf (file, ">\n%*s<", indent_level * 4, "");
+      print_symbol_value_1 (file, exp->X_op_symbol);
+      fprintf (file, ">");
+      indent_level--;
+      break;
     default:
       fprintf (file, "{unknown opcode %d}", (int) exp->X_op);
       break;


More information about the Binutils-cvs mailing list