From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10434 invoked by alias); 8 Jun 2011 14:34:53 -0000 Received: (qmail 10306 invoked by uid 22791); 8 Jun 2011 14:34:52 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-pw0-f41.google.com (HELO mail-pw0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Jun 2011 14:34:34 +0000 Received: by pwi12 with SMTP id 12so334440pwi.0 for ; Wed, 08 Jun 2011 07:34:34 -0700 (PDT) Received: by 10.68.57.7 with SMTP id e7mr715528pbq.525.1307543399369; Wed, 08 Jun 2011 07:29:59 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id w2sm557871pbg.21.2011.06.08.07.29.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2011 07:29:58 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D6189170C1B4; Wed, 8 Jun 2011 23:59:52 +0930 (CST) Date: Wed, 08 Jun 2011 14:34:00 -0000 From: Alan Modra To: Emmanuel Fleury Cc: binutils@sourceware.org Subject: Re: [opcodes] bfd_flavour Message-ID: <20110608142952.GE4172@bubble.grove.modra.org> Mail-Followup-To: Emmanuel Fleury , binutils@sourceware.org References: <4DED456F.2000408@labri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DED456F.2000408@labri.fr> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00096.txt.bz2 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)? If not, you don't need to worry. > (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) -- Alan Modra Australia Development Lab, IBM