[binutils-gdb] gas: dw2gencfi: reset reloc to TC_PARSE_CONS_RETURN_NONE for [su]leb128

Indu Bhagat ibhagat@sourceware.org
Mon Jan 5 22:36:23 GMT 2026


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

commit dfd1195bee9b6e051f2990741d4eb44d007d616a
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Fri Dec 19 20:29:34 2025 -0800

    gas: dw2gencfi: reset reloc to TC_PARSE_CONS_RETURN_NONE for [su]leb128
    
    Some consumers, like SFrame generation logic in GAS, may want to check
    reloc value (without qualifying by e->type) as a part of their
    admissibility criteria.  Setting reloc to TC_PARSE_CONS_RETURN_NONE for
    these CFI escape expr nodes for [su]leb128 keeps the admissibility
    checks simple and generic.
    
    Previous discussion here:
    https://sourceware.org/pipermail/binutils/2025-December/146807.html
    
    gas/
            * gas/dw2gencfi.c (dot_cfi_escape): Set reloc to
            TC_PARSE_CONS_RETURN_NONE.

Diff:
---
 gas/dw2gencfi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index b8a708c0da8..ee157636ef1 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -1006,6 +1006,7 @@ dot_cfi_escape (int ignored ATTRIBUTE_UNUSED)
 	  /* We're still at the opening parenthesis.  Leave it to expression()
 	     to parse it and find the matching closing one.  */
 	  expression (&e->exp);
+	  e->reloc = TC_PARSE_CONS_RETURN_NONE;
 	}
       else
 	{


More information about the Binutils-cvs mailing list