Details
Details
Diff Detail
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
Comment Actions
Is this correct? I thought that if no one is referencing an undefined symbol from an object file, that symbol shouldn't be marked as "used".
Comment Actions
Yes, its correct, I believe. We were already doing it for undefined functions, just not data symbols. In the ELF loader we do it for all symbols in the ::insert function. I think I will do a followup to do it the same way here.
The example I have the I think shows it to be correct:
- Regular obj inserted undefined symbol.
- bitcode obj defines the symbols and replaces it.
- LTO happens, at which point symbol can be discarded if !IsUsedInRegularObj
So (1) needs to set IsUsedInRegularObj otherwise the symbol can be discarded in (3) and the result will be an undefined symbol.
Comment Actions
Adding @jgravelle-google. Maybe @ruiu is OOO. This change I pretty small an non-controversial I think, not that I've explained it. These two lines should have been in the original LTO change.