[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/20] contrib/elf2dmp: Use lduw_le_p() to read PDB
From: |
Peter Maydell |
Subject: |
[PULL 14/20] contrib/elf2dmp: Use lduw_le_p() to read PDB |
Date: |
Mon, 11 Mar 2024 19:12:35 +0000 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
The relevant value may be unaligned and is little-endian.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20240307-elf2dmp-v4-13-4f324ad4d99d@daynix.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
contrib/elf2dmp/pdb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/elf2dmp/pdb.c b/contrib/elf2dmp/pdb.c
index 1c505142518..492aca4434c 100644
--- a/contrib/elf2dmp/pdb.c
+++ b/contrib/elf2dmp/pdb.c
@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/bswap.h"
#include "pdb.h"
#include "err.h"
@@ -186,7 +187,7 @@ static bool pdb_init_symbols(struct pdb_reader *r)
r->symbols = symbols;
- r->segments = *(uint16_t *)((const char *)symbols + sizeof(PDB_SYMBOLS) +
+ r->segments = lduw_le_p((const char *)symbols + sizeof(PDB_SYMBOLS) +
symbols->module_size + symbols->offset_size +
symbols->hash_size + symbols->srcmodule_size +
symbols->pdbimport_size + symbols->unknown2_size +
--
2.34.1
- [PULL 08/20] contrib/elf2dmp: Fix error reporting style in pdb.c, (continued)
- [PULL 08/20] contrib/elf2dmp: Fix error reporting style in pdb.c, Peter Maydell, 2024/03/11
- [PULL 15/20] contrib/elf2dmp: Use rol64() to decode, Peter Maydell, 2024/03/11
- [PULL 12/20] contrib/elf2dmp: Always destroy PA space, Peter Maydell, 2024/03/11
- [PULL 18/20] contrib/elf2dmp: Clamp QEMU note to file size, Peter Maydell, 2024/03/11
- [PULL 11/20] contrib/elf2dmp: Always check for PA resolution failure, Peter Maydell, 2024/03/11
- [PULL 20/20] docs: update copyright date to the year 2024, Peter Maydell, 2024/03/11
- [PULL 01/20] hw/arm: Deprecate various old Arm machine types, Peter Maydell, 2024/03/11
- [PULL 07/20] contrib/elf2dmp: Fix error reporting style in download.c, Peter Maydell, 2024/03/11
- [PULL 04/20] contrib/elf2dmp: Continue even contexts are lacking, Peter Maydell, 2024/03/11
- [PULL 02/20] contrib/elf2dmp: Remove unnecessary err flags, Peter Maydell, 2024/03/11
- [PULL 14/20] contrib/elf2dmp: Use lduw_le_p() to read PDB,
Peter Maydell <=
- [PULL 13/20] contrib/elf2dmp: Ensure segment fits in file, Peter Maydell, 2024/03/11
- [PULL 09/20] contrib/elf2dmp: Fix error reporting style in qemu_elf.c, Peter Maydell, 2024/03/11
- [PULL 05/20] contrib/elf2dmp: Change pa_space_create() signature, Peter Maydell, 2024/03/11
- [PULL 06/20] contrib/elf2dmp: Fix error reporting style in addrspace.c, Peter Maydell, 2024/03/11
- [PULL 17/20] contrib/elf2dmp: Use GPtrArray, Peter Maydell, 2024/03/11
- [PULL 10/20] contrib/elf2dmp: Fix error reporting style in main.c, Peter Maydell, 2024/03/11
- [PULL 16/20] MAINTAINERS: Add Akihiko Odaki as a elf2dmp reviewer, Peter Maydell, 2024/03/11
- [PULL 19/20] contrib/elf2dmp: Ensure phdrs fit in file, Peter Maydell, 2024/03/11
- Re: [PULL 00/20] target-arm queue, Peter Maydell, 2024/03/12