From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29120 invoked by alias); 8 Jun 2011 15:55:30 -0000 Received: (qmail 29103 invoked by uid 22791); 8 Jun 2011 15:55:27 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from iona.labri.fr (HELO iona.labri.fr) (147.210.8.143) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Jun 2011 15:55:05 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by iona.labri.fr (Postfix) with ESMTP id 12E1636B8D for ; Wed, 8 Jun 2011 17:55:01 +0200 (CEST) Received: from iona.labri.fr ([127.0.0.1]) by localhost (iona.labri.fr [127.0.0.1]) (amavisd-new, port 10027) with LMTP id o6-2vAq+1MUL for ; Wed, 8 Jun 2011 17:55:00 +0200 (CEST) Received: from [147.210.8.12] (aldebaran.labri.fr [147.210.8.12]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by iona.labri.fr (Postfix) with ESMTP id EB48F36B78 for ; Wed, 8 Jun 2011 17:55:00 +0200 (CEST) Message-ID: <4DEF9B54.8050305@labri.fr> Date: Wed, 08 Jun 2011 15:55:00 -0000 From: Emmanuel Fleury User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Icedove/3.1.10 MIME-Version: 1.0 To: binutils@sourceware.org Subject: Re: [opcodes] bfd_flavour References: <4DED456F.2000408@labri.fr> <20110608142952.GE4172@bubble.grove.modra.org> In-Reply-To: <20110608142952.GE4172@bubble.grove.modra.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00099.txt.bz2 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