[PATCH] D124056: [ELF] Fix wrapping symbols produced during LTO codegen

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 13:26:14 PDT 2022


MaskRay added a comment.

Thanks for the patch. I think it is an important improvement.

> Since we're no longer setting isUsedInRegularObj for all symbols which will be wrapped, its value at the time of performing the wrapping in the symbol table will accurately reflect whether the symbol was actually ...

I always need to wrap my head around when thinking about `--wrap` :-) And I did not find a good way to fix the inelegant condition

  if (!real->isUsedInRegularObj && sym->isUndefined())
      sym->isUsedInRegularObj = false;

The new one is better! Let me play with this a bit...

I am also curious whether you want to do anything with D33621 <https://reviews.llvm.org/D33621>: the chunk of code is a bit of a hack

  if (Res.LinkerRedefined)
    GV->setLinkage(GlobalValue::WeakAnyLinkage);


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124056



More information about the llvm-commits mailing list