summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbegin.obin2584 -> 2584 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginS.obin2800 -> 2800 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginT.obin2584 -> 2584 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtend.obin1104 -> 1104 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtendS.obin1104 -> 1104 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbegin.obin2588 -> 2588 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginS.obin2804 -> 2804 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginT.obin2588 -> 2588 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtend.obin1108 -> 1108 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtendS.obin1108 -> 1108 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcc.abin6279378 -> 6243338 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcov.abin316824 -> 330358 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcc.abin6278650 -> 6242834 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcov.abin316780 -> 330210 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbegin.obin2460 -> 2460 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginS.obin2668 -> 2668 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginT.obin2460 -> 2460 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtend.obin1104 -> 1104 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtendS.obin1104 -> 1104 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbegin.obin2464 -> 2464 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginS.obin2672 -> 2672 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginT.obin2464 -> 2464 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtend.obin1108 -> 1108 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtendS.obin1108 -> 1108 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcc.abin6280680 -> 6246936 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcov.abin310796 -> 324354 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcc.abin6279856 -> 6246168 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcov.abin310968 -> 324446 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/crtbegin.obin2580 -> 2580 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginS.obin2796 -> 2796 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginT.obin2580 -> 2580 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/crtend.obin1100 -> 1100 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/crtendS.obin1100 -> 1100 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-counter.def60
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.c195
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.h43
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver-kernel.c203
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver.c469
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-kernel.h121
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-merge.c299
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-profiler.c477
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov.h421
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/include-fixed/linux/a.out.h2
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/libgcc.abin6258414 -> 6223262 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/libgcov.abin316172 -> 329710 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbegin.obin2472 -> 2472 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginS.obin2680 -> 2680 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginT.obin2472 -> 2472 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtend.obin1100 -> 1100 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtendS.obin1100 -> 1100 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcc.abin6271518 -> 6238830 bytes
-rw-r--r--lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcov.abin311520 -> 324198 bytes
-rw-r--r--lib/libarm-linux-android-sim.abin371598 -> 378064 bytes
53 files changed, 2207 insertions, 83 deletions
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbegin.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbegin.o
index 33b4130..d83e841 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbegin.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbegin.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginS.o
index 0a3cebb..e58d6e4 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginT.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginT.o
index 33b4130..d83e841 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginT.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtbeginT.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtend.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtend.o
index 218b191..bf46c82 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtend.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtend.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtendS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtendS.o
index 218b191..bf46c82 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtendS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/crtendS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbegin.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbegin.o
index 64f5a1e..89400c8 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbegin.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbegin.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginS.o
index e097b64..231431d 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginT.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginT.o
index 64f5a1e..89400c8 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginT.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtbeginT.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtend.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtend.o
index 9199e27..254f158 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtend.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtend.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtendS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtendS.o
index 9199e27..254f158 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtendS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/crtendS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcc.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcc.a
index 99e8ff6..b3376a7 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcc.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcc.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcov.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcov.a
index 64e029c..79abe92 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcov.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/hard/libgcov.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcc.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcc.a
index 75d3ce7..70b71ec 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcc.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcc.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcov.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcov.a
index 36c258e..3124fb4 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcov.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/libgcov.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbegin.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbegin.o
index d46bd3a..b47471d 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbegin.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbegin.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginS.o
index 0f6d5ed..2efae0c 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginT.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginT.o
index d46bd3a..b47471d 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginT.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtbeginT.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtend.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtend.o
index 0beef75..3f99fe5 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtend.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtend.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtendS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtendS.o
index 0beef75..3f99fe5 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtendS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/crtendS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbegin.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbegin.o
index 10c6b43..0765909 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbegin.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbegin.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginS.o
index ec59971..20c8973 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginT.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginT.o
index 10c6b43..0765909 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginT.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtbeginT.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtend.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtend.o
index 8fac180..59b9b38 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtend.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtend.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtendS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtendS.o
index 8fac180..59b9b38 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtendS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/crtendS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcc.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcc.a
index 4bf28f6..ea29d72 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcc.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcc.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcov.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcov.a
index 3f93ff5..ff128d4 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcov.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/hard/libgcov.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcc.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcc.a
index 03d051a..bf4dd8b 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcc.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcc.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcov.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcov.a
index 0b0e844..743bde7 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcov.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/armv7-a/thumb/libgcov.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbegin.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbegin.o
index 8eb608a..a90d632 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbegin.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbegin.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginS.o
index 7fdb28f..9e021f7 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginT.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginT.o
index 8eb608a..a90d632 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginT.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtbeginT.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtend.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtend.o
index 0bddf05..114106b 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtend.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtend.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtendS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtendS.o
index 0bddf05..114106b 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/crtendS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/crtendS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-counter.def b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-counter.def
new file mode 100644
index 0000000..e847f05
--- /dev/null
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-counter.def
@@ -0,0 +1,60 @@
+/* Definitions for the gcov counters in the GNU compiler.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Before including this file, define a macro:
+
+ DEF_GCOV_COUNTER(COUNTER, NAME, FN_TYPE)
+
+ This macro will be expanded to all supported gcov counters, their
+ names, or the type of handler functions. FN_TYPE will be
+ expanded to a handler function, like in gcov_merge, it is
+ expanded to __gcov_merge ## FN_TYPE. */
+
+/* Arc transitions. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_ARCS, "arcs", _add)
+
+/* Histogram of value inside an interval. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_V_INTERVAL, "interval", _add)
+
+/* Histogram of exact power2 logarithm of a value. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_V_POW2, "pow2", _add)
+
+/* The most common value of expression. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_V_SINGLE, "single", _single)
+
+/* The most common difference between consecutive values of expression. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_V_DELTA, "delta", _delta)
+
+/* The most common indirect address. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_V_INDIR, "indirect_call", _single)
+
+/* Compute average value passed to the counter. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_AVERAGE, "average", _add)
+
+/* IOR of the all values passed to counter. */
+DEF_GCOV_COUNTER(GCOV_COUNTER_IOR, "ior", _ior)
+
+/* Top N value tracking for indirect calls */
+DEF_GCOV_COUNTER(GCOV_COUNTER_ICALL_TOPNV, "indirect_call_topn", _icall_topn)
+
+/* Time profile collecting first run of a function */
+DEF_GCOV_COUNTER(GCOV_TIME_PROFILER, "time_profiler", _time_profile)
+
+/* Top N value tracking for indirect calls */
+DEF_GCOV_COUNTER(GCOV_COUNTER_DIRECT_CALL, "direct_call", _dc)
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.c b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.c
index f226cbf..fc5e32e 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.c
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.c
@@ -41,7 +41,7 @@ static void gcov_allocate (unsigned);
GCOV_LINKAGE struct gcov_var
{
- FILE *file;
+ _GCOV_FILE *file;
gcov_position_t start; /* Position of first byte of block */
unsigned offset; /* Read/write position within the block. */
unsigned length; /* Read limit in the block. */
@@ -94,7 +94,7 @@ gcov_rewrite (void)
gcov_var.mode = -1;
gcov_var.start = 0;
gcov_var.offset = 0;
- fseek (gcov_var.file, 0L, SEEK_SET);
+ _GCOV_fseek (gcov_var.file, 0L, SEEK_SET);
}
#endif
@@ -120,6 +120,7 @@ static inline gcov_unsigned_t from_file (gcov_unsigned_t value)
Return zero on failure, >0 on opening an existing file and <0 on
creating a new one. */
+#ifndef __KERNEL__
GCOV_LINKAGE int
#if IN_LIBGCOV
gcov_open (const char *name)
@@ -190,7 +191,7 @@ gcov_open (const char *name, int mode)
if (fstat (fd, &st) < 0)
{
- fclose (gcov_var.file);
+ _GCOV_fclose (gcov_var.file);
gcov_var.file = 0;
return 0;
}
@@ -203,13 +204,13 @@ gcov_open (const char *name, int mode)
gcov_var.mode = mode * 2 + 1;
#else
if (mode >= 0)
- gcov_var.file = fopen (name, (mode > 0) ? "rb" : "r+b");
+ gcov_var.file = _GCOV_fopen (name, (mode > 0) ? "rb" : "r+b");
if (gcov_var.file)
gcov_var.mode = 1;
else if (mode <= 0)
{
- gcov_var.file = fopen (name, "w+b");
+ gcov_var.file = _GCOV_fopen (name, "w+b");
if (gcov_var.file)
gcov_var.mode = mode * 2 + 1;
}
@@ -221,6 +222,24 @@ gcov_open (const char *name, int mode)
return 1;
}
+#else /* __KERNEL__ */
+
+extern _GCOV_FILE *gcov_current_file;
+
+GCOV_LINKAGE int
+gcov_open (const char *name)
+{
+ gcov_var.start = 0;
+ gcov_var.offset = gcov_var.length = 0;
+ gcov_var.overread = -1u;
+ gcov_var.error = 0;
+ gcov_var.file = gcov_current_file;
+ gcov_var.mode = 1;
+
+ return 1;
+}
+#endif /* __KERNEL__ */
+
/* Close the current gcov file. Flushes data to disk. Returns nonzero
on failure or error flag set. */
@@ -234,7 +253,7 @@ gcov_close (void)
if (gcov_var.offset && gcov_var.mode < 0)
gcov_write_block (gcov_var.offset);
#endif
- fclose (gcov_var.file);
+ _GCOV_fclose (gcov_var.file);
gcov_var.file = 0;
gcov_var.length = 0;
}
@@ -290,7 +309,7 @@ gcov_allocate (unsigned length)
static void
gcov_write_block (unsigned size)
{
- if (fwrite (gcov_var.buffer, size << 2, 1, gcov_var.file) != 1)
+ if (_GCOV_fwrite (gcov_var.buffer, size << 2, 1, gcov_var.file) != 1)
gcov_var.error = 1;
gcov_var.start += size;
gcov_var.offset -= size;
@@ -336,6 +355,47 @@ gcov_write_unsigned (gcov_unsigned_t value)
buffer[0] = value;
}
+/* Compute the total length in words required to write NUM_STRINGS
+ in STRING_ARRAY as unsigned. */
+
+GCOV_LINKAGE gcov_unsigned_t
+gcov_compute_string_array_len (char **string_array,
+ gcov_unsigned_t num_strings)
+{
+ gcov_unsigned_t len = 0, i;
+ for (i = 0; i < num_strings; i++)
+ {
+ gcov_unsigned_t string_len
+ = (strlen (string_array[i]) + sizeof (gcov_unsigned_t))
+ / sizeof (gcov_unsigned_t);
+ len += string_len;
+ len += 1; /* Each string is lead by a length. */
+ }
+ return len;
+}
+
+/* Write NUM_STRINGS in STRING_ARRAY as unsigned. */
+
+GCOV_LINKAGE void
+gcov_write_string_array (char **string_array, gcov_unsigned_t num_strings)
+{
+ gcov_unsigned_t i, j;
+ for (j = 0; j < num_strings; j++)
+ {
+ gcov_unsigned_t *aligned_string;
+ gcov_unsigned_t string_len =
+ (strlen (string_array[j]) + sizeof (gcov_unsigned_t)) /
+ sizeof (gcov_unsigned_t);
+ aligned_string = (gcov_unsigned_t *)
+ alloca ((string_len + 1) * sizeof (gcov_unsigned_t));
+ memset (aligned_string, 0, (string_len + 1) * sizeof (gcov_unsigned_t));
+ aligned_string[0] = string_len;
+ strcpy ((char*) (aligned_string + 1), string_array[j]);
+ for (i = 0; i < (string_len + 1); i++)
+ gcov_write_unsigned (aligned_string[i]);
+ }
+}
+
/* Write counter VALUE to coverage file. Sets error flag
appropriately. */
@@ -517,7 +577,7 @@ gcov_read_words (unsigned words)
gcov_allocate (gcov_var.length + words);
excess = gcov_var.alloc - gcov_var.length;
#endif
- excess = fread (gcov_var.buffer + gcov_var.length,
+ excess = _GCOV_fread (gcov_var.buffer + gcov_var.length,
1, excess << 2, gcov_var.file) >> 2;
gcov_var.length += excess;
if (gcov_var.length < words)
@@ -586,6 +646,20 @@ gcov_read_string (void)
}
#endif
+#ifdef __KERNEL__
+static int
+k_popcountll (long long x)
+{
+ int c = 0;
+ while (x)
+ {
+ c++;
+ x &= (x-1);
+ }
+ return c;
+}
+#endif
+
GCOV_LINKAGE void
gcov_read_summary (struct gcov_summary *summary)
{
@@ -612,8 +686,12 @@ gcov_read_summary (struct gcov_summary *summary)
hwint.h (where popcount_hwi is declared). However, libgcov.a
is built by the bootstrapped compiler and therefore the builtins
are always available. */
+#ifndef __KERNEL__
h_cnt += __builtin_popcount (histo_bitvector[bv_ix]);
#else
+ h_cnt += k_popcountll (histo_bitvector[bv_ix]);
+#endif
+#else
h_cnt += popcount_hwi (histo_bitvector[bv_ix]);
#endif
}
@@ -650,6 +728,78 @@ gcov_read_summary (struct gcov_summary *summary)
}
}
+/* Read LENGTH words (unsigned type) from a zero profile fixup record with the
+ number of function flags saved in NUM_FNS. Returns the int flag array, which
+ should be deallocated by caller, or NULL on error. */
+
+GCOV_LINKAGE int *
+gcov_read_comdat_zero_fixup (gcov_unsigned_t length,
+ gcov_unsigned_t *num_fns)
+{
+#ifndef __KERNEL__
+ unsigned ix, f_ix;
+ gcov_unsigned_t num = gcov_read_unsigned ();
+ /* The length consists of 1 word to hold the number of functions,
+ plus enough 32-bit words to hold 1 bit/function. */
+ gcc_assert ((num + 31) / 32 + 1 == length);
+ int *zero_fixup_flags = (int *) xcalloc (num, sizeof (int));
+ for (ix = 0; ix < length - 1; ix++)
+ {
+ gcov_unsigned_t bitvector = gcov_read_unsigned ();
+ f_ix = ix * 32;
+ while (bitvector)
+ {
+ if (bitvector & 0x1)
+ zero_fixup_flags[f_ix] = 1;
+ f_ix++;
+ bitvector >>= 1;
+ }
+ }
+ *num_fns = num;
+ return zero_fixup_flags;
+#else
+ return NULL;
+#endif
+}
+
+/* Read NUM_STRINGS strings (as an unsigned array) in STRING_ARRAY, and return
+ the number of words read. */
+
+GCOV_LINKAGE gcov_unsigned_t
+gcov_read_string_array (char **string_array, gcov_unsigned_t num_strings)
+{
+ gcov_unsigned_t i, j, len = 0;
+
+ for (j = 0; j < num_strings; j++)
+ {
+ gcov_unsigned_t string_len = gcov_read_unsigned ();
+ string_array[j] =
+ (char *) xmalloc (string_len * sizeof (gcov_unsigned_t));
+ for (i = 0; i < string_len; i++)
+ ((gcov_unsigned_t *) string_array[j])[i] = gcov_read_unsigned ();
+ len += (string_len + 1);
+ }
+ return len;
+}
+
+/* Read LENGTH words (unsigned type) from a build info record with the number
+ of strings read saved in NUM_STRINGS. Returns the string array, which
+ should be deallocated by caller, or NULL on error. */
+
+GCOV_LINKAGE char **
+gcov_read_build_info (gcov_unsigned_t length, gcov_unsigned_t *num_strings)
+{
+ gcov_unsigned_t num = gcov_read_unsigned ();
+ char **build_info_strings = (char **)
+ xmalloc (sizeof (char *) * num);
+ gcov_unsigned_t len = gcov_read_string_array (build_info_strings,
+ num);
+ if (len != length - 1)
+ return NULL;
+ *num_strings = num;
+ return build_info_strings;
+}
+
#if (!IN_LIBGCOV && IN_GCOV != 1) || defined (IN_GCOV_TOOL)
/* Read LEN words (unsigned type) and construct MOD_INFO. */
@@ -657,7 +807,7 @@ GCOV_LINKAGE void
gcov_read_module_info (struct gcov_module_info *mod_info,
gcov_unsigned_t len)
{
- gcov_unsigned_t src_filename_len, filename_len, i, j, num_strings;
+ gcov_unsigned_t src_filename_len, filename_len, i, num_strings;
mod_info->ident = gcov_read_unsigned ();
mod_info->is_primary = gcov_read_unsigned ();
mod_info->flags = gcov_read_unsigned ();
@@ -689,16 +839,7 @@ gcov_read_module_info (struct gcov_module_info *mod_info,
+ mod_info->num_system_paths
+ mod_info->num_cpp_defines + mod_info->num_cpp_includes
+ mod_info->num_cl_args;
- for (j = 0; j < num_strings; j++)
- {
- gcov_unsigned_t string_len = gcov_read_unsigned ();
- mod_info->string_array[j] =
- (char *) xmalloc (string_len * sizeof (gcov_unsigned_t));
- for (i = 0; i < string_len; i++)
- ((gcov_unsigned_t *) mod_info->string_array[j])[i] =
- gcov_read_unsigned ();
- len -= (string_len + 1);
- }
+ len -= gcov_read_string_array (mod_info->string_array, num_strings);
gcc_assert (!len);
}
#endif
@@ -719,8 +860,8 @@ gcov_sync (gcov_position_t base, gcov_unsigned_t length)
else
{
gcov_var.offset = gcov_var.length = 0;
- fseek (gcov_var.file, base << 2, SEEK_SET);
- gcov_var.start = ftell (gcov_var.file) >> 2;
+ _GCOV_fseek (gcov_var.file, base << 2, SEEK_SET);
+ gcov_var.start = _GCOV_ftell (gcov_var.file) >> 2;
}
}
#endif
@@ -734,8 +875,8 @@ gcov_seek (gcov_position_t base)
gcc_assert (gcov_var.mode < 0);
if (gcov_var.offset)
gcov_write_block (gcov_var.offset);
- fseek (gcov_var.file, base << 2, SEEK_SET);
- gcov_var.start = ftell (gcov_var.file) >> 2;
+ _GCOV_fseek (gcov_var.file, base << 2, SEEK_SET);
+ gcov_var.start = _GCOV_ftell (gcov_var.file) >> 2;
}
/* Truncate the gcov file at the current position. */
@@ -743,15 +884,19 @@ gcov_seek (gcov_position_t base)
GCOV_LINKAGE void
gcov_truncate (void)
{
+#ifdef __KERNEL__
+ gcc_assert (0);
+#else
long offs;
int filenum;
gcc_assert (gcov_var.mode < 0);
if (gcov_var.offset)
gcov_write_block (gcov_var.offset);
- offs = ftell (gcov_var.file);
+ offs = _GCOV_ftell (gcov_var.file);
filenum = fileno (gcov_var.file);
- if (offs == -1 || filenum == -1 || ftruncate (filenum, offs))
+ if (offs == -1 || filenum == -1 || _GCOV_ftruncate (filenum, offs))
gcov_var.error = 1;
+#endif /* __KERNEL__ */
}
#endif
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.h b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.h
index 50ffa55..e67bce4 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.h
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/gcov-io.h
@@ -129,7 +129,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
blocks they are for.
The data file contains the following records.
- data: {unit summary:object summary:program* function-data*}*
+ data: {unit summary:program* build_info zero_fixup function-data*}*
unit: header int32:checksum
function-data: announce_function present counts
announce_function: header int32:ident
@@ -141,6 +141,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
int64:max int64:sum_max histogram
histogram: {int32:bitvector}8 histogram-buckets*
histogram-buckets: int32:num int64:min int64:sum
+ build_info: string:info*
+ zero_fixup: int32:num int32:bitvector*
The ANNOUNCE_FUNCTION record is the same as that in the note file,
but without the source location. The COUNTS gives the
@@ -152,6 +154,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
zero. Note that the data file might contain information from
several runs concatenated, or the data might be merged.
+ BUILD_INFO record contains a list of strings that is used
+ to include in the data file information about the profile generate
+ build. For example, it can be used to include source revision
+ information that is useful in diagnosing profile mis-matches.
+
+ ZERO_FIXUP record contains a count of functions in the gcda file
+ and an array of bitvectors indexed by the function index's in the
+ function-data section. Each bit flags whether the function was a
+ COMDAT that had all-zero profiles that was fixed up by dyn-ipa
+ using profiles from functions with matching checksums in other modules.
+
This file is included by both the compiler, gcov tools and the
runtime support library libgcov. IN_LIBGCOV and IN_GCOV are used to
distinguish which case is which. If IN_LIBGCOV is nonzero,
@@ -164,6 +177,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef GCC_GCOV_IO_H
#define GCC_GCOV_IO_H
+#ifndef __KERNEL__
+# define _GCOV_FILE FILE
+# define _GCOV_fclose fclose
+# define _GCOV_ftell ftell
+# define _GCOV_fseek fseek
+# define _GCOV_ftruncate ftruncate
+# define _GCOV_fread fread
+# define _GCOV_fwrite fwrite
+# define _GCOV_fread fread
+# define _GCOV_fileno fileno
+#endif
+
#ifndef IN_LIBGCOV
/* About the host */
@@ -255,8 +280,12 @@ typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;
#define GCOV_TAG_COUNTER_NUM(LENGTH) ((LENGTH) / 2)
#define GCOV_TAG_OBJECT_SUMMARY ((gcov_unsigned_t)0xa1000000) /* Obsolete */
#define GCOV_TAG_PROGRAM_SUMMARY ((gcov_unsigned_t)0xa3000000)
+#define GCOV_TAG_COMDAT_ZERO_FIXUP ((gcov_unsigned_t)0xa9000000)
+/* Ceiling divide by 32 bit word size, plus one word to hold NUM. */
+#define GCOV_TAG_COMDAT_ZERO_FIXUP_LENGTH(NUM) (1 + (NUM + 31) / 32)
#define GCOV_TAG_SUMMARY_LENGTH(NUM) \
(1 + GCOV_COUNTERS_SUMMABLE * (10 + 3 * 2) + (NUM) * 5)
+#define GCOV_TAG_BUILD_INFO ((gcov_unsigned_t)0xa7000000)
#define GCOV_TAG_MODULE_INFO ((gcov_unsigned_t)0xab000000)
#define GCOV_TAG_AFDO_FILE_NAMES ((gcov_unsigned_t)0xaa000000)
#define GCOV_TAG_AFDO_FUNCTION ((gcov_unsigned_t)0xac000000)
@@ -434,9 +463,16 @@ GCOV_LINKAGE int gcov_close (void) ATTRIBUTE_HIDDEN;
GCOV_LINKAGE gcov_unsigned_t gcov_read_unsigned (void) ATTRIBUTE_HIDDEN;
GCOV_LINKAGE gcov_type gcov_read_counter (void) ATTRIBUTE_HIDDEN;
GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *) ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE int *gcov_read_comdat_zero_fixup (gcov_unsigned_t,
+ gcov_unsigned_t *)
+ ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE char **gcov_read_build_info (gcov_unsigned_t, gcov_unsigned_t *)
+ ATTRIBUTE_HIDDEN;
GCOV_LINKAGE const char *gcov_read_string (void);
GCOV_LINKAGE void gcov_sync (gcov_position_t /*base*/,
gcov_unsigned_t /*length */);
+GCOV_LINKAGE gcov_unsigned_t gcov_read_string_array (char **, gcov_unsigned_t)
+ ATTRIBUTE_HIDDEN;
#if !IN_LIBGCOV && IN_GCOV != 1
@@ -447,6 +483,11 @@ GCOV_LINKAGE void gcov_read_module_info (struct gcov_module_info *mod_info,
#if !IN_GCOV
/* Available outside gcov */
GCOV_LINKAGE void gcov_write_unsigned (gcov_unsigned_t) ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE gcov_unsigned_t gcov_compute_string_array_len (char **,
+ gcov_unsigned_t)
+ ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE void gcov_write_string_array (char **, gcov_unsigned_t)
+ ATTRIBUTE_HIDDEN;
#endif
#if !IN_GCOV && !IN_LIBGCOV
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver-kernel.c b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver-kernel.c
new file mode 100644
index 0000000..34298ed
--- /dev/null
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver-kernel.c
@@ -0,0 +1,203 @@
+/* Routines required for instrumenting a program. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1989-2014 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+/* A utility function for outputing errors. */
+
+static int __attribute__((format(printf, 1, 2)))
+gcov_error (const char *fmt, ...)
+{
+ int ret;
+ va_list argp;
+ va_start (argp, fmt);
+ ret = vprintk (fmt, argp);
+ va_end (argp);
+ return ret;
+}
+
+static void
+allocate_filename_struct (struct gcov_filename_aux *gf)
+{
+ const char *gcov_prefix;
+ int gcov_prefix_strip = 0;
+ size_t prefix_length = 0;
+ char *gi_filename_up;
+
+ /* Allocate and initialize the filename scratch space plus one. */
+ gi_filename = (char *) xmalloc (prefix_length + gcov_max_filename + 2);
+ if (prefix_length)
+ memcpy (gi_filename, gcov_prefix, prefix_length);
+ gi_filename_up = gi_filename + prefix_length;
+
+ gf->gi_filename_up = gi_filename_up;
+ gf->prefix_length = prefix_length;
+ gf->gcov_prefix_strip = gcov_prefix_strip;
+}
+
+static int
+gcov_open_by_filename (char *gi_filename)
+{
+ gcov_open (gi_filename);
+ return 0;
+}
+
+
+/* Strip GCOV_PREFIX_STRIP levels of leading '/' from FILENAME and
+ put the result into GI_FILENAME_UP. */
+
+static void
+gcov_strip_leading_dirs (int prefix_length, int gcov_prefix_strip,
+ const char *filename, char *gi_filename_up)
+{
+ strcpy (gi_filename_up, filename);
+}
+
+/* Current virual gcda file. This is for kernel use only. */
+gcov_kernel_vfile *gcov_current_file;
+
+/* Set current virutal gcda file. It needs to be set before dumping
+ profile data. */
+
+void
+gcov_set_vfile (gcov_kernel_vfile *file)
+{
+ gcov_current_file = file;
+}
+
+/* File fclose operation in kernel mode. */
+
+int
+kernel_file_fclose (gcov_kernel_vfile *fp)
+{
+ return 0;
+}
+
+/* File ftell operation in kernel mode. It currently should not
+ be called. */
+
+long
+kernel_file_ftell (gcov_kernel_vfile *fp)
+{
+ return 0;
+}
+
+/* File fseek operation in kernel mode. It should only be called
+ with OFFSET==0 and WHENCE==0 to a freshly opened file. */
+
+int
+kernel_file_fseek (gcov_kernel_vfile *fp, long offset, int whence)
+{
+ gcc_assert (offset == 0 && whence == 0 && fp->count == 0);
+ return 0;
+}
+
+/* File ftruncate operation in kernel mode. It currently should not
+ be called. */
+
+int
+kernel_file_ftruncate (gcov_kernel_vfile *fp, off_t value)
+{
+ gcc_assert (0); /* should not reach here */
+ return 0;
+}
+
+/* File fread operation in kernel mode. It currently should not
+ be called. */
+
+int
+kernel_file_fread (void *ptr, size_t size, size_t nitems,
+ gcov_kernel_vfile *fp)
+{
+ gcc_assert (0); /* should not reach here */
+ return 0;
+}
+
+/* File fwrite operation in kernel mode. It outputs the data
+ to a buffer in the virual file. */
+
+int
+kernel_file_fwrite (const void *ptr, size_t size,
+ size_t nitems, gcov_kernel_vfile *fp)
+{
+ char *vbuf;
+ unsigned vsize, vpos;
+ unsigned len;
+
+ if (!fp) return 0;
+
+ vbuf = fp->buf;
+ vsize = fp->size;
+ vpos = fp->count;
+
+
+ if (vsize < vpos)
+ {
+ printk (KERN_ERR
+ "GCOV_KERNEL: something wrong in file %s: vbuf=%p vsize=%u"
+ " vpos=%u\n",
+ fp->info->filename, vbuf, vsize, vpos);
+ return 0;
+ }
+
+ len = vsize - vpos;
+ len /= size;
+
+ /* Increase the virtual file size if it is not suffcient. */
+ while (len < nitems)
+ {
+ vsize *= 2;
+ len = vsize - vpos;
+ len /= size;
+ }
+
+ if (vsize != fp->size)
+ {
+ vbuf = fp->buf = (char *) gcov_realloc_file_buf(vsize, vpos);
+ fp->size = vsize;
+ }
+
+ if (len > nitems)
+ len = nitems;
+
+ memcpy (vbuf+vpos, ptr, size*len);
+ fp->count += len*size;
+
+ if (len != nitems)
+ printk (KERN_ERR
+ "GCOV_KERNEL: something wrong in file %s: size=%lu nitems=%lu"
+ " len=%d vsize=%u vpos=%u \n",
+ fp->info->filename, size, nitems, len, vsize, vpos);
+ return len;
+}
+
+/* File fileno operation in kernel mode. It currently should not
+ be called. */
+
+int
+kernel_file_fileno (gcov_kernel_vfile *fp)
+{
+ gcc_assert (0); /* should not reach here */
+ return 0;
+}
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver.c b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver.c
index dc8cf36..3c569f1 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver.c
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-driver.c
@@ -34,28 +34,24 @@ void __gcov_init (struct gcov_info *p __attribute__ ((unused))) {}
#else /* inhibit_libc */
+#if !defined(__KERNEL__)
#include <string.h>
#if GCOV_LOCKED
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#endif
+#endif /* __KERNEL__ */
#ifdef L_gcov
#include "gcov-io.c"
-#ifndef IN_GCOV_TOOL
-extern gcov_unsigned_t __gcov_sampling_period;
-extern gcov_unsigned_t __gcov_has_sampling;
-static int gcov_sampling_period_initialized = 0;
-#endif
-
/* Unique identifier assigned to each module (object file). */
static gcov_unsigned_t gcov_cur_module_id = 0;
/* Dynamic call graph build and form module groups. */
-int __gcov_compute_module_groups (void) ATTRIBUTE_HIDDEN;
+int __gcov_compute_module_groups (char **zero_counts) ATTRIBUTE_HIDDEN;
void __gcov_finalize_dyn_callgraph (void) ATTRIBUTE_HIDDEN;
/* The following functions can be called from outside of this file. */
@@ -67,7 +63,11 @@ extern int get_gcov_dump_complete (void) ATTRIBUTE_HIDDEN;
extern void set_gcov_list (struct gcov_info *) ATTRIBUTE_HIDDEN;
__attribute__((weak)) void __coverage_callback (gcov_type, int);
-#ifndef IN_GCOV_TOOL
+#if !defined(IN_GCOV_TOOL) && !defined(__KERNEL__)
+extern gcov_unsigned_t __gcov_sampling_period;
+extern gcov_unsigned_t __gcov_has_sampling;
+static int gcov_sampling_period_initialized = 0;
+
/* Create a strong reference to these symbols so that they are
unconditionally pulled into the instrumented binary, even when
the only reference is a weak reference. This is necessary because
@@ -129,6 +129,24 @@ set_gcov_list (struct gcov_info *head)
__gcov_list = head;
}
+/* Flag if the current function being read was marked as having fixed-up
+ zero counters. */
+static int __gcov_curr_fn_fixed_up;
+
+/* Set function fixed up flag. */
+void
+set_gcov_fn_fixed_up (int fixed_up)
+{
+ __gcov_curr_fn_fixed_up = fixed_up;
+}
+
+/* Return function fixed up flag. */
+int
+get_gcov_fn_fixed_up (void)
+{
+ return __gcov_curr_fn_fixed_up;
+}
+
/* Size of the longest file name. */
/* We need to expose this static variable when compiling for gcov-tool. */
#ifndef IN_GCOV_TOOL
@@ -181,8 +199,8 @@ free_fn_data (const struct gcov_info *gi_ptr, struct gcov_fn_buffer *buffer,
for (ix = 0; ix != limit; ix++)
if (gi_ptr->merge[ix])
- free (buffer->info.ctrs[n_ctr++].values);
- free (buffer);
+ xfree (buffer->info.ctrs[n_ctr++].values);
+ xfree (buffer);
return next;
}
@@ -386,7 +404,10 @@ static int run_accounted = 0;
/* This funtions computes the program level summary and the histo-gram.
It computes and returns CRC32 and stored summary in THIS_PRG. */
-static gcov_unsigned_t
+#if !IN_GCOV_TOOL
+static
+#endif
+gcov_unsigned_t
gcov_exit_compute_summary (struct gcov_summary *this_prg)
{
struct gcov_info *gi_ptr;
@@ -451,14 +472,58 @@ struct gcov_filename_aux{
};
/* Including system dependent components. */
+#if !defined (__KERNEL__)
#include "libgcov-driver-system.c"
+#else
+#include "libgcov-driver-kernel.c"
+#endif
+
+static int
+scan_build_info (struct gcov_info *gi_ptr)
+{
+ gcov_unsigned_t i, length;
+ gcov_unsigned_t num_strings = 0;
+ char **build_info_strings;
+ length = gcov_read_unsigned ();
+ build_info_strings = gcov_read_build_info (length, &num_strings);
+ if (!build_info_strings)
+ {
+ gcov_error ("profiling:%s:Error reading build info\n", gi_filename);
+ return -1;
+ }
+ if (!gi_ptr->build_info)
+ {
+ gcov_error ("profiling:%s:Mismatched build info sections, expected "
+ "none, found %u strings)\n", gi_filename, num_strings);
+ return -1;
+ }
+
+ for (i = 0; i < num_strings; i++)
+ {
+ if (strcmp (build_info_strings[i], gi_ptr->build_info[i]))
+ {
+ gcov_error ("profiling:%s:Mismatched build info string "
+ "(expected %s, read %s)\n",
+ gi_filename, gi_ptr->build_info[i],
+ build_info_strings[i]);
+ return -1;
+ }
+ xfree (build_info_strings[i]);
+ }
+ xfree (build_info_strings);
+ return 0;
+}
+
+#if !defined(__KERNEL__)
/* Scan through the current open gcda file corresponding to GI_PTR
- to locate the end position of the last summary, returned in
- SUMMARY_END_POS_P. Return 0 on success, -1 on error. */
+ to locate the end position just before function data should be rewritten,
+ returned in SUMMARY_END_POS_P. E.g. scan past the last summary and other
+ sections that won't be rewritten, like the build info. Return 0 on success,
+ -1 on error. */
static int
-gcov_scan_summary_end (struct gcov_info *gi_ptr,
- gcov_position_t *summary_end_pos_p)
+gcov_scan_to_function_data (struct gcov_info *gi_ptr,
+ gcov_position_t *summary_end_pos_p)
{
gcov_unsigned_t tag, version, stamp;
tag = gcov_read_unsigned ();
@@ -493,8 +558,21 @@ gcov_scan_summary_end (struct gcov_info *gi_ptr,
return -1;
}
+ /* If there is a build info section, scan past it as well. */
+ if (tag == GCOV_TAG_BUILD_INFO)
+ {
+ if (scan_build_info (gi_ptr) < 0)
+ return -1;
+
+ *summary_end_pos_p = gcov_position ();
+ tag = gcov_read_unsigned ();
+ }
+ /* The next section should be the function counters. */
+ gcc_assert (tag == GCOV_TAG_FUNCTION);
+
return 0;
}
+#endif /* __KERNEL__ */
/* This function merges counters in GI_PTR to an existing gcda file.
Return 0 on success.
@@ -514,6 +592,7 @@ gcov_exit_merge_gcda (struct gcov_info *gi_ptr,
int error = 0;
struct gcov_fn_buffer **fn_tail = &fn_buffer;
struct gcov_summary_buffer **sum_tail = &sum_buffer;
+ int *zero_fixup_flags = NULL;
length = gcov_read_unsigned ();
if (!gcov_version (gi_ptr, length, gi_filename))
@@ -565,6 +644,31 @@ gcov_exit_merge_gcda (struct gcov_info *gi_ptr,
next_summary:;
}
+ if (tag == GCOV_TAG_BUILD_INFO)
+ {
+ if (scan_build_info (gi_ptr) < 0)
+ return -1;
+
+ /* Since the stamps matched if we got here, this should be from
+ the same compilation and the build info strings should match. */
+ tag = gcov_read_unsigned ();
+ }
+
+ if (tag == GCOV_TAG_COMDAT_ZERO_FIXUP)
+ {
+ gcov_unsigned_t num_fns = 0;
+ length = gcov_read_unsigned ();
+ zero_fixup_flags = gcov_read_comdat_zero_fixup (length, &num_fns);
+ if (!zero_fixup_flags)
+ {
+ gcov_error ("profiling:%s:Error reading zero fixup flags\n",
+ gi_filename);
+ return -1;
+ }
+
+ tag = gcov_read_unsigned ();
+ }
+
/* Merge execution counts for each function. */
for (f_ix = 0; (unsigned)f_ix != gi_ptr->n_functions;
f_ix++, tag = gcov_read_unsigned ())
@@ -598,6 +702,9 @@ gcov_exit_merge_gcda (struct gcov_info *gi_ptr,
continue;
}
+ if (zero_fixup_flags)
+ set_gcov_fn_fixed_up (zero_fixup_flags[f_ix]);
+
length = gcov_read_unsigned ();
if (length != gfi_ptr->ident)
goto read_mismatch;
@@ -629,6 +736,7 @@ gcov_exit_merge_gcda (struct gcov_info *gi_ptr,
if ((error = gcov_is_error ()))
goto read_error;
}
+ xfree (zero_fixup_flags);
if (tag && tag != GCOV_TAG_MODULE_INFO)
{
@@ -646,6 +754,57 @@ read_error:
return -1;
}
+#if !defined(__KERNEL__)
+/* Write NUM_FNS ZERO_COUNTS fixup flags to a gcda file starting from its
+ current location. */
+
+static void
+gcov_write_comdat_zero_fixup (char *zero_counts, unsigned num_fns)
+{
+ unsigned f_ix;
+ gcov_unsigned_t len = GCOV_TAG_COMDAT_ZERO_FIXUP_LENGTH (num_fns);
+ gcov_unsigned_t bitvector = 0, b_ix = 0;
+ gcov_write_tag_length (GCOV_TAG_COMDAT_ZERO_FIXUP, len);
+
+ gcov_write_unsigned (num_fns);
+ for (f_ix = 0; f_ix != num_fns; f_ix++)
+ {
+ if (zero_counts[f_ix])
+ bitvector |= 1 << b_ix;
+ if (++b_ix == 32)
+ {
+ gcov_write_unsigned (bitvector);
+ b_ix = 0;
+ bitvector = 0;
+ }
+ }
+ if (b_ix > 0)
+ gcov_write_unsigned (bitvector);
+}
+#endif /* __KERNEL__ */
+
+/* Write build_info strings from GI_PTR to a gcda file starting from its current
+ location. */
+
+static void
+gcov_write_build_info (struct gcov_info *gi_ptr)
+{
+ gcov_unsigned_t num = 0;
+ gcov_unsigned_t len = 1;
+
+ if (!gi_ptr->build_info)
+ return;
+
+ /* Count the number of strings, which is terminated with an empty string. */
+ while (gi_ptr->build_info[num][0])
+ num++;
+
+ len += gcov_compute_string_array_len (gi_ptr->build_info, num);
+ gcov_write_tag_length (GCOV_TAG_BUILD_INFO, len);
+ gcov_write_unsigned (num);
+ gcov_write_string_array (gi_ptr->build_info, num);
+}
+
/* Write counters in GI_PTR to a gcda file starting from its current
location. */
@@ -676,7 +835,7 @@ gcov_write_func_counters (struct gcov_info *gi_ptr)
if (gfi_ptr && gfi_ptr->key == gi_ptr)
length = GCOV_TAG_FUNCTION_LENGTH;
else
- length = 0;
+ length = 0;
}
gcov_write_tag_length (GCOV_TAG_FUNCTION, length);
@@ -704,8 +863,10 @@ gcov_write_func_counters (struct gcov_info *gi_ptr)
gcov_write_counter (*c_ptr++);
ci_ptr++;
}
+#if !defined(__KERNEL__)
if (buffered)
fn_buffer = free_fn_data (gi_ptr, fn_buffer, GCOV_COUNTERS);
+#endif /* __KERNEL__ */
}
gi_ptr->eof_pos = gcov_position ();
@@ -748,10 +909,12 @@ gcov_exit_write_gcda (struct gcov_info *gi_ptr,
{
gcov_write_summary (GCOV_TAG_PROGRAM_SUMMARY, &sum_buffer->summary);
next_sum_buffer = sum_buffer->next;
- free (sum_buffer);
+ xfree (sum_buffer);
sum_buffer = next_sum_buffer;
}
+ gcov_write_build_info (gi_ptr);
+
/* Write the counters. */
gcov_write_func_counters (gi_ptr);
}
@@ -835,6 +998,8 @@ gcov_exit_merge_summary (const struct gcov_info *gi_ptr, struct gcov_summary *pr
return 0;
}
+__attribute__((weak)) gcov_unsigned_t __gcov_lipo_sampling_period;
+
/* Sort N entries in VALUE_ARRAY in descending order.
Each entry in VALUE_ARRAY has two values. The sorting
is based on the second value. */
@@ -906,6 +1071,62 @@ gcov_sort_topn_counter_arrays (const struct gcov_info *gi_ptr)
}
}
+/* Scaling LIPO sampled profile counters. */
+static void
+gcov_scaling_lipo_counters (const struct gcov_info *gi_ptr)
+{
+ unsigned int i,j,k;
+ int f_ix;
+ const struct gcov_fn_info *gfi_ptr;
+ const struct gcov_ctr_info *ci_ptr;
+
+ if (__gcov_lipo_sampling_period <= 1)
+ return;
+
+ for (f_ix = 0; (unsigned)f_ix != gi_ptr->n_functions; f_ix++)
+ {
+ gfi_ptr = gi_ptr->functions[f_ix];
+ ci_ptr = gfi_ptr->ctrs;
+ for (i = 0; i < GCOV_COUNTERS; i++)
+ {
+ if (!gcov_counter_active (gi_ptr, i))
+ continue;
+ if (i == GCOV_COUNTER_ICALL_TOPNV)
+ {
+ for (j = 0; j < ci_ptr->num; j += GCOV_ICALL_TOPN_NCOUNTS)
+ for (k = 2; k < GCOV_ICALL_TOPN_NCOUNTS; k += 2)
+ ci_ptr->values[j+k] *= __gcov_lipo_sampling_period;
+ }
+ if (i == GCOV_COUNTER_DIRECT_CALL)
+ {
+ for (j = 0; j < ci_ptr->num; j += 2)
+ ci_ptr->values[j+1] *= __gcov_lipo_sampling_period;
+ }
+ ci_ptr++;
+ }
+ }
+}
+
+/* Open a gcda file specified by GI_FILENAME.
+ Return -1 on error. Return 0 on success. */
+
+static int
+gcov_exit_open_gcda_file (struct gcov_info *gi_ptr, struct gcov_filename_aux *gf)
+{
+ int gcov_prefix_strip;
+ size_t prefix_length;
+ char *gi_filename_up;
+
+ gcov_prefix_strip = gf->gcov_prefix_strip;
+ gi_filename_up = gf->gi_filename_up;
+ prefix_length = gf->prefix_length;
+
+ gcov_strip_leading_dirs (prefix_length, gcov_prefix_strip, gi_ptr->filename,
+ gi_filename_up);
+
+ return gcov_open_by_filename (gi_filename);
+}
+
/* Dump the coverage counts for one gcov_info object. We merge with existing
counts when possible, to avoid growing the .da files ad infinitum. We use
this program's checksum to make sure we only accumulate whole program
@@ -918,9 +1139,14 @@ gcov_exit_dump_gcov (struct gcov_info *gi_ptr, struct gcov_filename_aux *gf,
gcov_unsigned_t crc32, struct gcov_summary *all_prg,
struct gcov_summary *this_prg)
{
+/* We have to make the decl static as kernel has limited stack size.
+ If we put prg to stack, we will running into nasty stack overflow. */
+#if defined(__KERNEL__)
+ static
+#endif
struct gcov_summary prg; /* summary for this object over all program. */
int error;
- gcov_unsigned_t tag;
+ gcov_unsigned_t tag = 0;
gcov_position_t summary_pos = 0;
gcov_position_t eof_pos = 0;
@@ -928,12 +1154,15 @@ gcov_exit_dump_gcov (struct gcov_info *gi_ptr, struct gcov_filename_aux *gf,
sum_buffer = 0;
gcov_sort_topn_counter_arrays (gi_ptr);
+ gcov_scaling_lipo_counters (gi_ptr);
error = gcov_exit_open_gcda_file (gi_ptr, gf);
if (error == -1)
return;
+#if !defined(__KERNEL__)
tag = gcov_read_unsigned ();
+#endif
if (tag)
{
/* Merge data from file. */
@@ -964,8 +1193,21 @@ gcov_exit_dump_gcov (struct gcov_info *gi_ptr, struct gcov_filename_aux *gf,
/* fall through */
read_fatal:;
+#if !defined(__KERNEL__)
while (fn_buffer)
fn_buffer = free_fn_data (gi_ptr, fn_buffer, GCOV_COUNTERS);
+#else
+
+ /* In LIPO mode, dump the primary module info. */
+ if (gi_ptr->mod_info && gi_ptr->mod_info->is_primary)
+ {
+ /* Overwrite the zero word at the of the file. */
+ gcov_seek (gi_ptr->eof_pos);
+ gcov_write_module_info (gi_ptr, 1);
+ /* Write the end marker */
+ gcov_write_unsigned (0);
+ }
+#endif
if ((error = gcov_close ()))
gcov_error (error < 0 ?
@@ -974,6 +1216,7 @@ read_fatal:;
gi_filename);
}
+#if !defined (__KERNEL__)
/* Write imported files (auxiliary modules) for primary module GI_PTR
into file GI_FILENAME. */
@@ -1009,7 +1252,7 @@ gcov_write_import_file (char *gi_filename, struct gcov_info *gi_ptr)
fprintf (imports_file, "%s%s\n",
imp_mods[i]->imp_mod->mod_info->da_filename, GCOV_DATA_SUFFIX);
}
- free (imp_mods);
+ xfree (imp_mods);
}
fclose (imports_file);
}
@@ -1020,9 +1263,24 @@ gcov_dump_module_info (struct gcov_filename_aux *gf)
{
struct gcov_info *gi_ptr;
+ unsigned max_module_id = 0;
+ for (gi_ptr = __gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
+ {
+ unsigned mod_id = gi_ptr->mod_info->ident;
+ if (max_module_id < mod_id)
+ max_module_id = mod_id;
+ }
+ char **zero_counts = (char **) xcalloc (max_module_id, sizeof (char *));
+ for (gi_ptr = __gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
+ {
+ unsigned mod_id = gi_ptr->mod_info->ident;
+ zero_counts[mod_id-1] = (char *) xcalloc (gi_ptr->n_functions,
+ sizeof (char));
+ }
+
/* Compute the module groups and record whether there were any
counter fixups applied that require rewriting the counters. */
- int changed = __gcov_compute_module_groups ();
+ int changed = __gcov_compute_module_groups (zero_counts);
/* Now write out module group info. */
for (gi_ptr = __gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
@@ -1034,10 +1292,10 @@ gcov_dump_module_info (struct gcov_filename_aux *gf)
if (changed)
{
- /* Scan file to find the end of the summary section, which is
+ /* Scan file to find the start of the function section, which is
where we will start re-writing the counters. */
gcov_position_t summary_end_pos;
- if (gcov_scan_summary_end (gi_ptr, &summary_end_pos) == -1)
+ if (gcov_scan_to_function_data (gi_ptr, &summary_end_pos) == -1)
gcov_error ("profiling:%s:Error scanning summaries\n",
gi_filename);
else
@@ -1045,8 +1303,15 @@ gcov_dump_module_info (struct gcov_filename_aux *gf)
gcov_position_t eof_pos = gi_ptr->eof_pos;
gcov_rewrite ();
gcov_seek (summary_end_pos);
+
+ unsigned mod_id = gi_ptr->mod_info->ident;
+ gcov_write_comdat_zero_fixup (zero_counts[mod_id-1],
+ gi_ptr->n_functions);
+ gcov_position_t zero_fixup_eof_pos = gcov_position ();
+
gcov_write_func_counters (gi_ptr);
- gcc_assert (eof_pos == gi_ptr->eof_pos);
+ gcc_assert (eof_pos + (zero_fixup_eof_pos - summary_end_pos)
+ == gi_ptr->eof_pos);
}
}
else
@@ -1065,7 +1330,11 @@ gcov_dump_module_info (struct gcov_filename_aux *gf)
"profiling:%s:Error writing\n",
gi_filename);
gcov_write_import_file (gi_filename, gi_ptr);
+ free (zero_counts[gi_ptr->mod_info->ident-1]);
}
+
+ free (zero_counts);
+
__gcov_finalize_dyn_callgraph ();
}
@@ -1102,7 +1371,8 @@ gcov_exit (void)
/* The IS_PRIMARY field is overloaded to indicate if this module
is FDO/LIPO. */
- dump_module_info |= gi_ptr->mod_info->is_primary;
+ if (gi_ptr->mod_info)
+ dump_module_info |= gi_ptr->mod_info->is_primary;
}
run_accounted = 1;
@@ -1110,38 +1380,7 @@ gcov_exit (void)
gcov_dump_module_info (&gf);
if (gi_filename)
- free (gi_filename);
-}
-
-/* Reset all counters to zero. */
-
-void
-gcov_clear (void)
-{
- const struct gcov_info *gi_ptr;
-
- for (gi_ptr = __gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
- {
- unsigned f_ix;
-
- for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
- {
- unsigned t_ix;
- const struct gcov_fn_info *gfi_ptr = gi_ptr->functions[f_ix];
-
- if (!gfi_ptr || gfi_ptr->key != gi_ptr)
- continue;
- const struct gcov_ctr_info *ci_ptr = gfi_ptr->ctrs;
- for (t_ix = 0; t_ix != GCOV_COUNTERS; t_ix++)
- {
- if (!gi_ptr->merge[t_ix])
- continue;
-
- memset (ci_ptr->values, 0, sizeof (gcov_type) * ci_ptr->num);
- ci_ptr++;
- }
- }
- }
+ xfree (gi_filename);
}
/* Add a new object file onto the bb chain. Invoked automatically
@@ -1160,6 +1399,13 @@ __gcov_init (struct gcov_info *info)
if (env_value_int >= 1)
__gcov_sampling_period = env_value_int;
}
+ env_value_str = getenv ("GCOV_LIPO_SAMPLING_PERIOD");
+ if (env_value_str)
+ {
+ int env_value_int = atoi(env_value_str);
+ if (env_value_int >= 0)
+ __gcov_lipo_sampling_period = env_value_int;
+ }
gcov_sampling_period_initialized = 1;
}
#endif
@@ -1189,5 +1435,116 @@ __gcov_init (struct gcov_info *info)
info->version = 0;
}
+#else /* __KERNEL__ */
+
+static struct gcov_filename_aux gf;
+static gcov_unsigned_t crc32;
+static struct gcov_summary all_prg;
+static struct gcov_summary this_prg;
+void
+gcov_kernel_dump_gcov_init (void)
+{
+ crc32 = gcov_exit_compute_summary (&this_prg);
+ allocate_filename_struct (&gf);
+ memset (&all_prg, 0, sizeof (all_prg));
+}
+
+void
+gcov_kernel_dump_one_gcov(struct gcov_info *info)
+{
+ gcov_exit_dump_gcov (info, &gf, crc32, &all_prg, &this_prg);
+}
+
+#endif /* __KERNEL__ */
+
+/* Reset all counters to zero. */
+
+void
+gcov_clear (void)
+{
+ const struct gcov_info *gi_ptr;
+
+ for (gi_ptr = __gcov_list; gi_ptr; gi_ptr = gi_ptr->next)
+ {
+ unsigned f_ix;
+
+ for (f_ix = 0; f_ix < gi_ptr->n_functions; f_ix++)
+ {
+ unsigned t_ix;
+ const struct gcov_fn_info *gfi_ptr = gi_ptr->functions[f_ix];
+ const struct gcov_ctr_info *ci_ptr;
+
+ if (!gfi_ptr || gfi_ptr->key != gi_ptr)
+ continue;
+ ci_ptr = gfi_ptr->ctrs;
+ for (t_ix = 0; t_ix != GCOV_COUNTERS; t_ix++)
+ {
+ if (!gi_ptr->merge[t_ix])
+ continue;
+
+ memset (ci_ptr->values, 0, sizeof (gcov_type) * ci_ptr->num);
+ ci_ptr++;
+ }
+ }
+ }
+}
+
+/* Write out MOD_INFO into the gcda file. IS_PRIMARY is a flag
+ indicating if the module is the primary module in the group. */
+
+void
+gcov_write_module_info (const struct gcov_info *mod_info,
+ unsigned is_primary)
+{
+ gcov_unsigned_t len = 0, filename_len = 0, src_filename_len = 0, i;
+ gcov_unsigned_t num_strings;
+ gcov_unsigned_t *aligned_fname;
+ struct gcov_module_info *module_info = mod_info->mod_info;
+ filename_len = (strlen (module_info->da_filename) +
+ sizeof (gcov_unsigned_t)) / sizeof (gcov_unsigned_t);
+ src_filename_len = (strlen (module_info->source_filename) +
+ sizeof (gcov_unsigned_t)) / sizeof (gcov_unsigned_t);
+ len = filename_len + src_filename_len;
+ len += 2; /* each name string is led by a length. */
+
+ num_strings = module_info->num_quote_paths + module_info->num_bracket_paths
+ + module_info->num_system_paths
+ + module_info->num_cpp_defines + module_info->num_cpp_includes
+ + module_info->num_cl_args;
+ len += gcov_compute_string_array_len (module_info->string_array,
+ num_strings);
+
+ len += 11; /* 11 more fields */
+
+ gcov_write_tag_length (GCOV_TAG_MODULE_INFO, len);
+ gcov_write_unsigned (module_info->ident);
+ gcov_write_unsigned (is_primary);
+ gcov_write_unsigned (module_info->flags);
+ gcov_write_unsigned (module_info->lang);
+ gcov_write_unsigned (module_info->ggc_memory);
+ gcov_write_unsigned (module_info->num_quote_paths);
+ gcov_write_unsigned (module_info->num_bracket_paths);
+ gcov_write_unsigned (module_info->num_system_paths);
+ gcov_write_unsigned (module_info->num_cpp_defines);
+ gcov_write_unsigned (module_info->num_cpp_includes);
+ gcov_write_unsigned (module_info->num_cl_args);
+
+ /* Now write the filenames */
+ aligned_fname = (gcov_unsigned_t *) alloca ((filename_len + src_filename_len + 2) *
+ sizeof (gcov_unsigned_t));
+ memset (aligned_fname, 0,
+ (filename_len + src_filename_len + 2) * sizeof (gcov_unsigned_t));
+ aligned_fname[0] = filename_len;
+ strcpy ((char*) (aligned_fname + 1), module_info->da_filename);
+ aligned_fname[filename_len + 1] = src_filename_len;
+ strcpy ((char*) (aligned_fname + filename_len + 2), module_info->source_filename);
+
+ for (i = 0; i < (filename_len + src_filename_len + 2); i++)
+ gcov_write_unsigned (aligned_fname[i]);
+
+ /* Now write the string array. */
+ gcov_write_string_array (module_info->string_array, num_strings);
+}
+
#endif /* L_gcov */
#endif /* inhibit_libc */
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-kernel.h b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-kernel.h
new file mode 100644
index 0000000..b44af53
--- /dev/null
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-kernel.h
@@ -0,0 +1,121 @@
+/* Header file for libgcov-*.c.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_LIBGCOV_KERNEL_H
+#define GCC_LIBGCOV_KERNEL_H
+
+/* work around the poisoned malloc/calloc in system.h. */
+#ifndef xmalloc
+#define xmalloc vmalloc
+#endif
+#ifndef xcalloc
+#define xcalloc vcalloc
+#endif
+#ifndef xrealloc
+#define xrealloc vrealloc
+#endif
+#ifndef xfree
+#define xfree vfree
+#endif
+#ifndef alloca
+#define alloca __builtin_alloca
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+
+ /* Define MACROs to be used by kernel compilation. */
+# define L_gcov
+# define L_gcov_interval_profiler
+# define L_gcov_pow2_profiler
+# define L_gcov_one_value_profiler
+# define L_gcov_indirect_call_profiler_v2
+# define L_gcov_direct_call_profiler
+# define L_gcov_indirect_call_profiler
+# define L_gcov_indirect_call_topn_profiler
+# define L_gcov_time_profiler
+# define L_gcov_average_profiler
+# define L_gcov_ior_profiler
+# define L_gcov_merge_add
+# define L_gcov_merge_single
+# define L_gcov_merge_delta
+# define L_gcov_merge_ior
+# define L_gcov_merge_time_profile
+# define L_gcov_merge_icall_topn
+# define L_gcov_merge_dc
+
+# define IN_LIBGCOV 1
+# define IN_GCOV 0
+#define THREAD_PREFIX
+#define GCOV_LINKAGE /* nothing */
+#define BITS_PER_UNIT 8
+#define LONG_LONG_TYPE_SIZE 64
+#define MEMMODEL_RELAXED 0
+
+#define ENABLE_ASSERT_CHECKING 1
+
+/* gcc_assert() prints out a warning if the check fails. It
+ will not abort. */
+#if ENABLE_ASSERT_CHECKING
+# define gcc_assert(EXPR) \
+ ((void)(!(EXPR) ? printk (KERN_WARNING \
+ "GCOV assertion fails: func=%s line=%d\n", \
+ __FUNCTION__, __LINE__), 0 : 0))
+#else
+# define gcc_assert(EXPR) ((void)(0 && (EXPR)))
+#endif
+
+/* In Linux kernel mode, a virtual file is used for file operations. */
+struct gcov_info;
+typedef struct {
+ long size; /* size of buf */
+ long count; /* element written into buf */
+ struct gcov_info *info;
+ char *buf;
+} gcov_kernel_vfile;
+
+#define _GCOV_FILE gcov_kernel_vfile
+
+/* Wrappers to the file operations. */
+#define _GCOV_fclose kernel_file_fclose
+#define _GCOV_ftell kernel_file_ftell
+#define _GCOV_fseek kernel_file_fseek
+#define _GCOV_ftruncate kernel_file_ftruncate
+#define _GCOV_fread kernel_file_fread
+#define _GCOV_fwrite kernel_file_fwrite
+#define _GCOV_fileno kernel_file_fileno
+
+/* Declarations for virtual files operations. */
+extern int kernel_file_fclose (gcov_kernel_vfile *);
+extern long kernel_file_ftell (gcov_kernel_vfile *);
+extern int kernel_file_fseek (gcov_kernel_vfile *, long, int);
+extern int kernel_file_ftruncate (gcov_kernel_vfile *, off_t);
+extern int kernel_file_fread (void *, size_t, size_t,
+ gcov_kernel_vfile *);
+extern int kernel_file_fwrite (const void *, size_t, size_t,
+ gcov_kernel_vfile *);
+extern int kernel_file_fileno (gcov_kernel_vfile *);
+
+#endif /* GCC_LIBGCOV_KERNEL_H */
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-merge.c b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-merge.c
new file mode 100644
index 0000000..997dab3
--- /dev/null
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-merge.c
@@ -0,0 +1,299 @@
+/* Routines required for instrumenting a program. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1989-2014 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#include "libgcov.h"
+
+#if defined(inhibit_libc)
+/* If libc and its header files are not available, provide dummy functions. */
+
+#ifdef L_gcov_merge_add
+void __gcov_merge_add (gcov_type *counters __attribute__ ((unused)),
+ unsigned n_counters __attribute__ ((unused))) {}
+#endif
+
+#ifdef L_gcov_merge_single
+void __gcov_merge_single (gcov_type *counters __attribute__ ((unused)),
+ unsigned n_counters __attribute__ ((unused))) {}
+#endif
+
+#ifdef L_gcov_merge_delta
+void __gcov_merge_delta (gcov_type *counters __attribute__ ((unused)),
+ unsigned n_counters __attribute__ ((unused))) {}
+#endif
+
+#else
+
+#ifdef L_gcov_merge_add
+/* The profile merging function that just adds the counters. It is given
+ an array COUNTERS of N_COUNTERS old counters and it reads the same number
+ of counters from the gcov file. */
+void
+__gcov_merge_add (gcov_type *counters, unsigned n_counters)
+{
+ for (; n_counters; counters++, n_counters--)
+ *counters += gcov_get_counter ();
+}
+#endif /* L_gcov_merge_add */
+
+#ifdef L_gcov_merge_ior
+/* The profile merging function that just adds the counters. It is given
+ an array COUNTERS of N_COUNTERS old counters and it reads the same number
+ of counters from the gcov file. */
+void
+__gcov_merge_ior (gcov_type *counters, unsigned n_counters)
+{
+ for (; n_counters; counters++, n_counters--)
+ *counters |= gcov_get_counter_target ();
+}
+#endif
+
+
+#ifdef L_gcov_merge_dc
+
+/* Returns 1 if the function global id GID is not valid. */
+
+static int
+__gcov_is_gid_insane (gcov_type gid)
+{
+ if (EXTRACT_MODULE_ID_FROM_GLOBAL_ID (gid) == 0
+ || EXTRACT_FUNC_ID_FROM_GLOBAL_ID (gid) == 0)
+ return 1;
+ return 0;
+}
+
+/* The profile merging function used for merging direct call counts
+ This function is given array COUNTERS of N_COUNTERS old counters and it
+ reads the same number of counters from the gcov file. */
+
+void
+__gcov_merge_dc (gcov_type *counters, unsigned n_counters)
+{
+ unsigned i;
+
+ gcc_assert (!(n_counters % 2));
+ for (i = 0; i < n_counters; i += 2)
+ {
+ gcov_type global_id = gcov_get_counter_target ();
+ gcov_type call_count = gcov_get_counter ();
+
+ /* Note that global id counter may never have been set if no calls were
+ made from this call-site. */
+ if (counters[i] && global_id)
+ {
+ /* TODO race condition requires us do the following correction. */
+ if (__gcov_is_gid_insane (counters[i]))
+ counters[i] = global_id;
+ else if (__gcov_is_gid_insane (global_id))
+ global_id = counters[i];
+
+#if !defined(__KERNEL__)
+ /* In the case of inconsistency, use the src's target. */
+ if (counters[i] != global_id)
+ fprintf (stderr, "Warning: Inconsistent call targets in"
+ " direct-call profile.\n");
+#endif
+ }
+ else if (global_id)
+ counters[i] = global_id;
+
+ counters[i + 1] += call_count;
+
+ /* Reset. */
+ if (__gcov_is_gid_insane (counters[i]))
+ counters[i] = counters[i + 1] = 0;
+
+ /* Assert that the invariant (global_id == 0) <==> (call_count == 0)
+ holds true after merging. */
+ if (counters[i] == 0)
+ counters[i+1] = 0;
+ if (counters[i + 1] == 0)
+ counters[i] = 0;
+ }
+}
+#endif
+
+
+#ifdef L_gcov_merge_icall_topn
+/* The profile merging function used for merging indirect call counts
+ This function is given array COUNTERS of N_COUNTERS old counters and it
+ reads the same number of counters from the gcov file. */
+
+void
+__gcov_merge_icall_topn (gcov_type *counters, unsigned n_counters)
+{
+ unsigned i, j, k, m;
+
+ gcc_assert (!(n_counters % GCOV_ICALL_TOPN_NCOUNTS));
+ for (i = 0; i < n_counters; i += GCOV_ICALL_TOPN_NCOUNTS)
+ {
+ gcov_type *value_array = &counters[i + 1];
+ unsigned tmp_size = 2 * (GCOV_ICALL_TOPN_NCOUNTS - 1);
+ gcov_type *tmp_array
+ = (gcov_type *) alloca (tmp_size * sizeof (gcov_type));
+
+ for (j = 0; j < tmp_size; j++)
+ tmp_array[j] = 0;
+
+ for (j = 0; j < GCOV_ICALL_TOPN_NCOUNTS - 1; j += 2)
+ {
+ tmp_array[j] = value_array[j];
+ tmp_array[j + 1] = value_array [j + 1];
+ }
+
+ /* Skip the number_of_eviction entry. */
+ gcov_get_counter ();
+ for (k = 0; k < GCOV_ICALL_TOPN_NCOUNTS - 1; k += 2)
+ {
+ int found = 0;
+ gcov_type global_id = gcov_get_counter_target ();
+ gcov_type call_count = gcov_get_counter ();
+ for (m = 0; m < j; m += 2)
+ {
+ if (tmp_array[m] == global_id)
+ {
+ found = 1;
+ tmp_array[m + 1] += call_count;
+ break;
+ }
+ }
+ if (!found)
+ {
+ tmp_array[j] = global_id;
+ tmp_array[j + 1] = call_count;
+ j += 2;
+ }
+ }
+ /* Now sort the temp array */
+ gcov_sort_n_vals (tmp_array, j);
+
+ /* Now copy back the top half of the temp array */
+ for (k = 0; k < GCOV_ICALL_TOPN_NCOUNTS - 1; k += 2)
+ {
+ value_array[k] = tmp_array[k];
+ value_array[k + 1] = tmp_array[k + 1];
+ }
+ }
+}
+#endif
+
+
+#ifdef L_gcov_merge_time_profile
+/* Time profiles are merged so that minimum from all valid (greater than zero)
+ is stored. There could be a fork that creates new counters. To have
+ the profile stable, we chosen to pick the smallest function visit time. */
+void
+__gcov_merge_time_profile (gcov_type *counters, unsigned n_counters)
+{
+ unsigned int i;
+ gcov_type value;
+
+ for (i = 0; i < n_counters; i++)
+ {
+ value = gcov_get_counter_target ();
+
+ if (value && (!counters[i] || value < counters[i]))
+ counters[i] = value;
+ }
+}
+#endif /* L_gcov_merge_time_profile */
+
+#ifdef L_gcov_merge_single
+/* The profile merging function for choosing the most common value.
+ It is given an array COUNTERS of N_COUNTERS old counters and it
+ reads the same number of counters from the gcov file. The counters
+ are split into 3-tuples where the members of the tuple have
+ meanings:
+
+ -- the stored candidate on the most common value of the measured entity
+ -- counter
+ -- total number of evaluations of the value */
+void
+__gcov_merge_single (gcov_type *counters, unsigned n_counters)
+{
+ unsigned i, n_measures;
+ gcov_type value, counter, all;
+
+ gcc_assert (!(n_counters % 3));
+ n_measures = n_counters / 3;
+ for (i = 0; i < n_measures; i++, counters += 3)
+ {
+ value = gcov_get_counter_target ();
+ counter = gcov_get_counter ();
+ all = gcov_get_counter ();
+
+ if (counters[0] == value)
+ counters[1] += counter;
+ else if (counter > counters[1])
+ {
+ counters[0] = value;
+ counters[1] = counter - counters[1];
+ }
+ else
+ counters[1] -= counter;
+ counters[2] += all;
+ }
+}
+#endif /* L_gcov_merge_single */
+
+#ifdef L_gcov_merge_delta
+/* The profile merging function for choosing the most common
+ difference between two consecutive evaluations of the value. It is
+ given an array COUNTERS of N_COUNTERS old counters and it reads the
+ same number of counters from the gcov file. The counters are split
+ into 4-tuples where the members of the tuple have meanings:
+
+ -- the last value of the measured entity
+ -- the stored candidate on the most common difference
+ -- counter
+ -- total number of evaluations of the value */
+void
+__gcov_merge_delta (gcov_type *counters, unsigned n_counters)
+{
+ unsigned i, n_measures;
+ gcov_type value, counter, all;
+
+ gcc_assert (!(n_counters % 4));
+ n_measures = n_counters / 4;
+ for (i = 0; i < n_measures; i++, counters += 4)
+ {
+ /* last = */ gcov_get_counter ();
+ value = gcov_get_counter_target ();
+ counter = gcov_get_counter ();
+ all = gcov_get_counter ();
+
+ if (counters[1] == value)
+ counters[2] += counter;
+ else if (counter > counters[2])
+ {
+ counters[1] = value;
+ counters[2] = counter - counters[2];
+ }
+ else
+ counters[2] -= counter;
+ counters[3] += all;
+ }
+}
+#endif /* L_gcov_merge_delta */
+#endif /* inhibit_libc */
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-profiler.c b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-profiler.c
new file mode 100644
index 0000000..7552ada
--- /dev/null
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov-profiler.c
@@ -0,0 +1,477 @@
+/* Routines required for instrumenting a program. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1989-2014 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#include "libgcov.h"
+#if !defined(inhibit_libc)
+
+#ifdef L_gcov_interval_profiler
+/* If VALUE is in interval <START, START + STEPS - 1>, then increases the
+ corresponding counter in COUNTERS. If the VALUE is above or below
+ the interval, COUNTERS[STEPS] or COUNTERS[STEPS + 1] is increased
+ instead. */
+
+void
+__gcov_interval_profiler (gcov_type *counters, gcov_type value,
+ int start, unsigned steps)
+{
+ gcov_type delta = value - start;
+ if (delta < 0)
+ counters[steps + 1]++;
+ else if (delta >= steps)
+ counters[steps]++;
+ else
+ counters[delta]++;
+}
+#endif
+
+#ifdef L_gcov_pow2_profiler
+/* If VALUE is a power of two, COUNTERS[1] is incremented. Otherwise
+ COUNTERS[0] is incremented. */
+
+void
+__gcov_pow2_profiler (gcov_type *counters, gcov_type value)
+{
+ if (value & (value - 1))
+ counters[0]++;
+ else
+ counters[1]++;
+}
+#endif
+
+/* Tries to determine the most common value among its inputs. Checks if the
+ value stored in COUNTERS[0] matches VALUE. If this is the case, COUNTERS[1]
+ is incremented. If this is not the case and COUNTERS[1] is not zero,
+ COUNTERS[1] is decremented. Otherwise COUNTERS[1] is set to one and
+ VALUE is stored to COUNTERS[0]. This algorithm guarantees that if this
+ function is called more than 50% of the time with one value, this value
+ will be in COUNTERS[0] in the end.
+
+ In any case, COUNTERS[2] is incremented. */
+
+static inline void
+__gcov_one_value_profiler_body (gcov_type *counters, gcov_type value)
+{
+ if (value == counters[0])
+ counters[1]++;
+ else if (counters[1] == 0)
+ {
+ counters[1] = 1;
+ counters[0] = value;
+ }
+ else
+ counters[1]--;
+ counters[2]++;
+}
+
+/* Atomic update version of __gcov_one_value_profile_body(). */
+static inline void
+__gcov_one_value_profiler_body_atomic (gcov_type *counters, gcov_type value)
+{
+ if (value == counters[0])
+ GCOV_TYPE_ATOMIC_FETCH_ADD_FN (&counters[1], 1, MEMMODEL_RELAXED);
+ else if (counters[1] == 0)
+ {
+ counters[1] = 1;
+ counters[0] = value;
+ }
+ else
+ GCOV_TYPE_ATOMIC_FETCH_ADD_FN (&counters[1], -1, MEMMODEL_RELAXED);
+ GCOV_TYPE_ATOMIC_FETCH_ADD_FN (&counters[2], 1, MEMMODEL_RELAXED);
+}
+
+
+#ifdef L_gcov_one_value_profiler
+void
+__gcov_one_value_profiler (gcov_type *counters, gcov_type value)
+{
+ __gcov_one_value_profiler_body (counters, value);
+}
+
+void
+__gcov_one_value_profiler_atomic (gcov_type *counters, gcov_type value)
+{
+ __gcov_one_value_profiler_body_atomic (counters, value);
+}
+
+
+#endif
+
+#ifdef L_gcov_indirect_call_profiler
+/* This function exist only for workaround of binutils bug 14342.
+ Once this compatibility hack is obsolette, it can be removed. */
+
+/* By default, the C++ compiler will use function addresses in the
+ vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero
+ tells the compiler to use function descriptors instead. The value
+ of this macro says how many words wide the descriptor is (normally 2),
+ but it may be dependent on target flags. Since we do not have access
+ to the target flags here we just check to see if it is set and use
+ that to set VTABLE_USES_DESCRIPTORS to 0 or 1.
+
+ It is assumed that the address of a function descriptor may be treated
+ as a pointer to a function. */
+
+#ifdef TARGET_VTABLE_USES_DESCRIPTORS
+#define VTABLE_USES_DESCRIPTORS 1
+#else
+#define VTABLE_USES_DESCRIPTORS 0
+#endif
+
+/* Tries to determine the most common value among its inputs. */
+void
+__gcov_indirect_call_profiler (gcov_type* counter, gcov_type value,
+ void* cur_func, void* callee_func)
+{
+ /* If the C++ virtual tables contain function descriptors then one
+ function may have multiple descriptors and we need to dereference
+ the descriptors to see if they point to the same function. */
+ if (cur_func == callee_func
+ || (VTABLE_USES_DESCRIPTORS && callee_func
+ && *(void **) cur_func == *(void **) callee_func))
+ __gcov_one_value_profiler_body (counter, value);
+}
+
+
+/* Atomic update version of __gcov_indirect_call_profiler(). */
+void
+__gcov_indirect_call_profiler_atomic (gcov_type* counter, gcov_type value,
+ void* cur_func, void* callee_func)
+{
+ if (cur_func == callee_func
+ || (VTABLE_USES_DESCRIPTORS && callee_func
+ && *(void **) cur_func == *(void **) callee_func))
+ __gcov_one_value_profiler_body_atomic (counter, value);
+}
+
+
+#endif
+#ifdef L_gcov_indirect_call_profiler_v2
+
+/* These two variables are used to actually track caller and callee. Keep
+ them in TLS memory so races are not common (they are written to often).
+ The variables are set directly by GCC instrumented code, so declaration
+ here must match one in tree-profile.c */
+
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+void * __gcov_indirect_call_callee;
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+gcov_type * __gcov_indirect_call_counters;
+
+/* By default, the C++ compiler will use function addresses in the
+ vtable entries. Setting TARGET_VTABLE_USES_DESCRIPTORS to nonzero
+ tells the compiler to use function descriptors instead. The value
+ of this macro says how many words wide the descriptor is (normally 2),
+ but it may be dependent on target flags. Since we do not have access
+ to the target flags here we just check to see if it is set and use
+ that to set VTABLE_USES_DESCRIPTORS to 0 or 1.
+
+ It is assumed that the address of a function descriptor may be treated
+ as a pointer to a function. */
+
+#ifdef TARGET_VTABLE_USES_DESCRIPTORS
+#define VTABLE_USES_DESCRIPTORS 1
+#else
+#define VTABLE_USES_DESCRIPTORS 0
+#endif
+
+/* Tries to determine the most common value among its inputs. */
+void
+__gcov_indirect_call_profiler_v2 (gcov_type value, void* cur_func)
+{
+ /* If the C++ virtual tables contain function descriptors then one
+ function may have multiple descriptors and we need to dereference
+ the descriptors to see if they point to the same function. */
+ if (cur_func == __gcov_indirect_call_callee
+ || (VTABLE_USES_DESCRIPTORS && __gcov_indirect_call_callee
+ && *(void **) cur_func == *(void **) __gcov_indirect_call_callee))
+ __gcov_one_value_profiler_body (__gcov_indirect_call_counters, value);
+}
+
+void
+__gcov_indirect_call_profiler_atomic_v2 (gcov_type value, void* cur_func)
+{
+ /* If the C++ virtual tables contain function descriptors then one
+ function may have multiple descriptors and we need to dereference
+ the descriptors to see if they point to the same function. */
+ if (cur_func == __gcov_indirect_call_callee
+ || (VTABLE_USES_DESCRIPTORS && __gcov_indirect_call_callee
+ && *(void **) cur_func == *(void **) __gcov_indirect_call_callee))
+ __gcov_one_value_profiler_body_atomic (__gcov_indirect_call_counters, value);
+}
+
+#endif
+
+/*
+#if defined(L_gcov_direct_call_profiler) || defined(L_gcov_indirect_call_topn_profiler)
+__attribute__ ((weak)) gcov_unsigned_t __gcov_lipo_sampling_period;
+#endif
+*/
+
+extern gcov_unsigned_t __gcov_lipo_sampling_period;
+
+#ifdef L_gcov_indirect_call_topn_profiler
+
+#include "gthr.h"
+
+#ifdef __GTHREAD_MUTEX_INIT
+__thread int in_profiler;
+ATTRIBUTE_HIDDEN __gthread_mutex_t __indir_topn_val_mx = __GTHREAD_MUTEX_INIT;
+#endif
+
+/* Tries to keep track the most frequent N values in the counters where
+ N is specified by parameter TOPN_VAL. To track top N values, 2*N counter
+ entries are used.
+ counter[0] --- the accumative count of the number of times one entry in
+ in the counters gets evicted/replaced due to limited capacity.
+ When this value reaches a threshold, the bottom N values are
+ cleared.
+ counter[1] through counter[2*N] records the top 2*N values collected so far.
+ Each value is represented by two entries: count[2*i+1] is the ith value, and
+ count[2*i+2] is the number of times the value is seen. */
+
+static void
+__gcov_topn_value_profiler_body (gcov_type *counters, gcov_type value,
+ gcov_unsigned_t topn_val)
+{
+ unsigned i, found = 0, have_zero_count = 0;
+
+ gcov_type *entry;
+ gcov_type *lfu_entry = &counters[1];
+ gcov_type *value_array = &counters[1];
+ gcov_type *num_eviction = &counters[0];
+
+ /* There are 2*topn_val values tracked, each value takes two slots in the
+ counter array */
+#ifdef __GTHREAD_MUTEX_INIT
+ /* If this is reentry, return. */
+ if (in_profiler == 1)
+ return;
+
+ in_profiler = 1;
+ __gthread_mutex_lock (&__indir_topn_val_mx);
+#endif
+ for (i = 0; i < topn_val << 2; i += 2)
+ {
+ entry = &value_array[i];
+ if (entry[0] == value)
+ {
+ entry[1]++ ;
+ found = 1;
+ break;
+ }
+ else if (entry[1] == 0)
+ {
+ lfu_entry = entry;
+ have_zero_count = 1;
+ }
+ else if (entry[1] < lfu_entry[1])
+ lfu_entry = entry;
+ }
+
+ if (found)
+ {
+ in_profiler = 0;
+#ifdef __GTHREAD_MUTEX_INIT
+ __gthread_mutex_unlock (&__indir_topn_val_mx);
+#endif
+ return;
+ }
+
+ /* lfu_entry is either an empty entry or an entry
+ with lowest count, which will be evicted. */
+ lfu_entry[0] = value;
+ lfu_entry[1] = 1;
+
+#define GCOV_ICALL_COUNTER_CLEAR_THRESHOLD 3000
+
+ /* Too many evictions -- time to clear bottom entries to
+ avoid hot values bumping each other out. */
+ if (!have_zero_count
+ && ++*num_eviction >= GCOV_ICALL_COUNTER_CLEAR_THRESHOLD)
+ {
+ unsigned i, j;
+ gcov_type **p;
+ gcov_type **tmp_cnts
+ = (gcov_type **)alloca (topn_val * sizeof(gcov_type *));
+
+ *num_eviction = 0;
+
+ /* Find the largest topn_val values from the group of
+ 2*topn_val values and put the addresses into tmp_cnts. */
+ for (i = 0; i < topn_val; i++)
+ tmp_cnts[i] = &value_array[i * 2 + 1];
+
+ for (i = topn_val * 2; i < topn_val << 2; i += 2)
+ {
+ p = &tmp_cnts[0];
+ for (j = 1; j < topn_val; j++)
+ if (*tmp_cnts[j] > **p)
+ p = &tmp_cnts[j];
+ if (value_array[i + 1] < **p)
+ *p = &value_array[i + 1];
+ }
+
+ /* Zero out low value entries. */
+ for (i = 0; i < topn_val; i++)
+ {
+ *tmp_cnts[i] = 0;
+ *(tmp_cnts[i] - 1) = 0;
+ }
+ }
+
+#ifdef __GTHREAD_MUTEX_INIT
+ in_profiler = 0;
+ __gthread_mutex_unlock (&__indir_topn_val_mx);
+#endif
+}
+
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+gcov_type *__gcov_indirect_call_topn_counters ATTRIBUTE_HIDDEN;
+
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+void *__gcov_indirect_call_topn_callee ATTRIBUTE_HIDDEN;
+
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+gcov_unsigned_t __gcov_indirect_call_sampling_counter ATTRIBUTE_HIDDEN;
+
+#ifdef TARGET_VTABLE_USES_DESCRIPTORS
+#define VTABLE_USES_DESCRIPTORS 1
+#else
+#define VTABLE_USES_DESCRIPTORS 0
+#endif
+void
+__gcov_indirect_call_topn_profiler (void *cur_func,
+ void *cur_module_gcov_info,
+ gcov_unsigned_t cur_func_id)
+{
+ void *callee_func = __gcov_indirect_call_topn_callee;
+ gcov_type *counter = __gcov_indirect_call_topn_counters;
+ /* If the C++ virtual tables contain function descriptors then one
+ function may have multiple descriptors and we need to dereference
+ the descriptors to see if they point to the same function. */
+ if (cur_func == callee_func
+ || (VTABLE_USES_DESCRIPTORS && callee_func
+ && *(void **) cur_func == *(void **) callee_func))
+ {
+ if (++__gcov_indirect_call_sampling_counter >= __gcov_lipo_sampling_period)
+ {
+ __gcov_indirect_call_sampling_counter = 0;
+ gcov_type global_id
+ = ((struct gcov_info *) cur_module_gcov_info)->mod_info->ident;
+ global_id = GEN_FUNC_GLOBAL_ID (global_id, cur_func_id);
+ __gcov_topn_value_profiler_body (counter, global_id, GCOV_ICALL_TOPN_VAL);
+ }
+ __gcov_indirect_call_topn_callee = 0;
+ }
+}
+
+#endif
+
+#ifdef L_gcov_direct_call_profiler
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+gcov_type *__gcov_direct_call_counters ATTRIBUTE_HIDDEN;
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+void *__gcov_direct_call_callee ATTRIBUTE_HIDDEN;
+#if defined(HAVE_CC_TLS) && !defined (USE_EMUTLS)
+__thread
+#endif
+gcov_unsigned_t __gcov_direct_call_sampling_counter ATTRIBUTE_HIDDEN;
+
+/* Direct call profiler. */
+
+void
+__gcov_direct_call_profiler (void *cur_func,
+ void *cur_module_gcov_info,
+ gcov_unsigned_t cur_func_id)
+{
+ if (cur_func == __gcov_direct_call_callee)
+ {
+ if (++__gcov_direct_call_sampling_counter >= __gcov_lipo_sampling_period)
+ {
+ __gcov_direct_call_sampling_counter = 0;
+ gcov_type global_id
+ = ((struct gcov_info *) cur_module_gcov_info)->mod_info->ident;
+ global_id = GEN_FUNC_GLOBAL_ID (global_id, cur_func_id);
+ __gcov_direct_call_counters[0] = global_id;
+ __gcov_direct_call_counters[1]++;
+ }
+ __gcov_direct_call_callee = 0;
+ }
+}
+#endif
+
+
+#ifdef L_gcov_time_profiler
+
+/* Counter for first visit of each function. */
+static gcov_type function_counter;
+
+/* Sets corresponding COUNTERS if there is no value. */
+
+void
+__gcov_time_profiler (gcov_type* counters)
+{
+ if (!counters[0])
+ counters[0] = ++function_counter;
+}
+#endif
+
+#ifdef L_gcov_average_profiler
+/* Increase corresponding COUNTER by VALUE. FIXME: Perhaps we want
+ to saturate up. */
+
+void
+__gcov_average_profiler (gcov_type *counters, gcov_type value)
+{
+ counters[0] += value;
+ counters[1] ++;
+}
+#endif
+
+#ifdef L_gcov_ior_profiler
+/* Bitwise-OR VALUE into COUNTER. */
+
+void
+__gcov_ior_profiler (gcov_type *counters, gcov_type value)
+{
+ *counters |= value;
+}
+#endif
+
+#endif /* inhibit_libc */
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov.h b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov.h
new file mode 100644
index 0000000..c1ebe6e
--- /dev/null
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/gcov-src/libgcov.h
@@ -0,0 +1,421 @@
+/* Header file for libgcov-*.c.
+ Copyright (C) 1996-2014 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_LIBGCOV_H
+#define GCC_LIBGCOV_H
+
+#ifndef __KERNEL__
+/* work around the poisoned malloc/calloc in system.h. */
+#ifndef xmalloc
+#define xmalloc malloc
+#endif
+#ifndef xcalloc
+#define xcalloc calloc
+#endif
+#ifndef xrealloc
+#define xrealloc realloc
+#endif
+#ifndef xfree
+#define xfree free
+#endif
+#else /* __KERNEL__ */
+#include "libgcov-kernel.h"
+#endif /* __KERNEL__ */
+
+#ifndef IN_GCOV_TOOL
+/* About the target. */
+/* This path will be used by libgcov runtime. */
+
+#ifndef __KERNEL__
+#include "tconfig.h"
+#include "tsystem.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "libgcc_tm.h"
+#endif /* __KERNEL__ */
+
+#undef FUNC_ID_WIDTH
+#undef FUNC_ID_MASK
+
+#if BITS_PER_UNIT == 8
+typedef unsigned gcov_unsigned_t __attribute__ ((mode (SI)));
+typedef unsigned gcov_position_t __attribute__ ((mode (SI)));
+#if LONG_LONG_TYPE_SIZE > 32
+typedef signed gcov_type __attribute__ ((mode (DI)));
+typedef unsigned gcov_type_unsigned __attribute__ ((mode (DI)));
+#define FUNC_ID_WIDTH 32
+#define FUNC_ID_MASK ((1ll << FUNC_ID_WIDTH) - 1)
+#else
+typedef signed gcov_type __attribute__ ((mode (SI)));
+typedef unsigned gcov_type_unsigned __attribute__ ((mode (SI)));
+#define FUNC_ID_WIDTH 16
+#define FUNC_ID_MASK ((1 << FUNC_ID_WIDTH) - 1)
+#endif
+#else /* BITS_PER_UNIT != 8 */
+#if BITS_PER_UNIT == 16
+typedef unsigned gcov_unsigned_t __attribute__ ((mode (HI)));
+typedef unsigned gcov_position_t __attribute__ ((mode (HI)));
+#if LONG_LONG_TYPE_SIZE > 32
+typedef signed gcov_type __attribute__ ((mode (SI)));
+typedef unsigned gcov_type_unsigned __attribute__ ((mode (SI)));
+#define FUNC_ID_WIDTH 32
+#define FUNC_ID_MASK ((1ll << FUNC_ID_WIDTH) - 1)
+#else
+typedef signed gcov_type __attribute__ ((mode (HI)));
+typedef unsigned gcov_type_unsigned __attribute__ ((mode (HI)));
+#define FUNC_ID_WIDTH 16
+#define FUNC_ID_MASK ((1 << FUNC_ID_WIDTH) - 1)
+#endif
+#else /* BITS_PER_UNIT != 16 */
+typedef unsigned gcov_unsigned_t __attribute__ ((mode (QI)));
+typedef unsigned gcov_position_t __attribute__ ((mode (QI)));
+#if LONG_LONG_TYPE_SIZE > 32
+typedef signed gcov_type __attribute__ ((mode (HI)));
+typedef unsigned gcov_type_unsigned __attribute__ ((mode (HI)));
+#define FUNC_ID_WIDTH 32
+#define FUNC_ID_MASK ((1ll << FUNC_ID_WIDTH) - 1)
+#else
+typedef signed gcov_type __attribute__ ((mode (QI)));
+typedef unsigned gcov_type_unsigned __attribute__ ((mode (QI)));
+#define FUNC_ID_WIDTH 16
+#define FUNC_ID_MASK ((1 << FUNC_ID_WIDTH) - 1)
+#endif
+#endif /* BITS_PER_UNIT == 16 */
+#endif /* BITS_PER_UNIT == 8 */
+
+#if LONG_LONG_TYPE_SIZE > 32
+#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_8
+#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_8
+#else
+#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_4
+#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_4
+#endif
+
+#if defined (TARGET_POSIX_IO)
+#define GCOV_LOCKED 1
+#else
+#define GCOV_LOCKED 0
+#endif
+
+#else /* IN_GCOV_TOOL */
+/* About the host. */
+/* This path will be compiled for the host and linked into
+ gcov-tool binary. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+
+typedef unsigned gcov_unsigned_t;
+typedef unsigned gcov_position_t;
+/* gcov_type is typedef'd elsewhere for the compiler */
+#if defined (HOST_HAS_F_SETLKW)
+#define GCOV_LOCKED 1
+#else
+#define GCOV_LOCKED 0
+#endif
+
+#define FUNC_ID_WIDTH 32
+#define FUNC_ID_MASK ((1ll << FUNC_ID_WIDTH) - 1)
+
+/* Some Macros specific to gcov-tool. */
+
+#define L_gcov 1
+#define L_gcov_merge_add 1
+#define L_gcov_merge_single 1
+#define L_gcov_merge_delta 1
+#define L_gcov_merge_ior 1
+#define L_gcov_merge_time_profile 1
+#define L_gcov_merge_icall_topn 1
+#define L_gcov_merge_dc 1
+
+/* Make certian internal functions/variables in libgcov available for
+ gcov-tool access. */
+#define GCOV_TOOL_LINKAGE
+
+extern gcov_type gcov_read_counter_mem ();
+extern unsigned gcov_get_merge_weight ();
+
+#endif /* !IN_GCOV_TOOL */
+
+#undef EXTRACT_MODULE_ID_FROM_GLOBAL_ID
+#undef EXTRACT_FUNC_ID_FROM_GLOBAL_ID
+#undef GEN_FUNC_GLOBAL_ID
+#define EXTRACT_MODULE_ID_FROM_GLOBAL_ID(gid) \
+ (gcov_unsigned_t)(((gid) >> FUNC_ID_WIDTH) & FUNC_ID_MASK)
+#define EXTRACT_FUNC_ID_FROM_GLOBAL_ID(gid) \
+ (gcov_unsigned_t)((gid) & FUNC_ID_MASK)
+#define GEN_FUNC_GLOBAL_ID(m,f) ((((gcov_type) (m)) << FUNC_ID_WIDTH) | (f))
+
+#if defined(inhibit_libc)
+#define IN_LIBGCOV (-1)
+#else
+#define IN_LIBGCOV 1
+#if defined(L_gcov)
+#define GCOV_LINKAGE /* nothing */
+#endif
+#endif
+
+/* In libgcov we need these functions to be extern, so prefix them with
+ __gcov. In libgcov they must also be hidden so that the instance in
+ the executable is not also used in a DSO. */
+#define gcov_var __gcov_var
+#define gcov_open __gcov_open
+#define gcov_close __gcov_close
+#define gcov_write_tag_length __gcov_write_tag_length
+#define gcov_position __gcov_position
+#define gcov_seek __gcov_seek
+#define gcov_rewrite __gcov_rewrite
+#define gcov_truncate __gcov_truncate
+#define gcov_is_error __gcov_is_error
+#define gcov_write_unsigned __gcov_write_unsigned
+#define gcov_write_counter __gcov_write_counter
+#define gcov_write_summary __gcov_write_summary
+#define gcov_write_module_info __gcov_write_module_info
+#define gcov_read_unsigned __gcov_read_unsigned
+#define gcov_read_counter __gcov_read_counter
+#define gcov_read_summary __gcov_read_summary
+#define gcov_read_buildinfo __gcov_read_buildinfo
+#define gcov_read_module_info __gcov_read_module_info
+#define gcov_sort_n_vals __gcov_sort_n_vals
+
+/* Poison these, so they don't accidentally slip in. */
+#pragma GCC poison gcov_write_string gcov_write_tag gcov_write_length
+#pragma GCC poison gcov_time gcov_magic
+
+#ifdef HAVE_GAS_HIDDEN
+#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
+#else
+#define ATTRIBUTE_HIDDEN
+#endif
+
+#include "gcov-io.h"
+
+/* Structures embedded in coveraged program. The structures generated
+ by write_profile must match these. */
+/* Information about counters for a single function. */
+struct gcov_ctr_info
+{
+ gcov_unsigned_t num; /* number of counters. */
+ gcov_type *values; /* their values. */
+};
+
+/* Information about a single function. This uses the trailing array
+ idiom. The number of counters is determined from the merge pointer
+ array in gcov_info. The key is used to detect which of a set of
+ comdat functions was selected -- it points to the gcov_info object
+ of the object file containing the selected comdat function. */
+
+struct gcov_fn_info
+{
+ const struct gcov_info *key; /* comdat key */
+ gcov_unsigned_t ident; /* unique ident of function */
+ gcov_unsigned_t lineno_checksum; /* function lineo_checksum */
+ gcov_unsigned_t cfg_checksum; /* function cfg checksum */
+ struct gcov_ctr_info ctrs[1]; /* instrumented counters */
+};
+
+/* Type of function used to merge counters. */
+typedef void (*gcov_merge_fn) (gcov_type *, gcov_unsigned_t);
+
+/* Information about a single object file. */
+struct gcov_info
+{
+ gcov_unsigned_t version; /* expected version number */
+ struct gcov_module_info *mod_info; /* addtional module info. */
+ struct gcov_info *next; /* link to next, used by libgcov */
+
+ gcov_unsigned_t stamp; /* uniquifying time stamp */
+ const char *filename; /* output file name */
+ gcov_unsigned_t eof_pos; /* end position of profile data */
+ gcov_merge_fn merge[GCOV_COUNTERS]; /* merge functions (null for
+ unused) */
+
+ unsigned n_functions; /* number of functions */
+
+#if !defined (IN_GCOV_TOOL) && !defined (__KERNEL__)
+ const struct gcov_fn_info *const *functions; /* pointer to pointers
+ to function information */
+#elif defined (IN_GCOV_TOOL)
+ const struct gcov_fn_info **functions;
+#else
+ struct gcov_fn_info **functions;
+#endif /* !IN_GCOV_TOOL */
+ char **build_info; /* strings to include in BUILD_INFO
+ section of gcda file. */
+};
+
+/* Information about a single imported module. */
+struct dyn_imp_mod
+{
+ const struct gcov_info *imp_mod;
+ double weight;
+};
+
+/* Register a new object file module. */
+extern void __gcov_init (struct gcov_info *) ATTRIBUTE_HIDDEN;
+
+/* Set sampling rate to RATE. */
+extern void __gcov_set_sampling_rate (unsigned int rate);
+
+/* Called before fork, to avoid double counting. */
+extern void __gcov_flush (void) ATTRIBUTE_HIDDEN;
+
+/* Function to reset all counters to 0. */
+extern void __gcov_reset (void);
+/* Function to enable early write of profile information so far.
+ __gcov_dump is also used by __gcov_dump_all. The latter
+ depends on __GCOV_DUMP to have hidden or protected visibility
+ so that each library has its own copy of the registered dumper. */
+extern void __gcov_dump (void) ATTRIBUTE_HIDDEN;
+
+/* Call __gcov_dump registered from each shared library.
+ This function must have default visibility. */
+void __gcov_dump_all (void);
+
+/* The merge function that just sums the counters. */
+extern void __gcov_merge_add (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
+
+/* The merge function to choose the most common value. */
+extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
+
+/* The merge function to choose the most common difference between
+ consecutive values. */
+extern void __gcov_merge_delta (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
+
+/* The merge function that just ors the counters together. */
+extern void __gcov_merge_ior (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
+
+/* The merge function used for direct call counters. */
+extern void __gcov_merge_dc (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
+
+/* The merge function used for indirect call counters. */
+extern void __gcov_merge_icall_topn (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
+
+extern void __gcov_merge_time_profile (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
+
+/* The profiler functions. */
+extern void __gcov_interval_profiler (gcov_type *, gcov_type, int, unsigned);
+extern void __gcov_pow2_profiler (gcov_type *, gcov_type);
+extern void __gcov_one_value_profiler (gcov_type *, gcov_type);
+extern void __gcov_indirect_call_profiler (gcov_type*, gcov_type,
+ void*, void*);
+extern void __gcov_indirect_call_profiler_v2 (gcov_type, void *);
+extern void __gcov_indirect_call_topn_profiler (void *, void *, gcov_unsigned_t) ATTRIBUTE_HIDDEN;
+extern void __gcov_direct_call_profiler (void *, void *, gcov_unsigned_t) ATTRIBUTE_HIDDEN;
+extern void __gcov_average_profiler (gcov_type *, gcov_type);
+extern void __gcov_ior_profiler (gcov_type *, gcov_type);
+extern void __gcov_sort_n_vals (gcov_type *value_array, int n);
+extern void __gcov_time_profiler (gcov_type *);
+
+#ifndef inhibit_libc
+/* The wrappers around some library functions.. */
+extern pid_t __gcov_fork (void) ATTRIBUTE_HIDDEN;
+extern int __gcov_execl (const char *, char *, ...) ATTRIBUTE_HIDDEN;
+extern int __gcov_execlp (const char *, char *, ...) ATTRIBUTE_HIDDEN;
+extern int __gcov_execle (const char *, char *, ...) ATTRIBUTE_HIDDEN;
+extern int __gcov_execv (const char *, char *const []) ATTRIBUTE_HIDDEN;
+extern int __gcov_execvp (const char *, char *const []) ATTRIBUTE_HIDDEN;
+extern int __gcov_execve (const char *, char *const [], char *const [])
+ ATTRIBUTE_HIDDEN;
+
+
+/* Functions that only available in libgcov. */
+GCOV_LINKAGE int gcov_open (const char */*name*/) ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE void gcov_write_counter (gcov_type) ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE void gcov_write_tag_length (gcov_unsigned_t, gcov_unsigned_t)
+ ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE void gcov_write_summary (gcov_unsigned_t /*tag*/,
+ const struct gcov_summary *)
+ ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/) ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE void gcov_truncate (void) ATTRIBUTE_HIDDEN;
+void gcov_write_module_info (const struct gcov_info *, unsigned)
+ ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE void gcov_write_module_infos (struct gcov_info *mod_info)
+ ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE const struct dyn_imp_mod **
+gcov_get_sorted_import_module_array (struct gcov_info *mod_info, unsigned *len)
+ ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE inline void gcov_rewrite (void);
+
+extern void set_gcov_fn_fixed_up (int fixed_up);
+extern int get_gcov_fn_fixed_up (void);
+
+/* "Counts" stored in gcda files can be a real counter value, or
+ an target address. When differentiate these two types because
+ when manipulating counts, we should only change real counter values,
+ rather target addresses. */
+
+static inline gcov_type
+gcov_get_counter (void)
+{
+#ifndef IN_GCOV_TOOL
+ /* This version is for reading count values in libgcov runtime:
+ we read from gcda files. */
+
+ if (get_gcov_fn_fixed_up ())
+ {
+ gcov_read_counter ();
+ return 0;
+ }
+ else
+ return gcov_read_counter ();
+#else
+ /* This version is for gcov-tool. We read the value from memory and
+ multiply it by the merge weight. */
+
+ return gcov_read_counter_mem () * gcov_get_merge_weight ();
+#endif
+}
+
+/* Similar function as gcov_get_counter(), but handles target address
+ counters. */
+
+static inline gcov_type
+gcov_get_counter_target (void)
+{
+#ifndef IN_GCOV_TOOL
+ /* This version is for reading count target values in libgcov runtime:
+ we read from gcda files. */
+
+ if (get_gcov_fn_fixed_up ())
+ {
+ gcov_read_counter ();
+ return 0;
+ }
+ else
+ return gcov_read_counter ();
+#else
+ /* This version is for gcov-tool. We read the value from memory and we do NOT
+ multiply it by the merge weight. */
+
+ return gcov_read_counter_mem ();
+#endif
+}
+
+#endif /* !inhibit_libc */
+
+#endif /* GCC_LIBGCOV_H */
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/include-fixed/linux/a.out.h b/lib/gcc/arm-linux-androideabi/4.9.x-google/include-fixed/linux/a.out.h
index 0c0972b..9e0a019 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/include-fixed/linux/a.out.h
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/include-fixed/linux/a.out.h
@@ -2,7 +2,7 @@
It has been auto-edited by fixincludes from:
- "/tmp/ndk-xur/build/toolchain/prefix/sysroot/usr/include/linux/a.out.h"
+ "/tmp/ndk-yiran-arm/prefix/sysroot/usr/include/linux/a.out.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcc.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcc.a
index 57959eb..764bbd8 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcc.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcc.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcov.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcov.a
index 84bd94e..ae60e24 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcov.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/libgcov.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbegin.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbegin.o
index b68a52a..65080e5 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbegin.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbegin.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginS.o
index a5f85eb..3acb9c5 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginT.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginT.o
index b68a52a..65080e5 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginT.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtbeginT.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtend.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtend.o
index 8b37c67..2918561 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtend.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtend.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtendS.o b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtendS.o
index 8b37c67..2918561 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtendS.o
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/crtendS.o
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcc.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcc.a
index d00422c..1109861 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcc.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcc.a
Binary files differ
diff --git a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcov.a b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcov.a
index 1273bc8..144b3f6 100644
--- a/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcov.a
+++ b/lib/gcc/arm-linux-androideabi/4.9.x-google/thumb/libgcov.a
Binary files differ
diff --git a/lib/libarm-linux-android-sim.a b/lib/libarm-linux-android-sim.a
index cfb4d30..d6970a5 100644
--- a/lib/libarm-linux-android-sim.a
+++ b/lib/libarm-linux-android-sim.a
Binary files differ