[PATCH] D151965: [ThinLTO] Fix internalization decisions for weak/linkonce ODR

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 10:29:18 PDT 2023


steven_wu accepted this revision.
steven_wu added a comment.
This revision is now accepted and ready to land.

I think this should work for legacy API. ld64 always picks the prevailing one to be from native object file and ask LTO to reserve the symbol (so LTO cannot internalize them) so it doesn't really hit the bug mentioned. It is not the ideal solution but it is the best can be done when no symbol resolution information is available from API.

It should be safe to assume atom only gets referenced once if there is only one visible and it is not in the reserved symbol list. I don't think preserved symbols will turn into prevailing, but I don't think they can be internalized in this case too. Would be good to add a test case to make sure if the weak/linkonce in the preserve GUID will get the correct behavior.

LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151965/new/

https://reviews.llvm.org/D151965



More information about the llvm-commits mailing list