[PATCH v1 1/1] gas: expr: fix support .long 0U and .long 0u

Neal Frager neal.frager@amd.com
Wed Sep 27 13:21:30 GMT 2023


Fix support for .long 0U and .long 0u in GCC.

This patch has been tested for years of AMD Xilinx Yocto
releases as part of the following patch set:

https://github.com/Xilinx/meta-xilinx/tree/master/meta-microblaze/recipes-devtools/binutils/binutils

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 gas/expr.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gas/expr.c b/gas/expr.c
index 204cfebc4c7..0d4e955b63a 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -824,6 +824,15 @@ operand (expressionS *expressionP, enum expr_mode mode)
 	      break;
 	    }
 	}
+      if ((*input_line_pointer == 'U') || (*input_line_pointer == 'u'))
+	{
+	  input_line_pointer--;
+
+	  integer_constant ((NUMBERS_WITH_SUFFIX || flag_m68k_mri)
+	                    ? 0 : 10,
+	                    expressionP);
+	  break;
+	}
       c = *input_line_pointer;
       switch (c)
 	{
-- 
2.25.1



More information about the Binutils mailing list