bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/27491] ld: relocation R_X86_64_PC32 against undefined protected


From: amodra at gmail dot com
Subject: [Bug ld/27491] ld: relocation R_X86_64_PC32 against undefined protected symbol `__start_xx' can not be used when making a shared object
Date: Tue, 02 Mar 2021 08:05:30 +0000

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-03-02

--- Comment #1 from Alan Modra <amodra at gmail dot com> ---
powerpc64le on a similar testcase with
_start:
  pld 3,__start_xx@got@pcrel
  pld 4,__stop_xx@got@pcrel
does a similar optimisation without complaint, generating a binary that
performs two pla instructions setting both registers to zero pc-relative (which
isn't zero when the shared library is loaded somewhere other than address
zero).  Technically that is wrong since the value of an undefined weak symbol
is zero, and so the got entries should be left in order to load an absolute
zero.  But it might be reasonable in this case since you expect __start_xx and
__stop_xx to have an address somewhere in the executable.  However, I think
I'll fix this.

In contrast
 .weak xxx
 .global _start
_start:
  pld 3,xxx@got@pcrel
leaves the pld alone when xxx is undefined, loading the reg with zero from the
got entry.

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