[PATCH] D83603: [lld-macho] Support __dso_handle for C++

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 08:59:37 PDT 2020


compnerd added inline comments.


================
Comment at: lld/MachO/SymbolTable.cpp:101
+  std::tie(s, wasInserted) = insert(DSOHandle::name);
+  fprintf(stderr, "Replaced: %u\n", wasInserted);
+  replaceSymbol<DSOHandle>(s, header);
----------------
Debugging left overs?


================
Comment at: lld/MachO/Symbols.h:139
+
+  static const constexpr StringRef name = "___dso_handle";
+
----------------
What do you think of making this ever so slightly more expensive?  I think that we should actually make this computed - the name of the symbol is `__dso_handle` which is decorated with the user label prefix of `_` to give you `___dso_handle`.  We have the information about the user label prefixes in LLVM, why not make that explicit here?  I don't think that the cost is really that high.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83603





More information about the llvm-commits mailing list