Jacek Caban : dbghelp: Inline ELF magic constants.
Alexandre Julliard
julliard at winehq.org
Tue Mar 31 16:44:25 CDT 2020
Module: wine
Branch: master
Commit: 66ab2c503de6d39f1a0256d66511da05d326ac5e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=66ab2c503de6d39f1a0256d66511da05d326ac5e
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Mar 31 18:22:38 2020 +0200
dbghelp: Inline ELF magic constants.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dbghelp/elf_module.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index 4cbb09ff78..9449c9ab61 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/dbghelp/elf_module.c
@@ -387,7 +387,6 @@ static BOOL elf_map_shdr(struct elf_map_file_data* emfd, struct image_file_map*
*/
static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map* fmap)
{
- static const BYTE elf_signature[4] = { ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3 };
unsigned int i;
size_t tmp, page_mask = sysinfo.dwPageSize - 1;
WCHAR *dos_path;
@@ -419,10 +418,10 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
return FALSE;
/* and check for an ELF header */
- if (memcmp(e_ident, elf_signature, sizeof(elf_signature)))
+ if (memcmp(e_ident, "\177ELF", 4))
return FALSE;
- fmap->addr_size = e_ident[EI_CLASS] == ELFCLASS64 ? 64 : 32;
+ fmap->addr_size = e_ident[4] == 2 /* ELFCLASS64 */ ? 64 : 32;
if (fmap->addr_size == 32)
{
More information about the wine-cvs
mailing list