This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [opcodes] bfd_flavour
Hi,
On 06/08/2011 04:29 PM, Alan Modra wrote:
> On Mon, Jun 06, 2011 at 11:23:59PM +0200, Emmanuel Fleury wrote:
>> My question is: What bad can happen if I omit to set the flavour of the
>> binary that I'm disassembling when using the disassembler_fn of
>> libopcodes ?
>
> Is your target one of those that show up below (on the info->flavour
> matches, not the bfd_asymbol_flavour matches)?
No, the flavour was more about the CPU sub-architecture and not about
the format of the binary. But, I think I got confused with some other
structure... Sorry for that, I need to take a second look at it.
> If not, you don't need to worry.
Excellent. Thanks a lot.
>> (and, subsequently, what is used the bfd_flavour for in
>> libopcodes ?)
>
> $ grep flavour *.[ch]
> alpha-dis.c: if (info->flavour == bfd_target_evax_flavour)
> arm-dis.c: && bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour)
> arm-dis.c: if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
> arm-dis.c: else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour
> arm-dis.c: if (info->flavour == bfd_target_elf_flavour
> dis-init.c: info->flavour = bfd_target_unknown_flavour;
> mips-dis.c: if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
> mips-dis.c: if (info->flavour == bfd_target_unknown_flavour
> mips-dis.c: && info->flavour == bfd_target_unknown_flavour)
> mips-dis.c: if (!jalx && info->flavour == bfd_target_unknown_flavour)
> mips-dis.c: && bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour
> sh64-dis.c: && bfd_asymbol_flavour (info->symbols[0]) == bfd_target_elf_flavour
> sh64-dis.c: && bfd_get_flavour (info->section->owner) == bfd_target_elf_flavour)
> sh64-dis.c: && bfd_asymbol_flavour (info->symbols[0]) == bfd_target_elf_flavour
> sh64-dis.c: && bfd_asymbol_flavour (info->symbols[0]) == bfd_target_elf_flavour
> sh-dis.c: && bfd_asymbol_flavour(*info->symbols) == bfd_target_coff_flavour)
Ok.
Regards
--
Emmanuel Fleury
Before software should be reusable, it should be usable.
-- Ralph Johnson