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 04:28:47 +0000

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

--- Comment #11 from Rafael Ávila de Espíndola <rafael.espindola at gmail dot 
com> ---
(In reply to Cary Coutant from comment #10)
> The "official" or "canonical" PLT entry is the one that serves as the
> address of the function throughout the program.

OK, so we were talking about the same plt entry.

> If you make the function protected in your shared library, I think the PIC
> sequence to get its address will always load the address of the function
> itself, while the PC32 relocation in the main program will have no
> alternative but to load the address of its own PLT entry. (Gnu ld will
> refuse to build a shared library with a PC32 ref to a protected symbol, but
> gold will build it.)

That is what I would expect. Using a PLT entry in the main executable as the
canonical PLT entry should work in the same cases where a copy relocation
works: The use is in the main program and the definition has default
visibility.

-- 
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]