summaryrefslogtreecommitdiffstats
path: root/llvm/tools/yaml2obj/yaml2macho.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-05-17 23:38:22 +0000
committerZachary Turner <zturner@google.com>2016-05-17 23:38:22 +0000
commitb18921b565f83f5492c821ca5c6a772de6231746 (patch)
tree4d697b9d2aaf7ff8a0e0c04c70f7e4157a1aebd1 /llvm/tools/yaml2obj/yaml2macho.cpp
parent17ab78e82ade72b29fad48ba9f247a8827cf84d3 (diff)
downloadbcm5719-llvm-b18921b565f83f5492c821ca5c6a772de6231746.tar.gz
bcm5719-llvm-b18921b565f83f5492c821ca5c6a772de6231746.zip
Revert "[obj2yaml] [yaml2obj] Support MachO section and section_64
structs" This reverts commits r269845, r269846, and r269850 as they introduce a crash in obj2yaml when trying to do a roundtrip. llvm-svn: 269865
Diffstat (limited to 'llvm/tools/yaml2obj/yaml2macho.cpp')
-rw-r--r--llvm/tools/yaml2obj/yaml2macho.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/llvm/tools/yaml2obj/yaml2macho.cpp b/llvm/tools/yaml2obj/yaml2macho.cpp
index 0e8799e2ce1..772c710c098 100644
--- a/llvm/tools/yaml2obj/yaml2macho.cpp
+++ b/llvm/tools/yaml2obj/yaml2macho.cpp
@@ -77,23 +77,6 @@ Error MachOWriter::writeHeader(raw_ostream &OS) {
return Error::success();
}
-template <typename SectionType>
-SectionType constructSection(MachOYAML::Section Sec) {
- SectionType TempSec;
- memcpy(reinterpret_cast<void *>(&TempSec.sectname[0]), &Sec.sectname[0], 16);
- memcpy(reinterpret_cast<void *>(&TempSec.segname[0]), &Sec.segname[0], 16);
- TempSec.addr = Sec.addr;
- TempSec.size = Sec.size;
- TempSec.offset = Sec.offset;
- TempSec.align = Sec.align;
- TempSec.reloff = Sec.reloff;
- TempSec.nreloc = Sec.nreloc;
- TempSec.flags = Sec.flags;
- TempSec.reserved1 = Sec.reserved1;
- TempSec.reserved2 = Sec.reserved2;
- return TempSec;
-}
-
Error MachOWriter::writeLoadCommands(raw_ostream &OS) {
for (auto &LC : Obj.LoadCommands) {
size_t BytesWritten = 0;
@@ -113,21 +96,6 @@ Error MachOWriter::writeLoadCommands(raw_ostream &OS) {
#include "llvm/Support/MachO.def"
}
- if(LC.Data.load_command_data.cmd == MachO::LC_SEGMENT) {
- for(auto Sec : LC.Sections) {
- auto TempSec = constructSection<MachO::section>(Sec);
- OS.write(reinterpret_cast<const char *>(&(TempSec)), sizeof(MachO::section));
- BytesWritten += sizeof(MachO::section);
- }
- } else if(LC.Data.load_command_data.cmd == MachO::LC_SEGMENT_64) {
- for(auto Sec : LC.Sections) {
- auto TempSec = constructSection<MachO::section_64>(Sec);
- TempSec.reserved3 = Sec.reserved3;
- OS.write(reinterpret_cast<const char *>(&(TempSec)), sizeof(MachO::section_64));
- BytesWritten += sizeof(MachO::section_64);
- }
- }
-
auto BytesRemaining =
LC.Data.load_command_data.cmdsize - BytesWritten;
if (BytesRemaining > 0) {
OpenPOWER on IntegriCloud