[PATCH 02/11] Fix breakpoints in ifunc after inferior resolved it (@got.plt symbol creation)

Simon Marchi simark@simark.ca
Sun Mar 11 19:59:00 GMT 2018


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



More information about the Gdb-patches mailing list