[V2 21/36] [SFrame-V3] sframe: gas: s390: aarch64: x86: add new backend hooks for FLEX FDE

Indu Bhagat indu.bhagat@oracle.com
Wed Jan 7 08:42:12 GMT 2026


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.

TBD:
  - split out into arch specific patches ?

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.

---
[New in V1]

[No changes in V2]
---
 gas/config/tc-aarch64.c | 8 ++++++++
 gas/config/tc-aarch64.h | 4 ++++
 gas/config/tc-i386.c    | 7 +++++++
 gas/config/tc-i386.h    | 4 ++++
 gas/config/tc-s390.c    | 8 ++++++++
 gas/config/tc-s390.h    | 4 ++++
 6 files changed, 35 insertions(+)

diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 6a03dfe41ec..dbac47c7ff2 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 70e50384fbc..f6c28a53b1a 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 28b1f4192d8..47360de6a88 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -12079,6 +12079,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
 
-- 
2.43.0



More information about the Binutils mailing list