This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb/elfread.c: Enable ifunc support on ARM.


On 6 February 2014 17:42, Pedro Alves <palves@redhat.com> 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  <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.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]