linker: remove COUNT_PAGES
COUNT_PAGES tries to count the pages dirtied by relocations, but this
implementation is broken because it's merging rel->r_offset values from
multiple DSOs. The functionality is hard to use, because it requires
rebuilding the linker, and it's not obvious to me that it should belong
in the linker. If we do want it, we should make it work without rebuilding
the linker.
Similar information can currently be collected by parsing the result of
`readelf -r` on a binary (or a set of binaries).
Bug: none
Test: m linker libc com.android.runtime ; adb sync ; run something
Change-Id: I760fb6ea4ea3d1927eb5145cdf4ca133851d69b4
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp
index fd1592d..bea2e3c 100644
--- a/linker/linker_main.cpp
+++ b/linker/linker_main.cpp
@@ -496,31 +496,7 @@
#if STATS
print_linker_stats();
#endif
-#if COUNT_PAGES
- {
- unsigned n;
- unsigned i;
- unsigned count = 0;
- for (n = 0; n < 4096; n++) {
- if (bitmask[n]) {
- unsigned x = bitmask[n];
-#if defined(__LP64__)
- for (i = 0; i < 32; i++) {
-#else
- for (i = 0; i < 8; i++) {
-#endif
- if (x & 1) {
- count++;
- }
- x >>= 1;
- }
- }
- }
- PRINT("PAGES MODIFIED: %s: %d (%dKB)", g_argv[0], count, count * 4);
- }
-#endif
-
-#if TIMING || STATS || COUNT_PAGES
+#if TIMING || STATS
fflush(stdout);
#endif