android/linux: Support modules with shared relros on Android

Add MemoryMap::Iterator to support different strategies for locating
the start of module mappings on Android and Linux.

Beginning with API 21, Bionic provides android_dlopen_ext() which
allows passing a file descriptor with an existing relro segment to the
loader. This means that the mapping containing the dynamic segment
could have a name, device, and inode which are different than the
other mappings for the module.

The revised strategy for Android at API 21+ is to search all mappings
in reverse order from they dynamic array mapping until a module is
parsed with the expected dynamic array address.

Linux and Android 20- continue to select mappings using the device,
inode, and file offsets of the mappings.

Bug: crashpad:268
Change-Id: I30e95e51cb6874c00875d2a9c57f1249877736d4
Reviewed-on: https://chromium-review.googlesource.com/c/1374375
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
11 files changed
tree: 583f8c219ddd51d815dad0ad5a0a37e01967c853
  1. build/
  2. client/
  3. compat/
  4. doc/
  5. handler/
  6. infra/
  7. minidump/
  8. snapshot/
  9. test/
  10. third_party/
  11. tools/
  12. util/
  13. .clang-format
  14. .gitignore
  15. .gn
  16. .vpython
  17. AUTHORS
  18. BUILD.gn
  19. codereview.settings
  20. CONTRIBUTORS
  21. crashpad.gyp
  22. DEPS
  23. LICENSE
  24. navbar.md
  25. package.h
  26. README.md
README.md

Crashpad

Crashpad is a crash-reporting system.

Documentation

Source Code

Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.

Other Links