Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: Mapping symbols with ISA string on disassembler
The mapping symbols with ISA string is proposed to deal with so called "ifunc issue". It enables disassembling a certain range of the code with a different architecture than the rest, even if conflicting. This is useful when there's "optimized" implementation is available but dynamically switched only if a certain extension is available. This commit implements the disassembler support to parse mapping symbols with ISA string. [1] Proposal: Extend .option directive for control enabled extensions on specific code region, riscv-non-isa/riscv-asm-manual#67 [2] Proposal: Add mapping symbol, riscv-non-isa/riscv-elf-psabi-doc#196 This commit is based on Nelson Chu's proposal "RISC-V: Output mapping symbols with ISA string once .option arch is used." but heavily modified to reflect the intent of Kito's original proposal. It is also made smarter so that it no longer requires MAP_INSN_ARCH. gas/ChangeLog: * testsuite/gas/riscv/option-arch-01a.d: Reflect the disassembler support of mapping symbols with ISA string. opcodes/ChangeLog: * riscv-dis.c (initial_default_arch) Default architecture string if no ELF attributes are available. (default_arch): A copy of the default architecture string. (is_arch_mapping): New variable to keep track of whether the current architecture is deviced from a mapping symbol. (riscv_disassemble_insn): Update FPR names when a mapping symbol with ISA string is encountered. (riscv_get_map_state): Support mapping symbols with ISA string. Use `is_arch_mapping' to stop repeatedly parsing the default architecture. (riscv_get_disassembler): Safer architecture string handling. Copy the string to switch to the default while disassembling.
- Loading branch information