[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binutils
Subject:    Re: PLT entries for STT_GNU_IFUNC in static binaries
From:       Ian Lance Taylor <iant () google ! com>
Date:       2013-09-26 16:26:18
Message-ID: CAKOQZ8zVtNkVedxs4p3zw8GGcT1rRB8Y-Lnvgo+d3A2gTAGR5Q () mail ! gmail ! com
[Download RAW message or body]

On Thu, Sep 26, 2013 at 3:12 AM, vijay nag <vijunag@gmail.com> wrote:
> On Thu, Sep 26, 2013 at 3:34 PM, Andreas Schwab <schwab@suse.de> wrote:
>> vijay nag <vijunag@gmail.com> writes:
>>
>>> Why this difference in  "objdump -d" output of IRELATIVE PLT entries
>>> for static and dynamic executable ?
>>>
>>> Doesn't static executable possess PLT symbol information ?
>>
>> A static executable doesn't have a dynamic symbol table where these
>> synthetic symbols are created from.
>>
>> Andreas.
>>
>> --
>> Andreas Schwab, SUSE Labs, schwab@suse.de
>> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
>> "And now for something completely different."
>
> gdb is unable to single-step in a static executable after the program
> jumps into PLT  to execute gnu_ifunc.
> How is gdb supposed to handle it ?
>
> (gdb) n
> 273     argv0short = strrchr(argv[0], '/');
> (gdb) n
> 0x08048430 in ?? ()
> (gdb) n
> Cannot find bounds of current function
> (gdb) n
> Cannot find bounds of current function
> (gdb)

When doing a dynamic link the linker resolves functions like strrchr
to the PLT entry.  When doing a static link it does not.  To make this
work we will have to modify the linker to emit symbol table entries
for the PLT entries that it creates for IFUNC symbols when doing a
static link.

Ian

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic