From: Indu Bhagat Date: Fri, 16 Jan 2026 00:42:46 +0000 (-0800) Subject: [SFrame-V3] gas: sframe: add new backend hook sframe_support_flex_fde_p for FLEX... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9b3987db53d7e0606f89bfe2527dd3d0915568;p=thirdparty%2Fbinutils-gdb.git [SFrame-V3] gas: sframe: add new backend hook sframe_support_flex_fde_p for FLEX FDEs For the newly added SFrame FDE type SFRAME_FDE_TYPE_FLEX, add a new backend hook so that the respective ABI/arch can opt out of the generation of SFRAME_FDE_TYPE_FLEX in GAS. AArch64 is an example of an ABI for which SFrame is supported, but one that does not need the flexible FDE representation for any of the current usecases currently. Reviewed-by: Jens Remus gas/ * config/tc-aarch64.c (aarch64_support_flex_fde_p): New definition. * config/tc-aarch64.h (aarch64_support_flex_fde_p): New declaration. (sframe_support_flex_fde_p): Define. * config/tc-i386.c (x86_support_flex_fde_p): New definition. * config/tc-i386.h (x86_support_flex_fde_p): New declaration. (sframe_support_flex_fde_p): Define. * config/tc-s390.c (s390_support_flex_fde_p): New definition. * config/tc-s390.h (s390_support_flex_fde_p): New declaration. (sframe_support_flex_fde_p): Define. --- diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 7b0d5d22b0c..0460bc8aef0 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -9282,6 +9282,14 @@ aarch64_sframe_ra_tracking_p (void) return true; } +/* Whether SFrame FDE of type SFRAME_FDE_TYPE_FLEX be generated. */ + +bool +aarch64_support_flex_fde_p (void) +{ + return false; +} + /* The fixed offset from CFA for SFrame to recover the return address. (useful only when SFrame RA tracking is not needed). */ diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h index dced9e42296..1b7cde747ac 100644 --- a/gas/config/tc-aarch64.h +++ b/gas/config/tc-aarch64.h @@ -339,6 +339,10 @@ extern offsetT aarch64_sframe_cfa_ra_offset (void); unsigned char aarch64_sframe_get_abi_arch (void); #define sframe_get_abi_arch aarch64_sframe_get_abi_arch +/* Whether SFrame FDE of type SFRAME_FDE_TYPE_FLEX be generated. */ +extern bool aarch64_support_flex_fde_p (void); +#define sframe_support_flex_fde_p aarch64_support_flex_fde_p + #endif /* OBJ_ELF */ #define MD_PCREL_FROM_SECTION(F,S) md_pcrel_from_section(F,S) diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index b317536cc60..98f32049ffb 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -12172,6 +12172,13 @@ x86_sframe_ra_tracking_p (void) return false; } +/* Whether SFrame FDE of type SFRAME_FDE_TYPE_FLEX be generated. */ +bool +x86_support_flex_fde_p (void) +{ + return true; +} + /* The fixed offset from CFA for SFrame to recover the return address. (useful only when SFrame RA tracking is not needed). */ offsetT diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index 4eafa8b24fa..544064380df 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -478,6 +478,10 @@ extern offsetT x86_sframe_cfa_ra_offset (void); extern unsigned char x86_sframe_get_abi_arch (void); #define sframe_get_abi_arch x86_sframe_get_abi_arch +/* Whether SFrame FDE of type SFRAME_FDE_TYPE_FLEX be generated. */ +extern bool x86_support_flex_fde_p (void); +#define sframe_support_flex_fde_p x86_support_flex_fde_p + #endif #ifdef TE_PE diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c index 8f6bcfc2e84..7d7c56dc8a9 100644 --- a/gas/config/tc-s390.c +++ b/gas/config/tc-s390.c @@ -2905,6 +2905,14 @@ s390_sframe_ra_tracking_p (void) return true; } +/* Whether SFrame FDE of type SFRAME_FDE_TYPE_FLEX be generated. */ + +bool +s390_support_flex_fde_p (void) +{ + return false; +} + /* Specify the fixed offset to recover RA from CFA. (useful only when RA tracking is not needed). */ diff --git a/gas/config/tc-s390.h b/gas/config/tc-s390.h index 347a1dcef80..1511596a330 100644 --- a/gas/config/tc-s390.h +++ b/gas/config/tc-s390.h @@ -131,6 +131,10 @@ extern offsetT s390_sframe_cfa_ra_offset (void); unsigned char s390_sframe_get_abi_arch (void); #define sframe_get_abi_arch s390_sframe_get_abi_arch +/* Whether SFrame FDE of type SFRAME_FDE_TYPE_FLEX be generated. */ +extern bool s390_support_flex_fde_p (void); +#define sframe_support_flex_fde_p s390_support_flex_fde_p + /* The target supports Object Attributes. */ #define TC_OBJ_ATTR 1