OSDN Git Service

llvm-objdump: Print x64 unwind info in executable.
authorRui Ueyama <ruiu@google.com>
Tue, 4 Mar 2014 04:00:55 +0000 (04:00 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 4 Mar 2014 04:00:55 +0000 (04:00 +0000)
commit3ab0ce0cde91cade8e6d0c04d439dbe3988aa204
tree1180ab60c3db4c629b0fa58c3bca76caf4418d82
parent7ef591d612837b5cdf2b9ed7f7eea2fc799117af
llvm-objdump: Print x64 unwind info in executable.

The original code does not work correctly on executable files because the
code is written in such a way that only object files are assumed to be given
to llvm-objdump.

Contents of RuntimeFunction are different between executables and objects. In
executables, fields in RuntimeFunction have actual addresses to unwind info
structures. On the other hand, in object files, the fields have zero value,
but instead there are relocations pointing to the fields, so that Linker will
fill them at link-time.

So, when we are reading an object file, we need to use relocation info to
find the location of unwind info. When executable, we should just look at the
values in RuntimeFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202785 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objdump/Inputs/win64-unwind.exe.coff-x86_64.exe [new file with mode: 0644]
test/tools/llvm-objdump/Inputs/win64-unwind.exe.coff-x86_64.obj [moved from test/tools/llvm-objdump/Inputs/win64-unwind.exe.coff-x86_64 with 100% similarity]
test/tools/llvm-objdump/win64-unwind-data.test
tools/llvm-objdump/COFFDump.cpp