XCOFFObject.h 1.2 KB

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