Re: [PATCH] lto: Set resolution to LDPR_PREVAILING_DEF for non-IR common symbol
"H.J. Lu" <[email protected]>
| Newsgroups | gmane.comp.gnu.binutils |
|---|---|
| Message-ID | <CAMe9rOqpT5bgn+huBbrOKcw_mKUr_X8x4uaqGZiVUf8kLbQx-A@mail.gmail.com> |
On Thu, Aug 27, 2026 at 7:52 PM Jan Beulich <[email protected]> wrote: > > On 27.08.2026 10:31, H.J. Lu wrote: > > Since size or alignment of common symbol may be overridden by another > > common symbol, set symbol resolution to LDPR_PREVAILING_DEF, instead of > > LDPR_RESOLVED_EXEC, for common symbol in regular object when seeing an > > undefined or common symbol from an IR object. > > Is this correct for the LDPK_COMMON case that's also covered by the if() > that you alter in get_symbols()? My patch covers the case of syms[n].def == LDPK_COMMON && blhe->type == bfd_link_hash_common. which wasn't handled before. > Adding to the (my?) confusion is that after said > > if (syms[n].def == LDPK_UNDEF > || syms[n].def == LDPK_WEAKUNDEF > || syms[n].def == LDPK_COMMON) > > there's an "else if" with this comment: > > /* Was originally def, weakdef, or common, but has been pre-empted. */ > > With the cited if(), no originally common symbol can make it there, can it? My patch covers if (syms[n].def == LDPK_UNDEF || syms[n].def == LDPK_WEAKUNDEF || syms[n].def == LDPK_COMMON) { ... It has nothing to do with the else clause. > Jan -- H.J.