This is an archive of the discontinued LLVM Phabricator instance.

[lld-link] Ignore undefined symbols in .addrsig table
AbandonedPublic

Authored by zequanwu on Apr 21 2021, 9:17 AM.

Details

Reviewers
rnk
Summary

Undefined symbols in .addrsig table just mark symbols as addrsig to avoid icf, and not required to be resolved. We could just ignore them.

Diff Detail

Event Timeline

zequanwu requested review of this revision.Apr 21 2021, 9:17 AM
zequanwu created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 9:17 AM

This is not correct. A symbol marked by .addrsig_sym can be referenced via normal means. With this patch, the diagnostic may change from error: undefined symbol: bar to error: relocation against symbol in discarded section: bar

zequanwu abandoned this revision.Apr 21 2021, 1:13 PM

This is not correct. A symbol marked by .addrsig_sym can be referenced via normal means. With this patch, the diagnostic may change from error: undefined symbol: bar to error: relocation against symbol in discarded section: bar

Thanks for pointing it out. I put a new patch here: D100994

rnk added a comment.Apr 21 2021, 1:14 PM

I'm guessing ELF doesn't solve the same problem this way. Does LLVM MC make these .addrsig_sym references weak if there are no other references? That would solve the issue.