This is the mail archive of the
mailing list for the binutils project.
Re: Linker plugins should be aware of --defsym during symbol resolution
>> Can you explain why this new resolution is needed? Why would
>> LDPR_PREEMPTED_REG not work?
> They mean different things. For example, LDPR_PREEMPTED_REG will mean that
> there is a prevailing definition in a regular object file. But if the IR def
> has weak ODR linkage, the LTO implementation knows that all copies must be
> the same, and we can and currently do keep that def around long enough for
> inlining. That would be incorrect in the defsym case, where this symbol is
> actually redefined by the linker. That is what we are trying to distinguish.
Do you have a real-world example? I'm having trouble imagining a case
where --defsym would be used to override a symbol that's subject to
the ODR and yet remain a valid program.