1 //===- Writer.h -------------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_OBJCOPY_COFF_WRITER_H
10 #define LLVM_TOOLS_OBJCOPY_COFF_WRITER_H
13 #include "llvm/MC/StringTableBuilder.h"
14 #include "llvm/Support/Error.h"
30 size_t SizeOfInitializedData
;
31 StringTableBuilder StrTabBuilder
;
33 template <class SymbolTy
> std::pair
<size_t, size_t> finalizeSymbolTable();
34 Error
finalizeRelocTargets();
35 Error
finalizeSymbolContents();
36 void layoutSections();
37 size_t finalizeStringTable();
39 Error
finalize(bool IsBigObj
);
41 void writeHeaders(bool IsBigObj
);
43 template <class SymbolTy
> void writeSymbolStringTables();
45 Error
write(bool IsBigObj
);
47 Error
patchDebugDirectory();
50 virtual ~COFFWriter() {}
53 COFFWriter(Object
&Obj
, Buffer
&Buf
)
54 : Obj(Obj
), Buf(Buf
), StrTabBuilder(StringTableBuilder::WinCOFF
) {}
57 } // end namespace coff
58 } // end namespace objcopy
59 } // end namespace llvm
61 #endif // LLVM_TOOLS_OBJCOPY_COFF_WRITER_H