bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/22791] Don't error when a -pie executable uses a shared functi


From: rafael.espindola at gmail dot com
Subject: [Bug gold/22791] Don't error when a -pie executable uses a shared function without PIC/PIE relocation
Date: Tue, 06 Feb 2018 01:49:33 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22791

--- Comment #9 from Rafael Ávila de Espíndola <rafael.espindola at gmail dot 
com> ---
(In reply to Cary Coutant from comment #8)
> (In reply to Rafael Ávila de Espíndola from comment #5)
> > (In reply to Cary Coutant from comment #4)
> > > This would be fine if we knew for a fact that the relocation is on a call
> > > instruction. The problem is that R_X86_64_PC32 isn't always a call
> > > instruction.
> > 
> > It still works. The library will see the address of the got entry.
> 
> Which won't necessarily be the "official" PLT entry. Function point
> comparison may break.

Not sure what you mean by "official". The testcase I uploaded computes address
of an external function foo with

        movslq  bar(%rip), %rax
        leaq    bar(%rip), %rdi
        addq    %rax, %rdi
...
        .data
        .p2align        3
bar:
        .long   foo - .

and in a shared library foo is defined as

void foo(void *bar) {
  printf("%p %p\n", bar, foo);
}

I always get the same value printed twice.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]