]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: stub out sframe-opt.c functions when SFrame is not supported
authorJan Beulich <jbeulich@suse.com>
Mon, 22 Dec 2025 10:06:59 +0000 (11:06 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 22 Dec 2025 10:06:59 +0000 (11:06 +0100)
Much like everything in gen-sframe.c, these functions are supposed to
never be reached when SFrame isn't supported by a target. Adding
respective assertions reduces code size for such targets, while at the
same time adding consistency checking for targets which optionally
support the feature.

gas/sframe-opt.c

index 655207348282dbc36fe1027f7e4a58495b1714f0..6787ca562b13f3806f30996ef838b6d5d350cacd 100644 (file)
 #include "as.h"
 #include "sframe.h"
 
+/* Much like everything in gen-sframe.c, the functions here aren't supposed
+   to ever be reached when SFrame isn't supported by a target.  */
+#ifndef support_sframe_p
+# define support_sframe_p() false
+#endif
+
 /* The function estimates the size of a rs_sframe variant frag based on
    the current values of the symbols.  It is called before the
    relaxation loop.  We set fr_subtype{0:2} to the expected length.  */
@@ -33,6 +39,8 @@ sframe_estimate_size_before_relax (fragS *frag)
   symbolS *widthS;
   int ret;
 
+  gas_assert (support_sframe_p ());
+
   /* We are dealing with two different kind of fragments here which need
      to be fixed up:
        - first, FRE start address in each FRE, and
@@ -75,6 +83,8 @@ sframe_relax_frag (fragS *frag)
 {
   int oldsize, newsize;
 
+  gas_assert (support_sframe_p ());
+
   oldsize = frag->fr_subtype & 7;
   if (oldsize == 7)
     oldsize = -1;
@@ -101,6 +111,8 @@ sframe_convert_frag (fragS *frag)
   symbolS *dataS;
   symbolS *fsizeS, *diffS;
 
+  gas_assert (support_sframe_p ());
+
   /* We are dealing with two different kind of fragments here which need
      to be fixed up:
        - first, FRE start address in each FRE, and