From: Jan Beulich Date: Mon, 22 Dec 2025 10:06:59 +0000 (+0100) Subject: gas: stub out sframe-opt.c functions when SFrame is not supported X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2db59a7a276a77eef1e70f545fb4344cc7696a0;p=thirdparty%2Fbinutils-gdb.git gas: stub out sframe-opt.c functions when SFrame is not supported 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. --- diff --git a/gas/sframe-opt.c b/gas/sframe-opt.c index 65520734828..6787ca562b1 100644 --- a/gas/sframe-opt.c +++ b/gas/sframe-opt.c @@ -21,6 +21,12 @@ #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