On 8/7/21 11:42 AM, Warner Losh wrote:
From: Warner Losh <i...@freebsd.org>

Add a stubbed-out version of the bsd-user fork's core dump support. This
allows elfload.c to be almost the same between what's upstream and
what's in qemu-project upstream w/o the burden of reviewing the core
dump support.

Signed-off-by: Stacey Son <s...@freebsd.org>
Signed-off-by: Warner Losh <i...@bsdimp.com>

Sponsored by:           Netflix
---
  bsd-user/elfcore.c | 10 ++++++++++
  bsd-user/elfload.c | 24 ++++++++++++++++++++++--
  bsd-user/qemu.h    |  6 ++++++
  3 files changed, 38 insertions(+), 2 deletions(-)
  create mode 100644 bsd-user/elfcore.c

diff --git a/bsd-user/elfcore.c b/bsd-user/elfcore.c
new file mode 100644
index 0000000000..e3c161942d
--- /dev/null
+++ b/bsd-user/elfcore.c
@@ -0,0 +1,10 @@
+/* Stubbed out version of core dump support, explicitly in public domain */
+
+static int elf_core_dump(int signr, CPUArchState *env)
+{
+    struct elf_note en;
+
+    bswap_note(&en);
+
+    return 0;
+}

No warnings from this, e.g. uninitialized variable?
If you have a chance, run this through clang-12 (mainline).
It it getting much better at identifying such stuff.

Otherwise,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~

Reply via email to