mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-17 02:46:00 +00:00

Summary: 1. Add functionality for parsing AIX XCOFF object files headers. 2. Only support 32-bit AIX XCOFF object files in this patch. 3. Print out the AIX XCOFF object file header in YAML format. Reviewers: sfertile, hubert.reinterpretcast, jasonliu, mstorsjo, zturner, rnk Reviewed By: sfertile, hubert.reinterpretcast Subscribers: jsji, mgorny, hiraditya, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59419 Patch by Digger Lin git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357663 91177308-0d34-0410-b5e6-96231b3b80d8
43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
//===-- XCOFFYAML.cpp - XCOFF YAMLIO implementation -------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines classes for handling the YAML representation of XCOFF.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/ObjectYAML/XCOFFYAML.h"
|
|
#include <string.h>
|
|
|
|
namespace llvm {
|
|
namespace XCOFFYAML {
|
|
|
|
Object::Object() { memset(&Header, 0, sizeof(Header)); }
|
|
|
|
} // namespace XCOFFYAML
|
|
|
|
namespace yaml {
|
|
|
|
void MappingTraits<XCOFFYAML::FileHeader>::mapping(
|
|
IO &IO, XCOFFYAML::FileHeader &FileHdr) {
|
|
IO.mapRequired("MagicNumber", FileHdr.Magic);
|
|
IO.mapRequired("NumberOfSections", FileHdr.NumberOfSections);
|
|
IO.mapRequired("CreationTime", FileHdr.TimeStamp);
|
|
IO.mapRequired("OffsetToSymbolTable", FileHdr.SymbolTableOffset);
|
|
IO.mapRequired("EntriesInSymbolTable", FileHdr.NumberOfSymTableEntries);
|
|
IO.mapRequired("AuxiliaryHeaderSize", FileHdr.AuxHeaderSize);
|
|
IO.mapRequired("Flags", FileHdr.Flags);
|
|
}
|
|
|
|
void MappingTraits<XCOFFYAML::Object>::mapping(IO &IO, XCOFFYAML::Object &Obj) {
|
|
IO.mapTag("!XCOFF", true);
|
|
IO.mapRequired("FileHeader", Obj.Header);
|
|
}
|
|
|
|
} // namespace yaml
|
|
} // namespace llvm
|