This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]