From 15e72ccbc53a7d65b9fc6eeb57fc6ae51f4f595c Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Sun, 31 Jul 2022 14:03:25 +0900 Subject: [PATCH] RISC-V: Make mapping symbol checking consistent There were two places where the mapping symbols are checked but had different conditions. - riscv_get_map_state: "$x" or "$d" - riscv_elf_is_mapping_symbols: Starts with either "$x" or "$d" Considering recent proposals and Nelson's "RISC-V: Output mapping symbols with ISA string once .option arch is used.", it's better to make symbol checking consistent (whether the symbol _starts_ with "$[xd]"). opcodes/ChangeLog: * riscv-dis.c (riscv_get_map_state): Change the condition for consistency. --- opcodes/riscv-dis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index 9291d21bf48..65f8212e455 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -880,9 +880,9 @@ riscv_get_map_state (int n, return false; name = bfd_asymbol_name(info->symtab[n]); - if (strcmp (name, "$x") == 0) + if (startswith (name, "$x")) *state = MAP_INSN; - else if (strcmp (name, "$d") == 0) + else if (startswith (name, "$d")) *state = MAP_DATA; else return false;