[PATCH] D124792: [ifs] Add --strip-size flag

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 09:23:21 PDT 2022


abrachet marked 3 inline comments as done.
abrachet added a comment.

In D124792#3487528 <https://reviews.llvm.org/D124792#3487528>, @jhenderson wrote:

> I'd like to see an llvm-ifs Command Guide document wtitten sooner rather than later, since all llvm tools should have one. Please look at doing this soon.

Looks like @haowei already created it. Added documentation for `--strip-size`



================
Comment at: llvm/lib/InterfaceStub/ELFObjHandler.cpp:222
+      if (Size == std::numeric_limits<uint64_t>::max())
+        Size = 1;
+      DynSym.Content.add(DynStr.Content.getOffset(Sym.Name), Size, Bind,
----------------
jhenderson wrote:
> Why is `Size` set to 1 and not 0, which would seem the more natural value?
Linkers would get upset. https://github.com/llvm/llvm-project/blob/main/lld/ELF/Relocations.cpp#L355-L358


================
Comment at: llvm/tools/llvm-ifs/llvm-ifs.cpp:441
+    for (auto &Sym : Stub.Symbols)
+      Sym.Size = std::numeric_limits<uint64_t>::max();
+
----------------
jhenderson wrote:
> Could you make `Sym.Size` `Optional` instead? That would seem like a cleaner interface to me.
Sure


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

https://reviews.llvm.org/D124792



More information about the llvm-commits mailing list