diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2024-02-26 16:03:06 -1000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2024-02-29 08:47:59 -1000 |
| commit | b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2 (patch) | |
| tree | edf7281d4b9bd7201890201f4299feb05df3b149 | |
| parent | f93b9953703be41408d5f0e09a871775d4be3c36 (diff) | |
| download | focaccia-qemu-b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2.tar.gz focaccia-qemu-b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2.zip | |
linux-user/elfload: Merge init_note_info and fill_note_info
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
| -rw-r--r-- | linux-user/elfload.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index fb47fe39c9..7b3a2c20f2 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -4514,16 +4514,6 @@ static void fill_thread_info(struct elf_note_info *info, const CPUArchState *env info->notes_size += note_size(&ets->notes[0]); } -static void init_note_info(struct elf_note_info *info) -{ - /* Initialize the elf_note_info structure so that it is at - * least safe to call free_note_info() on it. Must be - * called before calling fill_note_info(). - */ - memset(info, 0, sizeof (*info)); - QTAILQ_INIT(&info->thread_list); -} - static int fill_note_info(struct elf_note_info *info, long signr, const CPUArchState *env) { @@ -4532,6 +4522,9 @@ static int fill_note_info(struct elf_note_info *info, TaskState *ts = (TaskState *)cpu->opaque; int i; + memset(info, 0, sizeof (*info)); + QTAILQ_INIT(&info->thread_list); + info->notes = g_new0(struct memelfnote, NUMNOTES); if (info->notes == NULL) return (-ENOMEM); @@ -4665,8 +4658,6 @@ static int elf_core_dump(int signr, const CPUArchState *env) int segs = 0; int fd = -1; - init_note_info(&info); - errno = 0; if (prctl(PR_GET_DUMPABLE) == 0) { |