diff options
author | Chris Bieneman <beanz@apple.com> | 2016-06-02 22:54:06 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2016-06-02 22:54:06 +0000 |
commit | 07bb3c84a2d1eff7f3577cce023dca517aa7c3ed (patch) | |
tree | bfc2fb2bb090b8a0c9f2a6869fddbf2abe4c31bf /llvm/lib/ObjectYAML/MachOYAML.cpp | |
parent | 172bf6edd13aa0c8e117db4d50f295c74b7dc4fd (diff) | |
download | bcm5719-llvm-07bb3c84a2d1eff7f3577cce023dca517aa7c3ed.tar.gz bcm5719-llvm-07bb3c84a2d1eff7f3577cce023dca517aa7c3ed.zip |
[obj2yaml] [yaml2obj] Support for MachO nlist and string table
This commit adds round tripping for MachO symbol data. Symbols are entries in the name list, that contain offsets into the string table which is at the end of the __LINKEDIT segment.
llvm-svn: 271604
Diffstat (limited to 'llvm/lib/ObjectYAML/MachOYAML.cpp')
-rw-r--r-- | llvm/lib/ObjectYAML/MachOYAML.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MachOYAML.cpp b/llvm/lib/ObjectYAML/MachOYAML.cpp index 6fe137215cf..b4e808552df 100644 --- a/llvm/lib/ObjectYAML/MachOYAML.cpp +++ b/llvm/lib/ObjectYAML/MachOYAML.cpp @@ -104,6 +104,8 @@ void MappingTraits<MachOYAML::LinkEditData>::mapping( IO.mapOptional("WeakBindOpcodes", LinkEditData.WeakBindOpcodes); IO.mapOptional("LazyBindOpcodes", LinkEditData.LazyBindOpcodes); IO.mapOptional("ExportTrie", LinkEditData.ExportTrie); + IO.mapOptional("NameList", LinkEditData.NameList); + IO.mapOptional("StringTable", LinkEditData.StringTable); } void MappingTraits<MachOYAML::RebaseOpcode>::mapping( @@ -134,6 +136,15 @@ void MappingTraits<MachOYAML::ExportEntry>::mapping( IO.mapOptional("Children", ExportEntry.Children); } +void MappingTraits<MachOYAML::NListEntry>::mapping( + IO &IO, MachOYAML::NListEntry &NListEntry) { + IO.mapRequired("n_strx", NListEntry.n_strx); + IO.mapRequired("n_type", NListEntry.n_type); + IO.mapRequired("n_sect", NListEntry.n_sect); + IO.mapRequired("n_desc", NListEntry.n_desc); + IO.mapRequired("n_value", NListEntry.n_value); +} + template <typename StructType> void mapLoadCommandData(IO &IO, MachOYAML::LoadCommand &LoadCommand) {} |