bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE


From: hjl.tools at gmail dot com
Subject: [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE
Date: Fri, 06 Oct 2017 12:43:06 +0000

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
elfxx-x86.h has

/* Is a undefined weak symbol which is resolved to 0.  Reference to an
   undefined weak symbol is resolved to 0 when building executable if
   it isn't dynamic and
   1. Has non-GOT/non-PLT relocations in text section.  Or
   2. Has no GOT/PLT relocation.
   Local undefined weak symbol is always resolved to 0.
 */
#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, EH) \
  ((EH)->elf.root.type == bfd_link_hash_undefweak                \
   && (SYMBOL_REFERENCES_LOCAL_P ((INFO), &(EH)->elf)            \
       || (bfd_link_executable (INFO)                            \
           && (!(EH)->has_got_reloc                              \
               || (EH)->has_non_got_reloc))))

It may be useful for other targets.

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