MachODump.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //===-- MachODump.h ---------------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLVM_TOOLS_LLVM_OBJDUMP_MACHODUMP_H
  9. #define LLVM_TOOLS_LLVM_OBJDUMP_MACHODUMP_H
  10. #include "llvm/ADT/SmallVector.h"
  11. #include "llvm/Support/CommandLine.h"
  12. namespace llvm {
  13. class Error;
  14. class StringRef;
  15. class MemoryBuffer;
  16. namespace object {
  17. class MachOObjectFile;
  18. class MachOUniversalBinary;
  19. class ObjectFile;
  20. class RelocationRef;
  21. class Binary;
  22. } // namespace object
  23. namespace opt {
  24. class InputArgList;
  25. } // namespace opt
  26. namespace objdump {
  27. void parseMachOOptions(const llvm::opt::InputArgList &InputArgs);
  28. enum class FunctionStartsMode { Addrs, Names, Both, None };
  29. // MachO specific options
  30. extern bool Bind;
  31. extern bool DataInCode;
  32. extern std::string DisSymName;
  33. extern bool ChainedFixups;
  34. extern bool DyldInfo;
  35. extern bool DylibId;
  36. extern bool DylibsUsed;
  37. extern bool ExportsTrie;
  38. extern bool FirstPrivateHeader;
  39. extern bool FullLeadingAddr;
  40. extern FunctionStartsMode FunctionStartsType;
  41. extern bool IndirectSymbols;
  42. extern bool InfoPlist;
  43. extern bool LazyBind;
  44. extern bool LeadingHeaders;
  45. extern bool LinkOptHints;
  46. extern bool ObjcMetaData;
  47. extern bool Rebase;
  48. extern bool Rpaths;
  49. extern bool SymbolicOperands;
  50. extern bool UniversalHeaders;
  51. extern bool Verbose;
  52. extern bool WeakBind;
  53. Error getMachORelocationValueString(const object::MachOObjectFile *Obj,
  54. const object::RelocationRef &RelRef,
  55. llvm::SmallVectorImpl<char> &Result);
  56. const object::MachOObjectFile *
  57. getMachODSymObject(const object::MachOObjectFile *O, StringRef Filename,
  58. std::unique_ptr<object::Binary> &DSYMBinary,
  59. std::unique_ptr<MemoryBuffer> &DSYMBuf);
  60. void parseInputMachO(StringRef Filename);
  61. void parseInputMachO(object::MachOUniversalBinary *UB);
  62. void printMachOUnwindInfo(const object::MachOObjectFile *O);
  63. void printMachOFileHeader(const object::ObjectFile *O);
  64. void printMachOLoadCommands(const object::ObjectFile *O);
  65. void printExportsTrie(const object::ObjectFile *O);
  66. void printRebaseTable(object::ObjectFile *O);
  67. void printBindTable(object::ObjectFile *O);
  68. void printLazyBindTable(object::ObjectFile *O);
  69. void printWeakBindTable(object::ObjectFile *O);
  70. } // namespace objdump
  71. } // namespace llvm
  72. #endif