From: Neal Frager Date: Fri, 29 Sep 2023 15:45:46 +0000 (-0700) Subject: tc-microblaze.c - int compare for X_add_number. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2677a57064afd32076b85295bdc11de6e75e7e36;p=binutils-gdb.git tc-microblaze.c - int compare for X_add_number. The range check should be checking for the range ffffffff80000000..7fffffff, not ffffffff70000000. 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: nagaraju Signed-off-by: Neal Frager Signed-off-by: Michael J. Eager --- diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c index aa85174befd..d900a9e1d05 100644 --- a/gas/config/tc-microblaze.c +++ b/gas/config/tc-microblaze.c @@ -755,7 +755,7 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max) if ((e->X_add_number >> 31) == 1) e->X_add_number |= -((addressT) (1U << 31)); - if (e->X_add_number < min || e->X_add_number > max) + if ((int)e->X_add_number < min || (int)e->X_add_number > max) { as_fatal (_("operand must be absolute in range %lx..%lx, not %lx"), (long) min, (long) max, (long) e->X_add_number);