From patchwork Thu Sep 1 07:40:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 15148 Received: (qmail 29674 invoked by alias); 1 Sep 2016 07:41:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 29655 invoked by uid 89); 1 Sep 2016 07:41:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:pinskia, U*pinskia, PRINT, pinskia@gmail.com X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Sep 2016 07:41:00 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DD1F2ABDC; Thu, 1 Sep 2016 07:40:56 +0000 (UTC) From: Andreas Schwab To: Andrew Pinski Cc: Andrew Pinski , "gdb-patches\@sourceware.org" , binutils Subject: Re: [PATCH 2/3] Add ILP32 support to gdb. References: <1472516750-30743-1-git-send-email-apinski@cavium.com> <1472516750-30743-3-git-send-email-apinski@cavium.com> X-Yow: Join the PLUMBER'S UNION!! Date: Thu, 01 Sep 2016 09:40:56 +0200 In-Reply-To: (Andrew Pinski's message of "Wed, 31 Aug 2016 21:20:55 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 On Sep 01 2016, Andrew Pinski wrote: > On Tue, Aug 30, 2016 at 12:44 AM, Andreas Schwab wrote: >> On Aug 30 2016, Andrew Pinski wrote: >> >>> @@ -2695,6 +2696,11 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) >>> return NULL; >>> } >>> >>> + if (info.abfd >>> + && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour >>> + && elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS32) >>> + ilp32 = TRUE; >>> + >> >> Shouldn't this use bfd_arch_bits_per_address? > > That does not work as bfd_arch_bits_per_address is set to 64 still. Actually I meant bfd_get_arch_size. Does this fix the bits_per_address issue? * cpu-aarch64.c (N): Add argument ADDRSIZE. (bfd_aarch64_arch_ilp32): Pass 32 here. (bfd_aarch64_arch): Pass 64 here. --- bfd/cpu-aarch64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bfd/cpu-aarch64.c b/bfd/cpu-aarch64.c index 6fb9133..ae0c8a9 100644 --- a/bfd/cpu-aarch64.c +++ b/bfd/cpu-aarch64.c @@ -78,16 +78,16 @@ scan (const struct bfd_arch_info *info, const char *string) return FALSE; } -#define N(NUMBER, PRINT, DEFAULT, NEXT) \ - { 64, 64, 8, bfd_arch_aarch64, NUMBER, \ +#define N(NUMBER, PRINT, ADDRSIZE, DEFAULT, NEXT) \ + { 64, ADDRSIZE, 8, bfd_arch_aarch64, NUMBER, \ "aarch64", PRINT, 4, DEFAULT, compatible, scan, \ bfd_arch_default_fill, NEXT } static const bfd_arch_info_type bfd_aarch64_arch_ilp32 = - N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", FALSE, NULL); + N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", 32, FALSE, NULL); const bfd_arch_info_type bfd_aarch64_arch = - N (0, "aarch64", TRUE, &bfd_aarch64_arch_ilp32); + N (0, "aarch64", 64, TRUE, &bfd_aarch64_arch_ilp32); bfd_boolean bfd_is_aarch64_special_symbol_name (const char *name, int type)