From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4237 invoked by alias); 6 Feb 2014 17:43:04 -0000 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 Received: (qmail 4226 invoked by uid 89); 6 Feb 2014 17:43:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Feb 2014 17:43:02 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s16HgvfO001235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Feb 2014 12:42:58 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s16Hguxv020454; Thu, 6 Feb 2014 12:42:56 -0500 Message-ID: <52F3C99F.5060500@redhat.com> Date: Thu, 06 Feb 2014 17:43:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Will Newton CC: gdb-patches@sourceware.org, Patch Tracking Subject: Re: [PATCH] gdb/elfread.c: Enable ifunc support on ARM. References: <52AF4563.2090304@linaro.org> In-Reply-To: <52AF4563.2090304@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-02/txt/msg00114.txt.bz2 On 12/16/2013 06:24 PM, Will Newton wrote: > > There are two failures in the gnu-ifunc.exp test on ARM. These are > due to the failure to resolve the correct target function when > attempting to breakpoint a GNU ifunc resolved function: > > (gdb) break gnu_ifunc > Breakpoint 4 at gnu-indirect-function resolver at 0x2aacb5a2 > > when gnu_ifunc has been resolved this should actually be: > > (gdb) break gnu_ifunc > Breakpoint 4 at 0x868c > > There are two reasons for this. The first is that ARM does not have a > separate .got.plt section so looking this up will always fail. The second > is that the Thumb bit needs to be stripped from the address to allow > it to be reliably compared when inserting into the ifunc cache. > > Tested with no regressions on arm-linux-gnueabihf and > x86_64-unknown-linux-gnu. > > gdb/ChangeLog: > > 2013-12-16 Will Newton > > * elfread.c (elf_rel_plt_read): Look for a .got section if > looking up .got.plt fails. > (elf_gnu_ifunc_resolve_by_got): Call gdbarch_addr_bits_remove > on address passed to elf_gnu_ifunc_record_cache. > (elf_gnu_ifunc_resolve_addr): Likewise. > (elf_gnu_ifunc_resolver_return_stop): Likewise. Couple notes: - I think you can look at 'get_elf_backend_data (abfd)->want_got_plt' to decide whether to look up ".got" vs ".got.plt". - I'm also wondering whether got.plt in the symbol names (#define SYMBOL_GOT_PLT_SUFFIX "@got.plt") won't be a little confusing, and thus that prefix too should be decided on a want_got_plt basis, similarly. -- Pedro Alves