gas: sframe: fine tune the fragment fixup for SFrame func info
SFrame function info is an unsigned 8-bit field comprising of the following
(from LSB to MSB):
- 4-bits: FRE type
- 1-bit: FRE start address encoding
- 3-bits: Unused
At the moment, the most-significat 4-bits are zero (The FRE start
address encoding of SFRAME_FDE_TYPE_PCINC has a value of zero, and the upper
3-bits are unused). So the current implementation works without this patch.
To be precise, however, the fragment fixup logic is meant to fixup only the
least-significant 4-bits (i.e., only the FRE type needs to be updated
according to the function size).
This patch makes the gas implementation a bit more resilient: In the
future, when the format does evolve to make use of the currently unused
3-bits in various ways, the values in those 3-bits can be propagated
unchanged while the fragment fixup continues to update the lowermost
4-bits to indicate the selected FRE type.
ChangeLog:
* gas/gen-sframe.c (create_func_info_exp): New definition.
(output_sframe_funcdesc): Call create_func_info_exp.
* gas/sframe-opt.c (sframe_estimate_size_before_relax): The
associated fragment uses O_modulus now.
(sframe_convert_frag): Adjust the fragment fixup code according
to the new composite exp.