[PATCH] llvm-readobj: implement MachODumper::printNeededLibraries

kledzik at apple.com kledzik at apple.com
Sun Mar 1 11:32:11 PST 2015


================
Comment at: tools/llvm-readobj/MachODumper.cpp:605
@@ +604,3 @@
+    if (Command.C.cmd == MachO::LC_LOAD_DYLIB ||
+        Command.C.cmd == MachO::LC_ID_DYLIB ||
+        Command.C.cmd == MachO::LC_LOAD_WEAK_DYLIB ||
----------------
LC_ID_DYLIB is not a "needed library".  It is the DT_SONAME of the dylib.

================
Comment at: tools/llvm-readobj/MachODumper.cpp:617
@@ +616,3 @@
+
+  std::stable_sort(Libs.begin(), Libs.end());
+
----------------
Why sort?  The order is important in mach-o.  The symbol table entries for undefined symbols contain a one byte "ordinal" which is the index into this ordered list.

http://reviews.llvm.org/D7378

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list