Re: [PATCH 2/5] arc: Set section to ".text" when disassembling

Yao Qi
2017-02-15T22:27:29Z

On Tue, Feb 14, 2017 at 10:01 AM, Anton Kolesov
<Anton.Kolesov@synopsys.com> wrote:
> +
> + /* ARC disassembler requires that info->section is valid - it will be used to
> + access program headers of ELF files that is needed to distinguish between
> + ARC EM and HS (ARC600, ARC700 and ARC v2 can be distinguished by BFD's
> + `mach` attribute). Without this information disassembler will default to
> + ARC EM for ARC v2 targets, and it will not recognize instructions specific
> + to ARC HS, for example, double-word store and load. */
> + if (exec_bfd != NULL)
> + info->section = bfd_get_section_by_name (exec_bfd, ".text");

info->section should be valid, but why must it be ".text"? Can I disassembly
instructions in .plt section? How about using find_pc_section (addr) to get
the right section? like mep_gdb_print_insn.

--
Yao (齐尧)