]> granicus.if.org Git - llvm/commit
[dwarfdump] Skip 'stripped' sections
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 26 Sep 2017 14:22:35 +0000 (14:22 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 26 Sep 2017 14:22:35 +0000 (14:22 +0000)
commitac9a500e7380a87886b07b91bc425f3bb212eecf
treec2ff29203ca3c69a542e1a2f48b99b391fa080f1
parentb21bc942ba00ce758c85616c42e73563b763f20b
[dwarfdump] Skip 'stripped' sections

When dsymutil generates the companion file, its strips all unnecessary
sections by omitting their body and setting the offset in their
corresponding load command to zero.

One such section is the .eh_frame section, as it contains runtime
information rather than debug information and is part of the __TEXT
segment. When reading this section, we would just read the number of
bytes specified in the load command, starting from offset 0 (i.e. the
beginning of the file).

Rather than trying to parse this obviously invalid section, dwarfdump
now skips this.

Differential revision: https://reviews.llvm.org/D38135

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314208 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/MachO.h
include/llvm/Object/ObjectFile.h
lib/DebugInfo/DWARF/DWARFContext.cpp
lib/Object/MachOObjectFile.cpp
lib/Object/ObjectFile.cpp
test/tools/llvm-dwarfdump/X86/Inputs/empty.dSYM [new file with mode: 0644]
test/tools/llvm-dwarfdump/X86/stripped.test [new file with mode: 0644]