android: Optionally madvise(MADV_RANDOM) on .text.

This CL adds:

- "anchor" functions at the beginning and end of .text: these are
  already used in lightweight_cygprofile.cc, and require the orderfile
  to be properly constructed, which is the case since
  https://chromium-review.googlesource.com/753882. These functions are
  trickier for regular builds, as they use --icf=all.
- madvise(MADV_RANDOM): disable kernel readahead on a given range. This makes
  the reporting logic for code residency clearer, as it actually shows which
  pages are requested. This has to be called as early as possible and from all
  processes, and may be enabled in all builds at a later date. This is
  controlled by a new command-line flag, madvise-random-executable-code.

Bug: 758566
Change-Id: I8c7a5ca759b355b9e632d6ad027f8d9cd8fb84e8
Reviewed-on: https://chromium-review.googlesource.com/776895
Commit-Queue: Benoit L <lizeb@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Matthew Cary <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518639}

CrOS-Libchrome-Original-Commit: 411a34f5e9b7e19c5b8ca4443e20f5d51e3fa8b9
8 files changed
tree: 3f93891661be2848321d4d7b540c7090ede131f7
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/