From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8091 invoked by alias); 2 Mar 2009 21:03:14 -0000 Received: (qmail 8041 invoked by uid 22791); 2 Mar 2009 21:03:10 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Mar 2009 21:02:59 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n22L2mam026741; Mon, 2 Mar 2009 16:02:48 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n22L2nbM005429; Mon, 2 Mar 2009 16:02:49 -0500 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n22L2ld9024803; Mon, 2 Mar 2009 16:02:48 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n22L2jsE018560; Mon, 2 Mar 2009 22:02:46 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.2/Submit) id n22L2csv018463; Mon, 2 Mar 2009 22:02:38 +0100 Date: Mon, 02 Mar 2009 21:03:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Thiago Jung Bauermann , Peter Bergner Subject: [patch] Fix power7 ppc64 binaries loading Message-ID: <20090302210237.GA23798@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00019.txt.bz2 Hi, on the binary from: ./gas/as-new -mpower7 -o /tmp/power7c.o ./gas/testsuite/gas/ppc/power7.s Class: ELF64 Machine: PowerPC64 Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 4] .PPC.EMB.apuinfo PROGBITS 0000000000000000 000001e0 0000000000000018 0000000000000000 0 0 1 FSF GDB HEAD prints: $ ./gdb -q -nx -ex 'set pagination off' -ex 'x/100i 0' /tmp/power7.o A powerpc executable doesn't have indications of which variant it is meant to > run on. There is the tdesc_* infrastructure for this purpose for remote targets, there is a `info->disassembler_options = "any"' hack for local target by: http://sourceware.org/ml/gdb-patches/2007-02/msg00000.html http://sourceware.org/ml/gdb-cvs/2007-02/msg00061.html Regression tested on powerpc64-unknown-linux-gnu (PPC970MP). Thanks, Jan gdb/ 2009-03-02 Jan Kratochvil Fix power7 ppc64 binaries loading. * rs6000-tdep.c (rs6000_gdbarch_init): Remove variable `sect'. Remove the ppc32 e500 detection from `.PPC.EMB.apuinfo' section existence. diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 926d0b6..1c59a42 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -3326,7 +3331,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) enum bfd_architecture arch; unsigned long mach; bfd abfd; - asection *sect; enum auto_boolean soft_float_flag = powerpc_soft_float_global; int soft_float; enum powerpc_vector_abi vector_abi = powerpc_vector_abi_global; @@ -3375,26 +3379,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) arch = info.bfd_arch_info->arch; mach = info.bfd_arch_info->mach; - /* For e500 executables, the apuinfo section is of help here. Such - section contains the identifier and revision number of each - Application-specific Processing Unit that is present on the - chip. The content of the section is determined by the assembler - which looks at each instruction and determines which unit (and - which version of it) can execute it. In our case we just look for - the existance of the section. */ - - if (info.abfd) - { - sect = bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo"); - if (sect) - { - arch = info.bfd_arch_info->arch; - mach = bfd_mach_ppc_e500; - bfd_default_set_arch_mach (&abfd, arch, mach); - info.bfd_arch_info = bfd_get_arch_info (&abfd); - } - } - /* Find a default target description which describes our register layout, if we do not already have one. */ if (! tdesc_has_registers (tdesc))