[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.2 49/57] win32: avoid discarding the exception handler
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.2 49/57] win32: avoid discarding the exception handler |
Date: |
Fri, 6 Oct 2023 21:14:38 +0300 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
In all likelihood, the compiler with lto doesn't see the function being
used, from assembly macro __try1. Help it by marking the function has
being used.
Resolves:
https://gitlab.com/qemu-project/qemu/-/issues/1904
Fixes: commit d89f30b4df ("win32: wrap socket close() with an exception
handler")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 75b773d84c89220463a14a6883d2b2a8e49e5b68)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(mjt: trivial context fixup in include/qemu/compiler.h)
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index a309f90c76..5c7f63f351 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -197,4 +197,10 @@
#define BUILTIN_SUBCLL_BROKEN
#endif
+#if __has_attribute(used)
+# define QEMU_USED __attribute__((used))
+#else
+# define QEMU_USED
+#endif
+
#endif /* COMPILER_H */
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 19a0ea7fbe..55b0189dc3 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -479,7 +479,7 @@ int qemu_bind_wrap(int sockfd, const struct sockaddr *addr,
return ret;
}
-EXCEPTION_DISPOSITION
+QEMU_USED EXCEPTION_DISPOSITION
win32_close_exception_handler(struct _EXCEPTION_RECORD *exception_record,
void *registration, struct _CONTEXT *context,
void *dispatcher)
--
2.39.2
- [Stable-8.1.2 00/57] Patch Round-up for stable 8.1.2, freeze on 2023-10-14, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 46/57] subprojects/berkeley-testfloat-3: Update to fix a problem with compiler warnings, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 47/57] target/i386: generalize operand size "ph" for use in CVTPS2PD, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 48/57] target/i386: fix memory operand size for CVTPS2PD, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 49/57] win32: avoid discarding the exception handler,
Michael Tokarev <=
- [Stable-8.1.2 50/57] hw/display/ramfb: plug slight guest-triggerable leak on mode setting, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 51/57] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 52/57] linux-user/hppa: Fix struct target_sigcontext layout, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 53/57] vdpa net: zero vhost_vdpa iova_tree pointer at cleanup, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 54/57] vdpa net: fix error message setting virtio status, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 55/57] vdpa net: stop probing if cannot set features, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 56/57] vdpa net: follow VirtIO initialization properly at cvq isolation probing, Michael Tokarev, 2023/10/06
- [Stable-8.1.2 57/57] amd_iommu: Fix APIC address check, Michael Tokarev, 2023/10/06