[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/19842] LTO build fails to write call address for weak symbol r
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/19842] LTO build fails to write call address for weak symbol reference |
Date: |
Mon, 21 Mar 2016 22:09:56 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=19842
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amodra at gmail dot com
--- Comment #18 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Cary Coutant from comment #17)
> > For ld, non-LTO definition takes precedence over LTO one.
>
> What symbol resolution does ld tell the compiler for the LTO
> definition? The LTO design was intended to preserve the same binding
> order that would have been observed in a non-LTO build (to the extent
> possible). Try your example without -flto at all.
>
> If ld tells the compiler that the LTO definition is PREVAILING_DEF, it
> will provide a new definition, but not in a COMDAT group. But that
> definition won't be WEAK, so the order wouldn't matter and it should
> still bind to the LTO definition. That suggests to me that ld is
> telling it that the LTO definition is PREEMPTED_REG. But that doesn't
> preserve the expected binding order.
commit 3a5dbfb2502e7a49422f13c9cec2becfd46f44f1
Author: Alan Modra <address@hidden>
Date: Tue Jun 21 14:55:26 2011 +0000
* elflink.c (_bfd_elf_merge_symbol): Allow type changes for
plugin symbols. Fix segfault on linker scrip defined syms.
has
/* Skip weak definitions of symbols that are already defined. */
if (newdef && olddef && newweak)
{
/* Don't skip new non-IR weak syms. */
if (!(oldbfd != NULL
&& (oldbfd->flags & BFD_PLUGIN) != 0
&& (abfd->flags & BFD_PLUGIN) == 0))
{
newdef = FALSE;
*skip = TRUE;
}
which prefers regular definition over definition in IR.
> (Does ld *ever* say an LTO symbol is PREVAILING_DEF?)
Yes.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, (continued)
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, hjl.tools at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, matt at godbolt dot org, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, hjl.tools at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, matt at godbolt dot org, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, hjl.tools at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, matt at godbolt dot org, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, matt at godbolt dot org, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, hjl.tools at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, hjl.tools at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, ccoutant at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference,
hjl.tools at gmail dot com <=
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, ccoutant at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, hjl.tools at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, ccoutant at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, ccoutant at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, amodra at gmail dot com, 2016/03/21
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, ccoutant at gmail dot com, 2016/03/22
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, cvs-commit at gcc dot gnu.org, 2016/03/22
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, amodra at gmail dot com, 2016/03/22
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, ccoutant at gmail dot com, 2016/03/22
- [Bug gold/19842] LTO build fails to write call address for weak symbol reference, amodra at gmail dot com, 2016/03/22