[PATCH] c6x: fix unwinding instructions for some values of cfa_offset

Richard Braun rbraun@sceen.net
Sat Dec 27 21:31:00 GMT 2025


From: Richard Braun <richard.braun@sbg-systems.com>

See C6000 EABI (SPRAB89A) Table 21. Stack unwinding instructions.

gas/
	* config/tc-tic6x.c (tic6x_output_unwinding): Fix unwinding
	byte value.
---
 gas/config/tc-tic6x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index eb19309d5c9..39a8a7c7eaa 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -4975,7 +4975,7 @@ tic6x_output_unwinding (bool need_extab)
 	  else if (cfa_offset > 0x40)
 	    {
 	      tic6x_unwind_byte (UNWIND_OP_ADD_SP | 0x3f);
-	      tic6x_unwind_byte (UNWIND_OP_ADD_SP | (cfa_offset - 0x40));
+	      tic6x_unwind_byte (UNWIND_OP_ADD_SP | (cfa_offset - 0x40 - 1));
 	    }
 	  else
 	    {
-- 
2.47.3



More information about the Binutils mailing list