summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ObjectYAML/MachOYAML.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-05-31 17:26:36 +0000
committerChris Bieneman <beanz@apple.com>2016-05-31 17:26:36 +0000
commit6852775414a1872fda81b0249905c12cebdebfde (patch)
treebdd47e296bb66489949cd464ae72e3c3b39309be /llvm/lib/ObjectYAML/MachOYAML.cpp
parent0c48dd8ca53f3a962ffa408908b03f4cf45bddcb (diff)
downloadbcm5719-llvm-6852775414a1872fda81b0249905c12cebdebfde.tar.gz
bcm5719-llvm-6852775414a1872fda81b0249905c12cebdebfde.zip
[obj2yaml][yaml2obj] Support for reading and dumping the MachO export trie
The MachO export trie is a serially encoded trie keyed by symbol name. This code parses the trie and preserves the structure so that it can be dumped again. llvm-svn: 271300
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r--llvm/lib/ObjectYAML/MachOYAML.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp
index af58cac6a02..6fe137215cf 100644
--- a/llvm/lib/ObjectYAML/MachOYAML.cpp
+++ b/llvm/lib/ObjectYAML/MachOYAML.cpp
@@ -103,6 +103,7 @@ void MappingTraits<MachOYAML::LinkEditData>::mapping(
IO.mapOptional("BindOpcodes", LinkEditData.BindOpcodes);
IO.mapOptional("WeakBindOpcodes", LinkEditData.WeakBindOpcodes);
IO.mapOptional("LazyBindOpcodes", LinkEditData.LazyBindOpcodes);
+ IO.mapOptional("ExportTrie", LinkEditData.ExportTrie);
}
void MappingTraits<MachOYAML::RebaseOpcode>::mapping(
@@ -121,6 +122,18 @@ void MappingTraits<MachOYAML::BindOpcode>::mapping(
IO.mapOptional("Symbol", BindOpcode.Symbol);
}
+void MappingTraits<MachOYAML::ExportEntry>::mapping(
+ IO &IO, MachOYAML::ExportEntry &ExportEntry) {
+ IO.mapRequired("TerminalSize", ExportEntry.TerminalSize);
+ IO.mapOptional("NodeOffset", ExportEntry.NodeOffset);
+ IO.mapOptional("Name", ExportEntry.Name);
+ IO.mapOptional("Flags", ExportEntry.Flags);
+ IO.mapOptional("Address", ExportEntry.Address);
+ IO.mapOptional("Other", ExportEntry.Other);
+ IO.mapOptional("ImportName", ExportEntry.ImportName);
+ IO.mapOptional("Children", ExportEntry.Children);
+}
+
template <typename StructType>
void mapLoadCommandData(IO &IO, MachOYAML::LoadCommand &LoadCommand) {}
@@ -143,6 +156,12 @@ void mapLoadCommandData<MachO::dylib_command>(
}
template <>
+void mapLoadCommandData<MachO::rpath_command>(
+ IO &IO, MachOYAML::LoadCommand &LoadCommand) {
+ IO.mapOptional("PayloadString", LoadCommand.PayloadString);
+}
+
+template <>
void mapLoadCommandData<MachO::dylinker_command>(
IO &IO, MachOYAML::LoadCommand &LoadCommand) {
IO.mapOptional("PayloadString", LoadCommand.PayloadString);
OpenPOWER on IntegriCloud