From b0dc1f3529caa497e292707845ed77573d745d9e Mon Sep 17 00:00:00 2001 From: Thomas Gales Date: Tue, 28 Mar 2023 19:09:16 +0000 Subject: [PATCH] Add EM_RISCV as recognized value for ELF e_machine `dump_syms` fails to write symbol file without knowing how to convert the ELF `e_machine` field to a string. Use "riscv" as the value because ELF `e_machine` does not distinguish between 32 bit and 64 bit RISC-V. Test: run `dump_syms` on the libc++ that's shipped with the Clang toolchain, or any other riscv binary: `./dump_syms -r -n libc++.so -o Fuchsia /lib/riscv64-unknown-fuchsia/libc++.so.2.0` Bug: fuchsia:124084 Change-Id: Ic04db96ec3d3d484350bdd0b90c9dfb70d7f7eb2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4376828 Reviewed-by: Mike Frysinger --- src/common/linux/dump_symbols.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index 48e4c926..36687bf4 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -1022,6 +1022,7 @@ const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) { case EM_SPARC: return "sparc"; case EM_SPARCV9: return "sparcv9"; case EM_X86_64: return "x86_64"; + case EM_RISCV: return "riscv"; default: return NULL; } }