1Upstream-Status: Submitted [https://github.com/COVESA/dlt-daemon/pull/567]
2
3From c84e48f6986054cf8b9459e608235b7bd1635746 Mon Sep 17 00:00:00 2001
4From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
5Date: Mon, 13 Nov 2023 12:37:23 +0100
6Subject: [PATCH] dlt_cdh:
7
8Make sure on 64 bit we read an ELF64 structure.
9Otherwise we get a read error, and the context file is missing some good
10to know information
11---
12 src/core_dump_handler/dlt_cdh.h | 7 +++++++
13 1 file changed, 7 insertions(+)
14
15diff --git a/src/core_dump_handler/dlt_cdh.h b/src/core_dump_handler/dlt_cdh.h
16index 8608c6c4..3dac480a 100644
17--- a/src/core_dump_handler/dlt_cdh.h
18+++ b/src/core_dump_handler/dlt_cdh.h
19@@ -45,10 +45,17 @@
20 #define CORE_FILE_PATTERN           "%s/core.%d.%s.%d.gz"
21 #define CONTEXT_FILE_PATTERN        "%s/context.%d.%s.%d.txt"
22
23+#if ((__SIZEOF_POINTER) == 4)
24 #define ELF_Ehdr    Elf32_Ehdr
25 #define ELF_Phdr    Elf32_Phdr
26 #define ELF_Shdr    Elf32_Shdr
27 #define ELF_Nhdr    Elf32_Nhdr
28+#else
29+#define ELF_Ehdr    Elf64_Ehdr
30+#define ELF_Phdr    Elf64_Phdr
31+#define ELF_Shdr    Elf64_Shdr
32+#define ELF_Nhdr    Elf64_Nhdr
33+#endif
34
35 typedef struct
36 {
37