[PATCH] PR 28215: [CSKY] Don't abort while immediate overflow

Lifang Xia lifang_xia@c-sky.com
Tue Aug 10 06:55:57 GMT 2021


That's no necessary to abort while immediate out of range in
md_apply_fix. It will report error in the caller which is fixup_segment.

gas/
	* config/tc-csky.c (md_apply_fix): Do nothing here, just break
	from the switch-case.
---
 gas/config/tc-csky.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c
index 35a7252786c..343c4e6cdb4 100644
--- a/gas/config/tc-csky.c
+++ b/gas/config/tc-csky.c
@@ -5476,7 +5476,9 @@ md_apply_fix (fixS   *fixP,
 	  else if (fixP->fx_size == 1 && val >= -256 && val <= 255)
 	    ;
 	  else
-	    abort ();
+	    /* Do nothing if overflow. It will report error in fixup_segment */
+	    break;
+
 	  md_number_to_chars (buf, val, fixP->fx_size);
 	  fixP->fx_done = 1;
 	}
-- 
2.17.1



More information about the Binutils mailing list