mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-17 19:06:09 +00:00

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356109 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
986 B
C++
31 lines
986 B
C++
//===- MachOObjcopy.cpp -----------------------------------------*- 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "MachOObjcopy.h"
|
|
#include "../CopyConfig.h"
|
|
#include "MachOReader.h"
|
|
#include "MachOWriter.h"
|
|
#include "llvm/Support/Error.h"
|
|
|
|
namespace llvm {
|
|
namespace objcopy {
|
|
namespace macho {
|
|
|
|
Error executeObjcopyOnBinary(const CopyConfig &Config,
|
|
object::MachOObjectFile &In, Buffer &Out) {
|
|
MachOReader Reader(In);
|
|
std::unique_ptr<Object> O = Reader.create();
|
|
assert(O && "Unable to deserialize MachO object");
|
|
MachOWriter Writer(*O, In.is64Bit(), In.isLittleEndian(), Out);
|
|
return Writer.write();
|
|
}
|
|
|
|
} // end namespace macho
|
|
} // end namespace objcopy
|
|
} // end namespace llvm
|