Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: common/linux/dump_symbols.cc

Issue 1189823002: Update breakpad for Android packed relocations. (Closed) Base URL: https://chromium.googlesource.com/external/google-breakpad/src.git@master
Patch Set: Update for more review comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/linux/minidump_writer/minidump_writer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/linux/dump_symbols.cc
diff --git a/common/linux/dump_symbols.cc b/common/linux/dump_symbols.cc
index 0bcc18ab108ea15315b46b71dd6f595e1a734166..1e96ca6a86af6be7285319d1e8db3f8987191a7e 100644
--- a/common/linux/dump_symbols.cc
+++ b/common/linux/dump_symbols.cc
@@ -95,6 +95,15 @@ using google_breakpad::scoped_ptr;
#define EM_AARCH64 183
#endif
+// Define SHT_ANDROID_REL and SHT_ANDROID_RELA if not defined by the host.
+// Sections with this type contain Android packed relocations.
+#ifndef SHT_ANDROID_REL
+#define SHT_ANDROID_REL (SHT_LOOS + 1)
+#endif
+#ifndef SHT_ANDROID_RELA
+#define SHT_ANDROID_RELA (SHT_LOOS + 2)
+#endif
+
//
// FDWrapper
//
@@ -611,6 +620,28 @@ bool LoadSymbols(const string& obj_file,
bool found_debug_info_section = false;
bool found_usable_info = false;
+ // Reject files that contain Android packed relocations. The pre-packed
+ // version of the file should be symbolized; the packed version is only
+ // intended for use on the target system.
+ if (FindElfSectionByName<ElfClass>(".rel.dyn", SHT_ANDROID_REL,
+ sections, names,
+ names_end, elf_header->e_shnum)) {
+ fprintf(stderr, "%s: file contains a \".rel.dyn\" section "
+ "with type SHT_ANDROID_REL\n", obj_file.c_str());
+ fprintf(stderr, "Files containing Android packed relocations "
+ "may not be symbolized.\n");
+ return false;
+ }
+ if (FindElfSectionByName<ElfClass>(".rela.dyn", SHT_ANDROID_RELA,
+ sections, names,
+ names_end, elf_header->e_shnum)) {
+ fprintf(stderr, "%s: file contains a \".rela.dyn\" section "
+ "with type SHT_ANDROID_RELA\n", obj_file.c_str());
+ fprintf(stderr, "Files containing Android packed relocations "
+ "may not be symbolized.\n");
+ return false;
+ }
+
if (options.symbol_data != ONLY_CFI) {
#ifndef NO_STABS_SUPPORT
// Look for STABS debugging information, and load it if present.
« no previous file with comments | « client/linux/minidump_writer/minidump_writer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698