| 1 | //===- XCOFFObject.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_LIB_OBJCOPY_XCOFF_XCOFFOBJECT_H |
| 10 | #define LLVM_LIB_OBJCOPY_XCOFF_XCOFFOBJECT_H |
| 11 | |
| 12 | #include "llvm/ADT/ArrayRef.h" |
| 13 | #include "llvm/ADT/StringRef.h" |
| 14 | #include "llvm/Object/XCOFFObjectFile.h" |
| 15 | #include <vector> |
| 16 | |
| 17 | namespace llvm { |
| 18 | namespace objcopy { |
| 19 | namespace xcoff { |
| 20 | |
| 21 | using namespace object; |
| 22 | |
| 23 | struct Section { |
| 24 | XCOFFSectionHeader32 SectionHeader; |
| 25 | ArrayRef<uint8_t> Contents; |
| 26 | std::vector<XCOFFRelocation32> Relocations; |
| 27 | }; |
| 28 | |
| 29 | struct Symbol { |
| 30 | XCOFFSymbolEntry32 Sym; |
| 31 | // For now, each auxiliary symbol is only an opaque binary blob with no |
| 32 | // distinction. |
| 33 | StringRef AuxSymbolEntries; |
| 34 | }; |
| 35 | |
| 36 | struct Object { |
| 37 | XCOFFFileHeader32 FileHeader; |
| 38 | XCOFFAuxiliaryHeader32 OptionalFileHeader; |
| 39 | std::vector<Section> Sections; |
| 40 | std::vector<Symbol> Symbols; |
| 41 | StringRef StringTable; |
| 42 | }; |
| 43 | |
| 44 | } // end namespace xcoff |
| 45 | } // end namespace objcopy |
| 46 | } // end namespace llvm |
| 47 | |
| 48 | #endif // LLVM_LIB_OBJCOPY_XCOFF_XCOFFOBJECT_H |
| 49 |