[llvm-bugs] [Bug 26580] Copy relocation against protected symbol doesn't work

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 9 21:58:15 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=26580

Fangrui Song <i at maskray.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WORKSFORME
             Status|NEW                         |RESOLVED
                 CC|                            |i at maskray.me

--- Comment #22 from Fangrui Song <i at maskray.me> ---
The original issue is "Copy relocation against protected symbol doesn't work".
I agree with Rich Felker (https://gcc.gnu.org/ml/gcc/2016-04/msg00168.html) and
Cary Coutant (https://sourceware.org/ml/binutils/2016-03/msg00407.html
https://gcc.gnu.org/ml/gcc/2016-04/msg00158.html
https://gcc.gnu.org/ml/gcc/2016-04/msg00169.html) that we should
keep using direct access against protected symbols and disallow copy
relocations against protected symbols.

I appreciate that Cary Coutant and Rafael Ávila de Espíndola added diagnostics
to gold and lld, respectively:

gold (https://sourceware.org/bugzilla/show_bug.cgi?id=19823)
lld (https://bugs.llvm.org/show_bug.cgi?id=31476)

And I hope the following resolutions could be reworked:


GCC 5 x86-64 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248)
i386 was flagged as a reproduce
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55012)

__attribute__((visibility("protected"))) int a;
int foo() { return a; } // GCC>=5 uses R_X86_64_GOTPCREL/R_X86_64_REX_GOTPCRELX
instead of R_X86_64_PC32
binutils 2.26: R_X86_64_PC32 can no longer be used against a protected symbol
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=ca3fe95e469b9daec153caa2c90665f5daaec2b5

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200210/bb2dc727/attachment.html>


More information about the llvm-bugs mailing list