1 //===- ELFObjcopy.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 
9 #ifndef LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
10 #define LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
11 
12 namespace llvm {
13 class Error;
14 class MemoryBuffer;
15 class raw_ostream;
16 
17 namespace object {
18 class ELFObjectFileBase;
19 } // end namespace object
20 
21 namespace objcopy {
22 struct CommonConfig;
23 struct ELFConfig;
24 
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 
34 /// Apply the transformations described by \p Config and \p ELFConfig to
35 /// \p In, which is treated as a raw binary input, and writes the result
36 /// into \p Out.
37 /// \returns any Error encountered whilst performing the operation.
38 Error executeObjcopyOnRawBinary(const CommonConfig &Config,
39                                 const ELFConfig &ELFConfig, MemoryBuffer &In,
40                                 raw_ostream &Out);
41 
42 /// Apply the transformations described by \p Config and \p ELFConfig to
43 /// \p In and writes the result into \p Out.
44 /// \returns any Error encountered whilst performing the operation.
45 Error executeObjcopyOnBinary(const CommonConfig &Config,
46                              const ELFConfig &ELFConfig,
47                              object::ELFObjectFileBase &In, raw_ostream &Out);
48 
49 } // end namespace elf
50 } // end namespace objcopy
51 } // end namespace llvm
52 
53 #endif // LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
54