aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ObjectYAML/MachOYAML.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/ObjectYAML/MachOYAML.cpp
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index 0f7cd1e1495c..86aad0233767 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -107,6 +107,8 @@ void MappingTraits<MachOYAML::Object>::mapping(IO &IO,
Object.DWARF.IsLittleEndian = Object.IsLittleEndian;
IO.mapRequired("FileHeader", Object.Header);
+ Object.DWARF.Is64BitAddrSize = Object.Header.magic == MachO::MH_MAGIC_64 ||
+ Object.Header.magic == MachO::MH_CIGAM_64;
IO.mapOptional("LoadCommands", Object.LoadCommands);
if(!Object.LinkEdit.isEmpty() || !IO.outputting())
IO.mapOptional("LinkEditData", Object.LinkEdit);
@@ -273,6 +275,18 @@ void MappingTraits<MachO::dyld_info_command>::mapping(
IO.mapRequired("export_size", LoadCommand.export_size);
}
+void MappingTraits<MachOYAML::Relocation>::mapping(
+ IO &IO, MachOYAML::Relocation &Relocation) {
+ IO.mapRequired("address", Relocation.address);
+ IO.mapRequired("symbolnum", Relocation.symbolnum);
+ IO.mapRequired("pcrel", Relocation.is_pcrel);
+ IO.mapRequired("length", Relocation.length);
+ IO.mapRequired("extern", Relocation.is_extern);
+ IO.mapRequired("type", Relocation.type);
+ IO.mapRequired("scattered", Relocation.is_scattered);
+ IO.mapRequired("value", Relocation.value);
+}
+
void MappingTraits<MachOYAML::Section>::mapping(IO &IO,
MachOYAML::Section &Section) {
IO.mapRequired("sectname", Section.sectname);
@@ -288,6 +302,7 @@ void MappingTraits<MachOYAML::Section>::mapping(IO &IO,
IO.mapRequired("reserved2", Section.reserved2);
IO.mapOptional("reserved3", Section.reserved3);
IO.mapOptional("content", Section.content);
+ IO.mapOptional("relocations", Section.relocations);
}
StringRef