Reader.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //===- Reader.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_OBJCOPY_COFF_READER_H
  9. #define LLVM_TOOLS_OBJCOPY_COFF_READER_H
  10. #include "llvm/BinaryFormat/COFF.h"
  11. #include "llvm/Object/COFF.h"
  12. #include "llvm/Support/Error.h"
  13. namespace llvm {
  14. namespace objcopy {
  15. namespace coff {
  16. struct Object;
  17. using object::COFFObjectFile;
  18. class COFFReader {
  19. const COFFObjectFile &COFFObj;
  20. Error readExecutableHeaders(Object &Obj) const;
  21. Error readSections(Object &Obj) const;
  22. Error readSymbols(Object &Obj, bool IsBigObj) const;
  23. Error setSymbolTargets(Object &Obj) const;
  24. public:
  25. explicit COFFReader(const COFFObjectFile &O) : COFFObj(O) {}
  26. Expected<std::unique_ptr<Object>> create() const;
  27. };
  28. } // end namespace coff
  29. } // end namespace objcopy
  30. } // end namespace llvm
  31. #endif // LLVM_TOOLS_OBJCOPY_COFF_READER_H