From f94ba214bd0582e7cbd2ef5d0d60cd749a17aa21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 27 Apr 2021 17:59:09 +0200 Subject: [PATCH] Add binutils patch until next gas version is released --- Patches/binutils-seh_pushframe-jgardou.patch | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Patches/binutils-seh_pushframe-jgardou.patch diff --git a/Patches/binutils-seh_pushframe-jgardou.patch b/Patches/binutils-seh_pushframe-jgardou.patch new file mode 100644 index 00000000..624fe038 --- /dev/null +++ b/Patches/binutils-seh_pushframe-jgardou.patch @@ -0,0 +1,40 @@ +diff --git a/gas/config/obj-coff-seh.c b/gas/config/obj-coff-seh.c +index 964fe87e0ac..f907e729bcf 100644 +--- a/gas/config/obj-coff-seh.c ++++ b/gas/config/obj-coff-seh.c +@@ -582,12 +582,31 @@ obj_coff_seh_pushreg (int what ATTRIBUTE_UNUSED) + static void + obj_coff_seh_pushframe (int what ATTRIBUTE_UNUSED) + { ++ int code = 0; ++ + if (!verify_context_and_target (".seh_pushframe", seh_kind_x64) + || !seh_validate_seg (".seh_pushframe")) + return; ++ ++ SKIP_WHITESPACE(); ++ ++ if (is_name_beginner (*input_line_pointer)) ++ { ++ char* identifier; ++ ++ get_symbol_name (&identifier); ++ if (strcmp (identifier, "code") != 0) ++ { ++ as_bad(_("invalid argument \"%s\" for .seh_pushframe. Expected \"code\" or nothing"), ++ identifier); ++ return; ++ } ++ code = 1; ++ } ++ + demand_empty_rest_of_line (); + +- seh_x64_make_prologue_element (UWOP_PUSH_MACHFRAME, 0, 0); ++ seh_x64_make_prologue_element (UWOP_PUSH_MACHFRAME, code, 0); + } + + /* Add a register save-unwind token to current context. */ +-- +2.27.0 +