Change Target::ReadMemoryFromFileCache to not read from the file

if the section is marked as encrypted.  It will likely be readable
in live memory.
<rdar://problem/11305675>

llvm-svn: 155509
This commit is contained in:
Jason Molenda 2012-04-25 00:06:56 +00:00
parent cb93142e1f
commit 216d91f16e
1 changed files with 5 additions and 0 deletions

View File

@ -1064,6 +1064,11 @@ Target::ReadMemoryFromFileCache (const Address& addr, void *dst, size_t dst_len,
SectionSP section_sp (addr.GetSection());
if (section_sp)
{
// If the contents of this section are encrypted, the on-disk file is unusuable. Read only from live memory.
if (section_sp->IsEncrypted())
{
return 0;
}
ModuleSP module_sp (section_sp->GetModule());
if (module_sp)
{