1*d415bd75Srobert //===- XCOFFObject.h --------------------------------------------*- C++ -*-===// 2*d415bd75Srobert // 3*d415bd75Srobert // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*d415bd75Srobert // See https://llvm.org/LICENSE.txt for license information. 5*d415bd75Srobert // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*d415bd75Srobert // 7*d415bd75Srobert //===----------------------------------------------------------------------===// 8*d415bd75Srobert 9*d415bd75Srobert #ifndef LLVM_LIB_OBJCOPY_XCOFF_XCOFFOBJECT_H 10*d415bd75Srobert #define LLVM_LIB_OBJCOPY_XCOFF_XCOFFOBJECT_H 11*d415bd75Srobert 12*d415bd75Srobert #include "llvm/ADT/ArrayRef.h" 13*d415bd75Srobert #include "llvm/ADT/StringRef.h" 14*d415bd75Srobert #include "llvm/Object/XCOFFObjectFile.h" 15*d415bd75Srobert #include <vector> 16*d415bd75Srobert 17*d415bd75Srobert namespace llvm { 18*d415bd75Srobert namespace objcopy { 19*d415bd75Srobert namespace xcoff { 20*d415bd75Srobert 21*d415bd75Srobert using namespace object; 22*d415bd75Srobert 23*d415bd75Srobert struct Section { 24*d415bd75Srobert XCOFFSectionHeader32 SectionHeader; 25*d415bd75Srobert ArrayRef<uint8_t> Contents; 26*d415bd75Srobert std::vector<XCOFFRelocation32> Relocations; 27*d415bd75Srobert }; 28*d415bd75Srobert 29*d415bd75Srobert struct Symbol { 30*d415bd75Srobert XCOFFSymbolEntry32 Sym; 31*d415bd75Srobert // For now, each auxiliary symbol is only an opaque binary blob with no 32*d415bd75Srobert // distinction. 33*d415bd75Srobert StringRef AuxSymbolEntries; 34*d415bd75Srobert }; 35*d415bd75Srobert 36*d415bd75Srobert struct Object { 37*d415bd75Srobert XCOFFFileHeader32 FileHeader; 38*d415bd75Srobert XCOFFAuxiliaryHeader32 OptionalFileHeader; 39*d415bd75Srobert std::vector<Section> Sections; 40*d415bd75Srobert std::vector<Symbol> Symbols; 41*d415bd75Srobert StringRef StringTable; 42*d415bd75Srobert }; 43*d415bd75Srobert 44*d415bd75Srobert } // end namespace xcoff 45*d415bd75Srobert } // end namespace objcopy 46*d415bd75Srobert } // end namespace llvm 47*d415bd75Srobert 48*d415bd75Srobert #endif // LLVM_LIB_OBJCOPY_XCOFF_XCOFFOBJECT_H 49