In r268475 I made a change to ObjectFileMachO so that if it is

missing an LC_FUNCTION_STARTS section, we assume it has been
aggressively stripped (it is *very* unusual for anyone to strip
LC_FUNCTION_STARTS) so we disable assembly instruction unwind plan
creation.

Kernel extensions (kexts) don't have LC_FUNCTION_STARTS, but we
almost always have good symbol bounds just with the linker symbols.
So add an exception to allow assembly instruction unwind plan
creation for kexts even though they lack LC_FUNCTION_STARTS.

<rdar://problem/26453952> 

llvm-svn: 270618
This commit is contained in:
Jason Molenda 2016-05-24 21:46:23 +00:00
parent 315e49d213
commit 94ddce2c0e
1 changed files with 4 additions and 1 deletions

View File

@ -2607,7 +2607,10 @@ ObjectFileMachO::ParseSymtab ()
const size_t function_starts_count = function_starts.GetSize();
if (function_starts_count == 0)
// kext bundles don't have LC_FUNCTION_STARTS / eh_frame sections, but we can assume that we have
// accurate symbol boundaries for them, they're a special case.
if (function_starts_count == 0 && header.filetype != MH_KEXT_BUNDLE)
{
// No LC_FUNCTION_STARTS/eh_frame section in this binary, we're going to assume the binary
// has been stripped. Don't allow assembly language instruction emulation because we don't