[PATCH] D46029: [llvm-objcopy] Implement --redefine-sym option

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 25 12:17:55 PDT 2018


alexshap added inline comments.


================
Comment at: tools/llvm-objcopy/Object.cpp:210-231
+void SymbolTableSection::localizeHidden() {
+  forEachSymbol([](Symbol &Sym) {
+    if (Sym.Visibility == STV_HIDDEN || Sym.Visibility == STV_INTERNAL)
+      Sym.Binding = STB_LOCAL;
+  });
   // Now that the local symbols aren't grouped at the start we have to reorder
   // the symbols to respect this property.
----------------
jakehehrlich wrote:
> Sorry, I didn't state some of my motivations. I wanted everything to happen in a single "pass" (in reality 3 passes are used) and for SymbolTable to have a minimal complete interface. So localizeHidden and renameSymbols can be implemented in terms of forEachSymbol in HandleArgs. The point is to accumulate symbol modifications and then to apply them in one "pass" like we do for section modifications. The single "pass" is also something James wants.
i see, okay


Repository:
  rL LLVM

https://reviews.llvm.org/D46029





More information about the llvm-commits mailing list