Hi all,

Please find the attached patch which adds an ARM64 stub for the $fe routine in
the gendef script.

Any feedback or nits are very welcome. The changes are documented with inline
comments and is intended to be self-explanatory. please let me know if any part
of this patch should be adjusted.

Thanks for your time and review.

Thanks & regards
Thirumalai Nagalingam <[email protected]>

In-lined patch:

diff --git a/winsup/cygwin/scripts/gendef b/winsup/cygwin/scripts/gendef
index a4226be62..1419704b8 100755
--- a/winsup/cygwin/scripts/gendef
+++ b/winsup/cygwin/scripts/gendef
@@ -115,7 +115,18 @@ EOF
        $res = <<EOF;
        .extern $func
        .global $fe
+       .seh_proc $fe
 $fe:
+       sub sp, sp, 16                  // allocate stack, 16-byte alligned
+       .seh_stackalloc 16              // SEH: describe stack allocation
+       .seh_endprologue                // end of prologue for unwinder
+       adrp x9, $func                  // load page address of func
+       add x9, x9, :lo12:$func         // compute full address of func
+       str x9, [sp, 0]                 // store func pointer on stack
+       adrp x9, $sigfe_func            // load page address of sigfe_func
+       add x9, x9, :lo12:$sigfe_func   // compute final address of sigfe_func
+       br x9                           // branch to x9
+       .seh_endproc
 EOF
     }


Attachment: 0001-Cygwin-gendef-add-ARM64-stub-for-fe-in-gendef.patch
Description: 0001-Cygwin-gendef-add-ARM64-stub-for-fe-in-gendef.patch

Reply via email to