From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17176 invoked by alias); 10 Feb 2014 14:57:49 -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 17163 invoked by uid 89); 10 Feb 2014 14:57:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f51.google.com Received: from mail-yh0-f51.google.com (HELO mail-yh0-f51.google.com) (209.85.213.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 10 Feb 2014 14:57:48 +0000 Received: by mail-yh0-f51.google.com with SMTP id t59so5162983yho.24 for ; Mon, 10 Feb 2014 06:57:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=K0lJ+wQkfNPIjT8F9uUjoqBOIx77mn/KQVMYj5DayBw=; b=bkaZE/+Ves0nOCa4rKdZW4XEoBZ0pOhkm+ha+nK4pDN8VZ+69o8NS7H+H/f7rRvwiM wJwl02bbf21ZMLMHwFlZv7GRul6oE4AMuc+Zczb8Es8HBow/1dtinNxnUJgg93Sd5T7H gnyUNYoYuq5illau75dvgqumZmd+cikgcu1qSJbVX2ZA7EHPZc9jn7/j1MKCFj6Owvc9 LM0fj70RQxbYCcl/+kOzrV0BMeB60TwhK4MoFFEPxaEHHOwsiES+liPJkFXPX6QVdCh1 XwmD79niEg88+KGky64Hr9ocV0PJvsEyLkgjI8CYlj2PD10k1BjRJoVgZL0XRMq4tzVI carQ== X-Gm-Message-State: ALoCoQlDyq/2u2nQAt94qBA9pvqd3bzm8ASEjZOs+uqDfuttKLHfjI9lZf9mlswKY9aKD32vWV0Y MIME-Version: 1.0 X-Received: by 10.236.181.137 with SMTP id l9mr1518606yhm.97.1392044265965; Mon, 10 Feb 2014 06:57:45 -0800 (PST) Received: by 10.170.127.79 with HTTP; Mon, 10 Feb 2014 06:57:45 -0800 (PST) In-Reply-To: <52F3C99F.5060500@redhat.com> References: <52AF4563.2090304@linaro.org> <52F3C99F.5060500@redhat.com> Date: Mon, 10 Feb 2014 14:57:00 -0000 Message-ID: Subject: Re: [PATCH] gdb/elfread.c: Enable ifunc support on ARM. From: Will Newton To: Pedro Alves Cc: "gdb-patches@sourceware.org" , Patch Tracking Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00309.txt.bz2 On 6 February 2014 17:42, Pedro Alves wrote: > 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. Thanks for taking a look. > 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 don't think that will work. We actually want to look at the value of SEPARATE_GOTPLT I believe, which I don't think we can easily determine. For example, ARM sets want_got_plt but not SEPARATE_GOTPLT. -- Will Newton Toolchain Working Group, Linaro