diff options
author | Thomas Gales <tgales@google.com> | 2023-03-28 19:09:16 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2023-03-28 20:32:38 +0000 |
commit | b0dc1f3529caa497e292707845ed77573d745d9e (patch) | |
tree | 5817d42978b31e4f839b8dc3b2e875650dfc0b17 | |
parent | c179ddaa58e0ec3093f98de555ad5791e9cb432a (diff) | |
download | google-breakpad-b0dc1f3529caa497e292707845ed77573d745d9e.tar.gz |
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 <clang_path>/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 <vapier@chromium.org>
-rw-r--r-- | src/common/linux/dump_symbols.cc | 1 |
1 files changed, 1 insertions, 0 deletions
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; } } |