OSDN Git Service

Object/llvm-objdump: allow dumping of mach-o exports trie
authorNick Kledzik <kledzik@apple.com>
Sat, 30 Aug 2014 00:20:14 +0000 (00:20 +0000)
committerNick Kledzik <kledzik@apple.com>
Sat, 30 Aug 2014 00:20:14 +0000 (00:20 +0000)
commitaa4d2acf37ee5c8acaacd320cd9ab3940f328e84
tree67919afdd7f5512d2ae488646e363630f2ea3ae4
parent4e92383b67daf6e7f5770c35ab478b4f9611aacd
Object/llvm-objdump: allow dumping of mach-o exports trie

MachOObjectFile in lib/Object currently has no support for parsing the rebase,
binding, and export information from the LC_DYLD_INFO load command in final
linked mach-o images. This patch adds support for parsing the exports trie data
structure. It also adds an option to llvm-objdump to dump that export info.

I did the exports parsing first because it is the hardest. The information is
encoded in a trie structure, but the standard ObjectFile way to inspect content
is through iterators. So I needed to make an iterator that would do a
non-recursive walk through the trie and maintain the concatenation of edges
needed for the current string prefix.

I plan to add similar support in MachOObjectFile and llvm-objdump to
parse/display the rebasing and binding info too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216808 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/MachO.h
include/llvm/Support/MachO.h
lib/Object/MachOObjectFile.cpp
test/tools/llvm-objdump/Inputs/exports-trie.macho-x86_64 [new file with mode: 0755]
test/tools/llvm-objdump/macho-exports-trie.test [new file with mode: 0644]
tools/llvm-objdump/MachODump.cpp
tools/llvm-objdump/llvm-objdump.cpp
tools/llvm-objdump/llvm-objdump.h