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

--- Comment #17 from Cary Coutant <ccoutant at gmail dot com> ---
> 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.

(Does ld *ever* say an LTO symbol is PREVAILING_DEF?)

-cary

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to