This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 02/11] Fix breakpoints in ifunc after inferior resolved it (@got.plt symbol creation)
- From: Simon Marchi <simark at simark dot ca>
- To: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Sun, 11 Mar 2018 15:59:05 -0400
- Subject: Re: [PATCH 02/11] Fix breakpoints in ifunc after inferior resolved it (@got.plt symbol creation)
- Authentication-results: sourceware.org; auth=none
- References: <20180309211612.12941-1-palves@redhat.com> <20180309211612.12941-3-palves@redhat.com>
On 2018-03-09 04:16 PM, Pedro Alves wrote:
> Setting a breakpoint on an ifunc symbol after the ifunc has already
> been resolved by the inferior should result in creating a breakpoint
> location at the ifunc target. However, that's not what happens today:
>
> (gdb) n
> 53 i = gnu_ifunc (1); /* break-at-call */
> (gdb)
> 54 assert (i == 2);
> (gdb) b gnu_ifunc
> Breakpoint 2 at gnu-indirect-function resolver at 0x7ffff7bd36ee
> (gdb) info breakpoints
> Num Type Disp Enb Address What
> 2 STT_GNU_IFUNC resolver keep y 0x00007ffff7bd36ee <gnu_ifunc+4>
>
> The problem is that elf_gnu_ifunc_resolve_by_got never manages to
> revolve an ifunc target. The reason is that GDB never actually
revolve -> resolve
> creates the internal got.plt symbols:
>
> (gdb) p 'gnu_ifunc@got.plt'
> No symbol "gnu_ifunc@got.plt" in current context.
>
> and this is because GDB expects that rela.plt has relocations for
> .plt, while it actually has relocations for .got.plt:
Was it ever the case that rela.plt contained relocations for .plt, or
has it always been a mistake?
Simon