diff options
author | Alan Modra <amodra@gmail.com> | 2024-12-24 11:28:46 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-12-24 14:54:19 +1030 |
commit | 1eb397a6d20b312df11e787533f32d2312ced215 (patch) | |
tree | ec96205b85e7846f977a9c8a29d9a975898c9ca6 /bfd/som.h | |
parent | bbc969306f8d5fb6c7b636e25f6f8e278946ef23 (diff) | |
download | binutils-1eb397a6d20b312df11e787533f32d2312ced215.zip binutils-1eb397a6d20b312df11e787533f32d2312ced215.tar.gz binutils-1eb397a6d20b312df11e787533f32d2312ced215.tar.bz2 |
arc: add_to_decodelist
Given objdump -Mcpu=archs -D or similar, add_to_decodelist adds three
entries to decodelist for each instruction disassembled. That can
waste a lot of cpu when the list grows large. What's more,
decodelist is static and nothing clears the list. So the list
persists from one file to the next if objdump is disassembling
multiple files in one invocation. Wrong disassembly might result.
To fix this problem, I've moved decodelist to the arc private_data and
made it an array. I believe that init_disassemble_data will be
called, clearing private_data, for each file disassembled. That's
certainly true for objdump, and if I can see my way around gdb
constructors, it's also true for gdb. I don't think there is a
possibility of info.disassembler_options changing unless there is
first a call to init_disassebled_data. That means all of the option
parsing and bfd mach and e_flags decoding need only be done when
initialising the arc private_data.
* arc-dis.c (addrtypenames_max, addrtypeunknown): Delete..
(get_addrtype): ..substitute values here. Tidy.
(skipclass_t, linkclass, decodelist): Delete.
(enforced_isa_mask, print_hex): Delete.
(struct arc_disassemble_info): Add decode[], decode_count,
isa_mask, print_hex.
(init_arc_disasm_info): Tidy.
(add_to_decodelist): Delete, replacing with..
(add_to_decode): ..this. Don't duplicate entries.
(skip_this_opcode): Adjust to suit.
(find_format_from_table, parse_option): Likewise.
(parse_disassembler_options): Likewise. Move code dealing
with bfd mach and eflags from..
(print_insn_arc): ..here. Adjust for other changes.
Diffstat (limited to 'bfd/som.h')
0 files changed, 0 insertions, 0 deletions