ART: Do not relocate app program headers in patchoat.

Change the check whether to relocate program headers in
patchoat to simply look whether there is a PT_LOAD section
with p_vaddr == 0. If there is, don't relocate the headers,
it should be an app. Otherwise, it's a boot image and needs
to be relocated.

Add overflow checking to ElfFileImpl<>::GetLoadedSize().

Bug: 21047854
Change-Id: Ie6737f338687296b6dbf4bb3b36358501dfb1587
diff --git a/runtime/elf_file.h b/runtime/elf_file.h
index fe6896d..48cb4b8 100644
--- a/runtime/elf_file.h
+++ b/runtime/elf_file.h
@@ -66,7 +66,7 @@
                              const std::string& symbol_name,
                              bool build_map);
 
-  size_t GetLoadedSize() const;
+  bool GetLoadedSize(size_t* size, std::string* error_msg) const;
 
   // Strip an ELF file of unneeded debugging information.
   // Returns true on success, false on failure.