ELFObjcopy.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- ELFObjcopy.h ---------------------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
  14. #define LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
  15. namespace llvm {
  16. class Error;
  17. class MemoryBuffer;
  18. class raw_ostream;
  19. namespace object {
  20. class ELFObjectFileBase;
  21. } // end namespace object
  22. namespace objcopy {
  23. struct CommonConfig;
  24. struct ELFConfig;
  25. namespace elf {
  26. /// Apply the transformations described by \p Config and \p ELFConfig to
  27. /// \p In, which must represent an IHex file, and writes the result
  28. /// into \p Out.
  29. /// \returns any Error encountered whilst performing the operation.
  30. Error executeObjcopyOnIHex(const CommonConfig &Config,
  31. const ELFConfig &ELFConfig, MemoryBuffer &In,
  32. raw_ostream &Out);
  33. /// Apply the transformations described by \p Config and \p ELFConfig to
  34. /// \p In, which is treated as a raw binary input, and writes the result
  35. /// into \p Out.
  36. /// \returns any Error encountered whilst performing the operation.
  37. Error executeObjcopyOnRawBinary(const CommonConfig &Config,
  38. const ELFConfig &ELFConfig, MemoryBuffer &In,
  39. raw_ostream &Out);
  40. /// Apply the transformations described by \p Config and \p ELFConfig to
  41. /// \p In and writes the result into \p Out.
  42. /// \returns any Error encountered whilst performing the operation.
  43. Error executeObjcopyOnBinary(const CommonConfig &Config,
  44. const ELFConfig &ELFConfig,
  45. object::ELFObjectFileBase &In, raw_ostream &Out);
  46. } // end namespace elf
  47. } // end namespace objcopy
  48. } // end namespace llvm
  49. #endif // LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
  50. #ifdef __GNUC__
  51. #pragma GCC diagnostic pop
  52. #endif