|
| 1 | +From d039200a7ee8ac170afbdc3b987af553c07fb6a3 Mon Sep 17 00:00:00 2001 |
| 2 | +From: J?r?me Gardou <jerome.gardou@gmail.com> |
| 3 | +Date: Fri, 23 Apr 2021 16:33:47 +0100 |
| 4 | +Subject: [PATCH] Allow .seh_pushframe to take an optional [code] parameter |
| 5 | + |
| 6 | + * config/obj-coff-seh.c (obj_coff_seh_pushframe): Allow an |
| 7 | + optional "code" argument. |
| 8 | +--- |
| 9 | + gas/ChangeLog | 5 +++++ |
| 10 | + gas/config/obj-coff-seh.c | 21 ++++++++++++++++++++- |
| 11 | + 2 files changed, 25 insertions(+), 1 deletion(-) |
| 12 | + |
| 13 | +diff --git a/gas/ChangeLog b/gas/ChangeLog |
| 14 | +index 7fe07770b61..aedc6ea48a9 100644 |
| 15 | +--- a/gas/ChangeLog |
| 16 | ++++ b/gas/ChangeLog |
| 17 | +@@ -1,3 +1,8 @@ |
| 18 | ++2021-04-23 Jérôme Gardou <jerome.gardou@gmail.com> |
| 19 | ++ |
| 20 | ++ * config/obj-coff-seh.c (obj_coff_seh_pushframe): Allow an |
| 21 | ++ optional "code" argument. |
| 22 | ++ |
| 23 | + 2021-04-23 Jan Beulich <jbeulich@suse.com> |
| 24 | + |
| 25 | + * config/tc-i386.c (want_disp32): New. |
| 26 | +diff --git a/gas/config/obj-coff-seh.c b/gas/config/obj-coff-seh.c |
| 27 | +index 964fe87e0ac..f907e729bcf 100644 |
| 28 | +--- a/gas/config/obj-coff-seh.c |
| 29 | ++++ b/gas/config/obj-coff-seh.c |
| 30 | +@@ -582,12 +582,31 @@ obj_coff_seh_pushreg (int what ATTRIBUTE_UNUSED) |
| 31 | + static void |
| 32 | + obj_coff_seh_pushframe (int what ATTRIBUTE_UNUSED) |
| 33 | + { |
| 34 | ++ int code = 0; |
| 35 | ++ |
| 36 | + if (!verify_context_and_target (".seh_pushframe", seh_kind_x64) |
| 37 | + || !seh_validate_seg (".seh_pushframe")) |
| 38 | + return; |
| 39 | ++ |
| 40 | ++ SKIP_WHITESPACE(); |
| 41 | ++ |
| 42 | ++ if (is_name_beginner (*input_line_pointer)) |
| 43 | ++ { |
| 44 | ++ char* identifier; |
| 45 | ++ |
| 46 | ++ get_symbol_name (&identifier); |
| 47 | ++ if (strcmp (identifier, "code") != 0) |
| 48 | ++ { |
| 49 | ++ as_bad(_("invalid argument \"%s\" for .seh_pushframe. Expected \"code\" or nothing"), |
| 50 | ++ identifier); |
| 51 | ++ return; |
| 52 | ++ } |
| 53 | ++ code = 1; |
| 54 | ++ } |
| 55 | ++ |
| 56 | + demand_empty_rest_of_line (); |
| 57 | + |
| 58 | +- seh_x64_make_prologue_element (UWOP_PUSH_MACHFRAME, 0, 0); |
| 59 | ++ seh_x64_make_prologue_element (UWOP_PUSH_MACHFRAME, code, 0); |
| 60 | + } |
| 61 | + |
| 62 | + /* Add a register save-unwind token to current context. */ |
| 63 | +-- |
| 64 | +2.27.0 |
| 65 | + |
0 commit comments