[RFC 13/28] [SFrame-V3] include: sframe: s390x: keep unused bits when possible
Jens Remus
jremus@linux.ibm.com
Fri Dec 12 17:32:12 GMT 2025
Hello Indu!
On 12/12/2025 5:28 PM, Jens Remus wrote:
> On 12/9/2025 10:07 AM, Indu Bhagat wrote:
>> TBD:
>> - This is a backwards incompatible change. But its better to keep unused
>> bits for future extensibility. Discuss with s390x SFrame maintainer.
>
> s390x may save FP/RA in registers when in the topmost frame, e.g. when
> in leaf function. Currently it does so in floating-point registers.
> These have the DWARF register numbers 16-31 on s390x. With the left
> shift by 3 these do no longer fit into a signed 8-bit offset:
>
> 16 << 3 = 128
> 31 << 3 = 248
>
> When considering this I would also evaluate whether it wouldn't be the
> better choice to use the new FLEX_TOPMOST_FRAME and get rid of this
> s390x-particularity.
>
> I am working on a prototype to get some numbers for Glibc:
>
> git://sourceware.org/git/binutils-gdb.git users/jremus/sframe-v3-c1-s390x
> https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/jremus/sframe-v3-c1-s390x
Some numbers from a Glibc build for libc.so:
SFrame V3 (vanilla)
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[16] .sframe GNU_SFRAME 00000000001dab10 1dab10 023553 00 A 0 0 8
Num FDEs: 3650
Num FREs: 15196
SFrame V3 with my hacked s390x prototype:
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[16] .sframe GNU_SFRAME 00000000001dab10 1dab10 023ac7 00 A 0 0 8 SFrame V3 + s390x
(+1396 bytes)
Num FDEs: 3655 (+5)
Num FREs: 15225 (+29)
I compared the objdump --sframe dumps. They are identical (ignoring the
+0 offsets), except for the following additional FDEs using my s390x
prototype:
func idx [243]: pc = 0x4bb80, size = 84 bytes <__longjmp>
STARTPC CFA FP RA
000000000004bb80 sp+160 u U
000000000004bba8 r1+0 r0+40 r4+0 <-- r1-based CFA, FP=r0, RA=r4
func idx [483]: pc = 0x5f110, size = 13138 bytes <__GI_____strtold_l_internal>, <____strtold_l_internal>
STARTPC CFA FP RA
000000000005f110 sp+160 u U
000000000005f116 sp+160 r0-72 r0-48
000000000005f122 r14+12448 r0-72 r0-48 <-- r14-based CFA
000000000005f13a sp+12448 r0-72 r0-48
000000000005f140 sp+14360 r0-72 r0-48
000000000005f32c sp+160 u U
000000000005f32e sp+14360 r0-72 r0-48
func idx [1567]: pc = 0xcfdf0, size = 11644 bytes <____wcstold_l_internal>
STARTPC CFA FP RA
00000000000cfdf0 sp+160 u U
00000000000cfdf6 sp+160 r0-72 r0-48
00000000000cfe02 r14+12448 r0-72 r0-48 <-- r14-based CFA
00000000000cfe1a sp+12448 r0-72 r0-48
00000000000cfe20 sp+14352 r0-72 r0-48
00000000000d00cc sp+160 u U
00000000000d00ce sp+14352 r0-72 r0-48
func idx [1831]: pc = 0xfdd10, size = 3948 bytes <build_trtable>
STARTPC CFA FP RA
00000000000fdd10 sp+160 u U
00000000000fdd16 sp+160 r0-72 r0-48
00000000000fdd1c r14+16544 r0-72 r0-48 <-- r14-based CFA
00000000000fdd34 sp+16544 r0-72 r0-48
00000000000fdd3a sp+19040 r0-72 r0-48
00000000000fe87a sp+160 u U
00000000000fe87c sp+19040 r0-72 r0-48
func idx [2503]: pc = 0x12d360, size = 200 bytes <____longjmp_chk>
STARTPC CFA FP RA
000000000012d360 sp+160 u U
000000000012d394 sp+160 u r0-48
000000000012d39c sp+344 u r0-48
000000000012d3e8 sp+160 u r0-48
000000000012d3f4 sp+160 u U
000000000012d3fc r1+0 r0+40 r4+0 <-- r1-based CFA, FP=r0, RA=r4
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@de.ibm.com
IBM
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/
More information about the Binutils
mailing list