]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Move all global static target stuff into private data for disassembler.
authorNelson Chu <nelson@rivosinc.com>
Thu, 6 Feb 2025 13:47:37 +0000 (21:47 +0800)
committerNelson Chu <nelson@rivosinc.com>
Tue, 11 Feb 2025 06:30:39 +0000 (14:30 +0800)
commit3f61a38b5e81569357bd15fbcf7fcb1dab3ee2db
treed69be4a54b6dd13e8f2bd8f8acf2ee51ce13752c
parente90210d9bb2776f4e8cf29d36b3b190dfa1b4e6d
RISC-V: Move all global static target stuff into private data for disassembler.

I got a request said that the JDK multi-thread compiler may be broken
if two or more threads are trying to print/disassemble stuff, and filling
the disassemble_info, setting callbacks, and grabbing the function pointer
to disasm at the same time.  Since such as the target global static stuff,
including subset of extensions and mapping symbol stuff, seems to only be
one globally.  Ideally, for dis-assembler, all global static target stuff
should/can be better to be defined into the target private data, since they
are target-dependency.

opcodes/
* riscv-dis.c: Moved all global static target-dependency stuff into
riscv_private_data, including architecture and mapping symbol stuff.
(set_default_riscv_dis_options): Updated since global static target-
dependency stuff are moved into riscv_private_data.
(parse_riscv_dis_option_without_args): Likewise.
(parse_riscv_dis_option): Likewise.
(parse_riscv_dis_options): Likewise.
(maybe_print_address): Likewise.
(print_reg_list): Likewise.
(riscv_get_spimm): Likewise.
(print_insn_args): Likewise.
(riscv_disassemble_insn): Likewise.
(riscv_update_map_state): Likewise.
(riscv_search_mapping_symbol): Likewise.
(riscv_data_length): Likewise.
(print_insn_riscv): Likewise.  Call the riscv_init_disasm_info before
parsing any disassembler options, since the related stuff are moved
into riscv_private_data.
(riscv_init_disasm_info): Likewise.  Parse and set the architecture
string and privileged spec version since riscv_get_disassembler is
no longer needed.
(riscv_get_disassembler): Removed.
(disassemble_free_riscv): Only free the subset_list if
riscv_private_data exsits.
* disassemble.c (disassembler): Since riscv_get_disassembler is
removed, call to print_insn_riscv.
* disassemble.h: Removed extern riscv_get_disassembler.
opcodes/disassemble.c
opcodes/disassemble.h
opcodes/riscv-dis.c