Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Will Newton <will.newton@linaro.org>
Cc: gdb-patches@sourceware.org, Patch Tracking <patches@linaro.org>
Subject: Re: [PATCH] gdb/elfread.c: Enable ifunc support on ARM.
Date: Thu, 06 Feb 2014 17:43:00 -0000	[thread overview]
Message-ID: <52F3C99F.5060500@redhat.com> (raw)
In-Reply-To: <52AF4563.2090304@linaro.org>

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  <will.newton@linaro.org>
> 
> 	* 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


  parent reply	other threads:[~2014-02-06 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 18:24 Will Newton
2014-01-23 15:21 ` Will Newton
2014-02-04 11:28   ` Will Newton
2014-02-06 17:43 ` Pedro Alves [this message]
2014-02-10 14:57   ` Will Newton
2014-02-10 15:57     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F3C99F.5060500@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=patches@linaro.org \
    --cc=will.newton@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox