DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into stage-aosp-master

Bug: 124234733
Change-Id: I390b8d0f71cea3b74ff9e6e6cb7b9156f6072b0b
diff --git a/apps/BluetoothDebug/AndroidManifest.xml b/apps/BluetoothDebug/AndroidManifest.xml
index 14a2b46..07833f4 100644
--- a/apps/BluetoothDebug/AndroidManifest.xml
+++ b/apps/BluetoothDebug/AndroidManifest.xml
@@ -13,7 +13,6 @@
                 <action android:name="android.bluetooth.adapter.action.LOCAL_NAME_CHANGED" />
 
                 <action android:name="android.bluetooth.device.action.FOUND" />
-                <action android:name="android.bluetooth.device.action.DISAPPEARED" />
                 <action android:name="android.bluetooth.device.action.CLASS_CHANGED" />
                 <action android:name="android.bluetooth.device.action.ACL_CONNECTED" />
                 <action android:name="android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED" />
diff --git a/apps/Development/src/com/android/development/Connectivity.java b/apps/Development/src/com/android/development/Connectivity.java
index e0b763e..2b62acb 100644
--- a/apps/Development/src/com/android/development/Connectivity.java
+++ b/apps/Development/src/com/android/development/Connectivity.java
@@ -85,6 +85,8 @@
 import java.util.List;
 import java.util.Random;
 
+import static android.net.ConnectivityManager.CONNECTIVITY_ACTION;
+import static android.net.ConnectivityManager.INET_CONDITION_ACTION;
 import static android.net.NetworkCapabilities.*;
 
 public class Connectivity extends Activity {
@@ -153,8 +155,23 @@
     private static final String TEST_ALARM_CYCLE_EXTRA = "CONNECTIVITY_TEST_CYCLE_EXTRA";
     private static final String SCREEN_ON = "SCREEN_ON";
     private static final String SCREEN_OFF = "SCREEN_OFF";
+
+    private static final String NETWORK_CONDITIONS_MEASURED =
+            "android.net.conn.NETWORK_CONDITIONS_MEASURED";
+
+    private void logBroadcast(Intent intent) {
+        StringBuilder sb = new StringBuilder();
+        Bundle b = intent.getExtras();
+        for (String key : b.keySet()) {
+            sb.append(String.format(" %s=%s", key, b.get(key)));
+        }
+        Log.d(TAG, "Got broadcast " + intent.getAction() + " extras:" + sb.toString());
+    }
+
     public BroadcastReceiver mReceiver = new BroadcastReceiver() {
         public void onReceive(Context context, Intent intent) {
+            logBroadcast(intent);
+
             if (intent.getAction().equals(CONNECTIVITY_TEST_ALARM)) {
                 String extra = (String)intent.getExtra(TEST_ALARM_EXTRA);
                 PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
@@ -465,7 +482,13 @@
         }
         onHttpRequestResults(null);
 
-        registerReceiver(mReceiver, new IntentFilter(CONNECTIVITY_TEST_ALARM));
+        IntentFilter broadcastFilter = new IntentFilter();
+        broadcastFilter.addAction(CONNECTIVITY_ACTION);
+        broadcastFilter.addAction(CONNECTIVITY_TEST_ALARM);
+        broadcastFilter.addAction(INET_CONDITION_ACTION);
+        broadcastFilter.addAction(NETWORK_CONDITIONS_MEASURED);
+
+        registerReceiver(mReceiver, broadcastFilter);
 
         mLinkStatsResults = (TextView)findViewById(R.id.stats);
         mLinkStatsResults.setVisibility(View.VISIBLE);
diff --git a/apps/Development/src/com/android/development/OWNERS b/apps/Development/src/com/android/development/OWNERS
new file mode 100644
index 0000000..171a26e
--- /dev/null
+++ b/apps/Development/src/com/android/development/OWNERS
@@ -0,0 +1 @@
+per-file Connectivity.java = codewiz@google.com, jchalard@google.com, lorenzo@google.com, reminv@google.com, satk@google.com
diff --git a/apps/Fallback/res/values-or/strings.xml b/apps/Fallback/res/values-or/strings.xml
deleted file mode 100644
index d528ac4..0000000
--- a/apps/Fallback/res/values-or/strings.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--  Copyright (C) 2007 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-  
-          http://www.apache.org/licenses/LICENSE-2.0
-  
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"ଫଲବ୍ୟାକ୍‌"</string>
-    <string name="title" msgid="8156274565006125136">"ସପୋର୍ଟ ହେଉ ନଥିବା କାର୍ଯ୍ୟ"</string>
-    <string name="error" msgid="6539615832923362301">"ବର୍ତ୍ତମାନରେ ଏହି କାର୍ଯ୍ୟଟି କରିହେବ ନାହିଁ।"</string>
-</resources>
diff --git a/apps/launchperf/Android.mk b/apps/launchperf/Android.mk
index ba0d24d..60530ca 100644
--- a/apps/launchperf/Android.mk
+++ b/apps/launchperf/Android.mk
@@ -6,7 +6,7 @@
 LOCAL_JAVA_LIBRARIES := android.test.runner
 
 LOCAL_PACKAGE_NAME := launchperf
-LOCAL_SDK_VERSION := current
+LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_MODULE_TAGS := tests
 
diff --git a/build/Android.bp b/build/Android.bp
new file mode 100644
index 0000000..8f80280
--- /dev/null
+++ b/build/Android.bp
@@ -0,0 +1,86 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+java_defaults {
+    name: "framework-stubs-default",
+    errorprone: {
+        javacflags: [
+            "-XepDisableAllChecks",
+        ],
+    },
+    java_resources: [
+        ":notices-for-framework-stubs",
+    ],
+    no_standard_libs: true,
+    system_modules: "none",
+    java_version: "1.8",
+    compile_dex: true,
+}
+
+java_library_static {
+    name: "android_stubs_current",
+    srcs: [
+        ":api-stubs-docs",
+    ],
+    libs: [
+        "stub-annotations",
+    ],
+    static_libs: [
+        "private-stub-annotations-jar",
+    ],
+    defaults: ["framework-stubs-default"],
+}
+
+java_system_modules {
+    name: "android_stubs_current_system_modules",
+    libs: ["android_stubs_current"],
+}
+
+java_library_static {
+    name: "android_system_stubs_current",
+    srcs: [
+        ":system-api-stubs-docs",
+    ],
+    libs: [
+        "stub-annotations",
+    ],
+    static_libs: [
+        "private-stub-annotations-jar",
+    ],
+    defaults: ["framework-stubs-default"],
+}
+
+java_system_modules {
+    name: "android_system_stubs_current_system_modules",
+    libs: ["android_system_stubs_current"],
+}
+
+java_library_static {
+    name: "android_test_stubs_current",
+    srcs: [
+        ":test-api-stubs-docs",
+    ],
+    libs: [
+        "stub-annotations",
+    ],
+    static_libs: [
+        "private-stub-annotations-jar",
+    ],
+    defaults: ["framework-stubs-default"],
+}
+
+java_system_modules {
+    name: "android_test_stubs_current_system_modules",
+    libs: ["android_test_stubs_current"],
+}
diff --git a/build/Android.mk b/build/Android.mk
index 4fa56f9..a86e2b6 100644
--- a/build/Android.mk
+++ b/build/Android.mk
@@ -3,18 +3,19 @@
 # ===== SDK source.property files =====
 
 # Add all files to be generated from the source.prop templates to the SDK pre-requisites
-ALL_SDK_FILES += $(patsubst \
-                   $(TOPDIR)development/sdk/%_source.prop_template, \
-                   $(HOST_OUT)/development/sdk/%_source.properties, \
-                   $(wildcard $(TOPDIR)development/sdk/*_source.prop_template)) \
-                 $(patsubst \
-                   $(TOPDIR)development/samples/%_source.prop_template, \
-                   $(HOST_OUT)/development/samples/%_source.properties, \
-                   $(wildcard $(TOPDIR)development/samples/*_source.prop_template)) \
-                 $(patsubst \
+sdk_props := $(patsubst \
+               $(TOPDIR)development/sdk/%_source.prop_template, \
+               $(HOST_OUT)/development/sdk/%_source.properties, \
+               $(wildcard $(TOPDIR)development/sdk/*_source.prop_template))
+sample_props := $(patsubst \
+                  $(TOPDIR)development/samples/%_source.prop_template, \
+                  $(HOST_OUT)/development/samples/%_source.properties, \
+                  $(wildcard $(TOPDIR)development/samples/*_source.prop_template))
+sys_img_props := $(patsubst \
                    $(TOPDIR)development/sys-img/%_source.prop_template, \
                    $(HOST_OUT)/development/sys-img-$(TARGET_CPU_ABI)/%_source.properties, \
                    $(wildcard $(TOPDIR)development/sys-img/*_source.prop_template))
+ALL_SDK_FILES += $(sdk_props) $(sample_props) $(sys_img_props)
 
 # Rule to convert a source.prop template into the desired source.property
 # This needs to vary based on the CPU ABI for the system-image files.
@@ -24,7 +25,7 @@
 # - ${PLATFORM_VERSION_CODENAME} e.g. "REL" (transformed into "") or "Cupcake"
 # - ${TARGET_ARCH}               e.g. "arm", "x86", "mips" and their 64-bit variants.
 # - ${TARGET_CPU_ABI}            e.g. "armeabi", "x86", "mips" and their 64-bit variants.
-$(HOST_OUT)/development/sys-img-$(TARGET_CPU_ABI)/%_source.properties : $(TOPDIR)development/sys-img/%_source.prop_template
+$(sys_img_props) : $(HOST_OUT)/development/sys-img-$(TARGET_CPU_ABI)/%_source.properties : $(TOPDIR)development/sys-img/%_source.prop_template
 	@echo Generate $@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) sed \
@@ -35,7 +36,7 @@
 		-e 's/$${TARGET_CPU_ABI}/$(TARGET_CPU_ABI)/' \
 		$< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@
 
-$(HOST_OUT)/development/sdk/%_source.properties : $(TOPDIR)development/sdk/%_source.prop_template
+$(sdk_props) : $(HOST_OUT)/development/sdk/%_source.properties : $(TOPDIR)development/sdk/%_source.prop_template
 	@echo Generate $@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) sed \
@@ -44,7 +45,7 @@
 		-e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \
 		$< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@
 
-$(HOST_OUT)/development/samples/%_source.properties : $(TOPDIR)development/samples/%_source.prop_template
+$(sample_props) : $(HOST_OUT)/development/samples/%_source.properties : $(TOPDIR)development/samples/%_source.prop_template
 	@echo Generate $@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) sed\
@@ -56,20 +57,12 @@
 
 # ===== SDK jar file of stubs =====
 # A.k.a the "current" version of the public SDK (android.jar inside the SDK package).
-sdk_stub_name := android_stubs_current
-stub_timestamp := $(OUT_DOCS)/api-stubs-timestamp
-include $(LOCAL_PATH)/build_android_stubs.mk
+full_target := $(call intermediates-dir-for,JAVA_LIBRARIES,android_stubs_current,,COMMON)/classes.jar
+full_src_target := $(OUT_DOCS)/api-stubs-docs-stubs.srcjar
 
 .PHONY: android_stubs
 android_stubs: $(full_target) $(full_src_target)
 
-# The real rules create a javalib.jar that contains a classes.dex file.  This
-# code is never going to be run anywhere, so just make a copy of the file.
-# The package installation stuff doesn't know about this file, so nobody will
-# ever be able to write a rule that installs it to a device.
-$(dir $(full_target))javalib.jar: $(full_target)
-	$(copy-file-to-target)
-
 # android.jar is what we put in the SDK package.
 android_jar_intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android_jar_intermediates
 android_jar_full_target := $(android_jar_intermediates)/android.jar
@@ -87,43 +80,18 @@
 ALL_SDK_FILES += $(android_jar_full_target)
 ALL_SDK_FILES += $(android_jar_src_target)
 
-# ============ Metalava SDK jar file of stubs ============
-sdk_stub_name := metalava_android_stubs_current
-stub_timestamp := $(OUT_DOCS)/metalava-api-stubs-timestamp
-include $(LOCAL_PATH)/build_android_stubs.mk
-
-.PHONY: metalava_android_stubs
-metalava_android_stubs: $(full_target) $(full_src_target)
-
-# android.jar is what we put in the SDK package.
-android_jar_intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/metalava_android_jar_intermediates
-android_jar_full_target := $(android_jar_intermediates)/metalava-android.jar
-android_jar_src_target := $(android_jar_intermediates)/metalava-android-stubs-src.jar
-
-$(android_jar_full_target): $(full_target)
-	@echo Package SDK Stubs: $@
-	$(copy-file-to-target)
-
-$(android_jar_src_target): $(full_src_target)
-	@echo Package SDK Stubs Source: $@
-	$(hide)mkdir -p $(dir $@)
-	$(hide)$(ACP) $< $@
-
-ALL_SDK_FILES += $(android_jar_full_target)
-ALL_SDK_FILES += $(android_jar_src_target)
-
 # ====================================================
 
 # The uiautomator stubs
-ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_uiautomator_intermediates/javalib.jar
+ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_uiautomator_intermediates/classes.jar
 
 # org.apache.http.legacy.jar stubs
-ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/javalib.jar
+ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/org.apache.http.legacy.stubs_intermediates/classes.jar
 
 # test stubs
-ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/javalib.jar
-ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/javalib.jar
-ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/javalib.jar
+ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/classes.jar
+ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.base.stubs_intermediates/classes.jar
+ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/classes.jar
 
 # core-lambda-stubs
 ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/core-lambda-stubs_intermediates/classes.jar
@@ -131,86 +99,25 @@
 # shrinkedAndroid.jar for multidex support
 ALL_SDK_FILES += $(HOST_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/shrinkedAndroid_intermediates/shrinkedAndroid.jar
 
-# $(1): the Java library name
-define _package_sdk_library
-$(eval _psm_build_module := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/$(1)_intermediates/javalib.jar)
-$(eval _psm_packaging_target := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(1)_intermediates/$(1).jar)
-$(_psm_packaging_target) : $(_psm_build_module)
-	@echo "Package $(1).jar: $$@"
-	$$(copy-file-to-target)
-	@# Delete resource generated classes from the jar files.
-	$(hide) zip -d $$@ "*/R.class" "*/R\$$$$*.class" "*/Manifest.class" "*/Manifest\$$$$*.class" >/dev/null 2>&1 || true
-
-ALL_SDK_FILES += $(_psm_packaging_target)
-$(eval _psm_build_module :=)
-$(eval _psm_packaging_target :=)
-endef
-
 # ======= Lint API XML ===========
-
-ALL_SDK_FILES += $(HOST_OUT)/development/sdk/generated-api-versions.xml
-
-api_gen_jar := $(TOPDIR)prebuilts/tools/common/api-generator/api-generator-26.3.0.jar
-api_gen_deps := \
-  $(TOPDIR)prebuilts/tools/common/m2/repository/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar \
-  $(TOPDIR)prebuilts/tools/common/m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar \
-  $(TOPDIR)prebuilts/tools/common/m2/repository/org/ow2/asm/asm-tree/5.0.4/asm-tree-5.0.4.jar \
-  $(TOPDIR)prebuilts/tools/common/m2/repository/com/google/guava/guava/17.0/guava-17.0.jar
-api_gen_classpath := $(subst $(space),:,$(api_gen_jar) $(api_gen_deps))
-
-
-$(HOST_OUT)/development/sdk/generated-api-versions.xml: $(android_jar_full_target)
-	$(JAVA) -cp $(api_gen_classpath) \
-	  com.android.apigenerator.Main \
-	  --pattern $(TOPDIR)prebuilts/tools/common/api-versions/android-%/android.jar \
-	  --pattern $(TOPDIR)prebuilts/sdk/%/android.jar \
-	  --current-version $(PLATFORM_SDK_VERSION) \
-	  --current-codename $(PLATFORM_VERSION_CODENAME) \
-	  --current-jar $(android_jar_full_target) \
-	  $@
-
+ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/api-stubs-docs_generated-api-versions.xml
 
 # ============ System SDK ============
-sdk_stub_name := android_system_stubs_current
-stub_timestamp := $(OUT_DOCS)/system-api-stubs-timestamp
-include $(LOCAL_PATH)/build_android_stubs.mk
+full_target := $(call intermediates-dir-for,JAVA_LIBRARIES,android_system_stubs_current,,COMMON)/classes.jar
 
 .PHONY: android_system_stubs
 android_system_stubs: $(full_target)
 
 # Build and store the android_system.jar.
 $(call dist-for-goals,sdk win_sdk,$(full_target):android_system.jar)
+$(call dist-for-goals,sdk win_sdk,$(full_target):apistubs/android/system/android.jar)
 
 # ============ Test SDK ============
-sdk_stub_name := android_test_stubs_current
-stub_timestamp := $(OUT_DOCS)/test-api-stubs-timestamp
-include $(LOCAL_PATH)/build_android_stubs.mk
+full_target := $(call intermediates-dir-for,JAVA_LIBRARIES,android_test_stubs_current,,COMMON)/classes.jar
 
 .PHONY: android_test_stubs
 android_test_stubs: $(full_target)
 
 # Build and store the android_test.jar.
 $(call dist-for-goals,sdk win_sdk,$(full_target):android_test.jar)
-
-# ============ Metalava System SDK ============
-sdk_stub_name := metalava_android_system_stubs_current
-stub_timestamp := $(OUT_DOCS)/metalava-system-api-stubs-timestamp
-include $(LOCAL_PATH)/build_android_stubs.mk
-
-.PHONY: metalava_android_system_stubs
-metalava_android_system_stubs: $(full_target)
-
-# Build and store the android_system.jar.
-$(call dist-for-goals,sdk win_sdk,$(full_target):metalava_android_system.jar)
-
-# ============ Metalava Test SDK ============
-sdk_stub_name := metalava_android_test_stubs_current
-stub_timestamp := $(OUT_DOCS)/metalava-test-api-stubs-timestamp
-include $(LOCAL_PATH)/build_android_stubs.mk
-
-.PHONY: metalava_android_test_stubs
-metalava_android_test_stubs: $(full_target)
-
-# Build and store the android_test.jar.
-$(call dist-for-goals,sdk win_sdk,$(full_target):metalava_android_test.jar)
-
+$(call dist-for-goals,sdk win_sdk,$(full_target):apistubs/android/test/android.jar)
diff --git a/build/build_android_stubs.mk b/build/build_android_stubs.mk
deleted file mode 100644
index 393b213..0000000
--- a/build/build_android_stubs.mk
+++ /dev/null
@@ -1,100 +0,0 @@
-# Build an SDK jar file out of the generated stubs
-# Input variable:
-#   sdk_stub_name: the name of the SDK stubs; the stub source code should have been generated to
-#                  $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/$(sdk_stub_name)_intermediates.
-#   stub_timestamp: the timestamp file we use as dependency of the generated source.
-# Output variable:
-#   full_target: the built classes.jar
-
-# The source files for this library are _all_ generated, something we don't do
-# anywhere else, and the rules don't support.  Aditionally, the depenencies on
-# these files don't really matter, because they are all generated as part of
-# building the docs.  So for the dependency, we just use the
-# api-stubs-timestamp file, which is the $@ of the droiddoc rule.
-# We also need to depend on framework-res.apk, in order to pull the
-# resource files out of there for aapt.
-#
-# Normally the package rule runs aapt, which includes the resource,
-# but we're not running that in our package rule so just copy in the
-# resource files here.
-intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/$(sdk_stub_name)_intermediates
-full_target := $(intermediates)/classes.jar
-header_target := $(intermediates)/classes-header.jar
-full_src_target = $(intermediates)/android-stubs-src.jar
-src_dir := $(intermediates)/src
-classes_dir := $(intermediates)/classes
-framework_res_package := $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk
-
-$(full_target) $(full_src_target): PRIVATE_SRC_DIR := $(src_dir)
-$(full_target) $(full_src_target): PRIVATE_INTERMEDIATES_DIR := $(intermediates)
-$(full_target): PRIVATE_FRAMEWORK_RES_PACKAGE := $(framework_res_package)
-
-$(full_target): PRIVATE_CLASS_INTERMEDIATES_DIR := $(classes_dir)
-
-# Disable all warnings. For one, stubs are auto-generated and lack annotations currently. Second,
-# any warnings should have been emitted for the stub sources.
-ifeq (true,$(RUN_ERROR_PRONE))
-$(full_target): PRIVATE_ERRORPRONE_FLAGS := -XepDisableAllChecks
-else
-$(full_target): PRIVATE_ERRORPRONE_FLAGS :=
-endif
-
-my_use_metalava := $(filter metalava%,$(sdk_stub_name))
-$(warning $(sdk_stub_name) $(my_use_metalava))
-
-ifdef my_use_metalava
-$(full_target): $(HOST_OUT_JAVA_LIBRARIES)/stub-annotations$(COMMON_JAVA_PACKAGE_SUFFIX)
-$(full_target): PRIVATE_METALAVA_CLASSPATH := -classpath $(HOST_OUT_JAVA_LIBRARIES)/stub-annotations$(COMMON_JAVA_PACKAGE_SUFFIX)
-$(full_target): $(HOST_OUT_JAVA_LIBRARIES)/metalava.jar
-else
-$(full_target): PRIVATE_METALAVA_CLASSPATH :=
-endif
-
-$(full_src_target): $(stub_timestamp)
-	@echo Packaging SDK Stub sources: $@
-	$(hide) cd $(PRIVATE_INTERMEDIATES_DIR) && zip -rq $(notdir $@) $(notdir $(PRIVATE_SRC_DIR))
-
-$(full_target): $(stub_timestamp) $(framework_res_package) $(ZIPTIME)
-	@echo Compiling SDK Stubs: $@
-	$(hide) rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR)
-	$(hide) mkdir -p $(PRIVATE_CLASS_INTERMEDIATES_DIR)
-	$(hide) mkdir -p $(PRIVATE_CLASS_INTERMEDIATES_DIR)/NOTICES
-	$(hide) if [ ! -f libcore/NOTICE ]; then \
-	echo "Missing notice file : libcore/NOTICE"; \
-	rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR); \
-	exit 1; \
-	fi;
-	$(hide) if [ ! -f libcore/ojluni/NOTICE ]; then \
-	echo "Missing notice file : libcore/ojluni/NOTICE"; \
-	rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR); \
-	exit 1; \
-	fi;
-	$(hide) $(ACP) libcore/NOTICE $(PRIVATE_CLASS_INTERMEDIATES_DIR)/NOTICES/libcore-NOTICE
-	$(hide) $(ACP) libcore/ojluni/NOTICE $(PRIVATE_CLASS_INTERMEDIATES_DIR)/NOTICES/ojluni-NOTICE
-	$(hide) find $(PRIVATE_SRC_DIR) -name "*.java" > \
-	$(PRIVATE_INTERMEDIATES_DIR)/java-source-list
-	$(hide) $(TARGET_JAVAC) $(PRIVATE_ERRORPRONE_FLAGS) \
-			-source 1.8 -target 1.8 -encoding UTF-8 -bootclasspath "" $(PRIVATE_METALAVA_CLASSPATH) \
-			-g -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) \
-			\@$(PRIVATE_INTERMEDIATES_DIR)/java-source-list \
-		|| ( rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR) ; exit 41 )
-ifdef my_use_metalava
-	$(hide) $(JAVA) -jar $(HOST_OUT_JAVA_LIBRARIES)/metalava.jar \
-	    --no-banner --rewrite-annotations $(PRIVATE_CLASS_INTERMEDIATES_DIR)
-endif
-	$(hide) if [ ! -f $(PRIVATE_FRAMEWORK_RES_PACKAGE) ]; then \
-		echo Missing file $(PRIVATE_FRAMEWORK_RES_PACKAGE); \
-		rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR); \
-		exit 1; \
-	fi;
-	$(hide) unzip -qo $(PRIVATE_FRAMEWORK_RES_PACKAGE) -d $(PRIVATE_CLASS_INTERMEDIATES_DIR)
-	$(hide) (cd $(PRIVATE_CLASS_INTERMEDIATES_DIR) && rm -rf classes.dex META-INF)
-	$(hide) mkdir -p $(dir $@)
-	$(hide) jar -cf $@.tmp -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) .
-	$(hide) jar -u0f $@.tmp -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) resources.arsc
-	$(hide) $(ZIPTIME) $@.tmp
-	$(hide) $(call commit-change-for-toc,$@)
-
-.KATI_RESTAT: $(full_target)
-
-$(eval $(call copy-one-file,$(full_target),$(header_target)))
diff --git a/build/product_sdk.mk b/build/product_sdk.mk
index 33929a4..e8a89ca 100644
--- a/build/product_sdk.mk
+++ b/build/product_sdk.mk
@@ -32,10 +32,9 @@
 	adb \
 	aidl \
 	apksigner \
-	zipalign \
 	bcc_compat \
 	bios.bin \
-	commons-compress-1.0 \
+	deployagent \
 	dexdump \
 	dmtracedump \
 	dx \
@@ -48,4 +47,5 @@
 	llvm-rs-cc \
 	sqlite3 \
 	vgabios-cirrus.bin \
-	split-select
+	split-select \
+	zipalign
diff --git a/build/sdk-darwin-x86.atree b/build/sdk-darwin-x86.atree
index ad58fc5..b7ab759 100644
--- a/build/sdk-darwin-x86.atree
+++ b/build/sdk-darwin-x86.atree
@@ -18,7 +18,7 @@
 # Platform Tools Component
 ##############################################################################
 
-lib/libc++.dylib                                      strip platform-tools/lib/libc++.dylib
+lib64/libc++.dylib                                      strip platform-tools/lib64/libc++.dylib
 
 ##############################################################################
 # Build Tools Component
diff --git a/build/sdk.atree b/build/sdk.atree
index 382e462..974f39b 100644
--- a/build/sdk.atree
+++ b/build/sdk.atree
@@ -54,6 +54,10 @@
 bin/etc1tool                            strip platform-tools/etc1tool
 bin/hprof-conv                          strip platform-tools/hprof-conv
 
+# fastdeploy
+system/framework/deployagent.jar        platform-tools/deployagent.jar
+system/bin/deployagent                  platform-tools/deployagent
+framework/deploypatchgenerator.jar      platform-tools/deploypatchgenerator.jar
 
 # systrace
 external/chromium-trace/catapult/                                         platform-tools/systrace/catapult/
@@ -63,8 +67,8 @@
 
 # Compatibility: moved to platform but also leave them in platform-tools for a little
 # longer until all active Gradle plugins have support for looking in both places
-development/sdk/generated-api-versions.xml    platform-tools/api/api-versions.xml
-${OUT_DIR}/target/common/obj/PACKAGING/metalava-api-stubs_annotations.zip   platform-tools/api/annotations.zip
+${OUT_DIR}/target/common/obj/PACKAGING/api-stubs-docs_generated-api-versions.xml    platform-tools/api/api-versions.xml
+${OUT_DIR}/target/common/obj/PACKAGING/api-stubs-docs_annotations.zip   platform-tools/api/annotations.zip
 
 ##############################################################################
 # Build Tools Component
@@ -162,18 +166,18 @@
 sdk/sdk-build.prop                                                                            platforms/${PLATFORM_NAME}/build.prop
 
 # Main Public API jar
-${OUT_DIR}/target/common/obj/PACKAGING/metalava_android_jar_intermediates/metalava-android.jar            platforms/${PLATFORM_NAME}/android.jar
-${OUT_DIR}/target/common/obj/PACKAGING/metalava_android_jar_intermediates/metalava-android-stubs-src.jar  platforms/${PLATFORM_NAME}/android-stubs-src.jar
+${OUT_DIR}/target/common/obj/PACKAGING/android_jar_intermediates/android.jar            platforms/${PLATFORM_NAME}/android.jar
+${OUT_DIR}/target/common/obj/PACKAGING/android_jar_intermediates/android-stubs-src.jar  platforms/${PLATFORM_NAME}/android-stubs-src.jar
 
 # optional API files.
 development/build/optional.json                                                               platforms/${PLATFORM_NAME}/optional/optional.json
-${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/javalib.jar  platforms/${PLATFORM_NAME}/optional/org.apache.http.legacy.jar
+${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy.stubs_intermediates/classes.jar  platforms/${PLATFORM_NAME}/optional/org.apache.http.legacy.jar
 # deprecated APIs
-${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android_uiautomator_intermediates/javalib.jar     platforms/${PLATFORM_NAME}/uiautomator.jar
+${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android_uiautomator_intermediates/classes.jar     platforms/${PLATFORM_NAME}/uiautomator.jar
 # Test APIs
-${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/javalib.jar   platforms/${PLATFORM_NAME}/optional/android.test.mock.jar
-${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android.test.base.stubs_intermediates/javalib.jar   platforms/${PLATFORM_NAME}/optional/android.test.base.jar
-${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/javalib.jar platforms/${PLATFORM_NAME}/optional/android.test.runner.jar
+${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android.test.mock.stubs_intermediates/classes.jar   platforms/${PLATFORM_NAME}/optional/android.test.mock.jar
+${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android.test.base.stubs_intermediates/classes.jar   platforms/${PLATFORM_NAME}/optional/android.test.base.jar
+${OUT_DIR}/target/common/obj/JAVA_LIBRARIES/android.test.runner.stubs_intermediates/classes.jar platforms/${PLATFORM_NAME}/optional/android.test.runner.jar
 
 # the aidl precompiled include
 obj/framework.aidl                                                                            platforms/${PLATFORM_NAME}/framework.aidl
@@ -206,21 +210,21 @@
 development/tools/templates/ic_launcher_xhdpi.png           platforms/${PLATFORM_NAME}/templates/ic_launcher_xhdpi.png
 
 # API database for tools such as lint
-development/sdk/generated-api-versions.xml  platforms/${PLATFORM_NAME}/data/api-versions.xml
+${OUT_DIR}/target/common/obj/PACKAGING/api-stubs-docs_generated-api-versions.xml  platforms/${PLATFORM_NAME}/data/api-versions.xml
 
 # API annotations database for lint
 prebuilts/sdk/sdk-annotations/annotations.zip platforms/${PLATFORM_NAME}/data/annotations.zip
-${OUT_DIR}/target/common/obj/PACKAGING/metalava-api-stubs_annotations.zip platforms/${PLATFORM_NAME}/data/annotations.zip
+${OUT_DIR}/target/common/obj/PACKAGING/api-stubs-docs_annotations.zip platforms/${PLATFORM_NAME}/data/annotations.zip
 
 # Eclipse Editors support
 framework/layoutlib-legacy.jar            platforms/${PLATFORM_NAME}/data/layoutlib.jar
 frameworks/base/core/res/res              platforms/${PLATFORM_NAME}/data/res
-docs/activity_actions.txt                 platforms/${PLATFORM_NAME}/data/activity_actions.txt
-docs/broadcast_actions.txt                platforms/${PLATFORM_NAME}/data/broadcast_actions.txt
-docs/service_actions.txt                  platforms/${PLATFORM_NAME}/data/service_actions.txt
-docs/categories.txt                       platforms/${PLATFORM_NAME}/data/categories.txt
-docs/widgets.txt                          platforms/${PLATFORM_NAME}/data/widgets.txt
-docs/features.txt                         platforms/${PLATFORM_NAME}/data/features.txt
+docs/offline-sdk/activity_actions.txt                 platforms/${PLATFORM_NAME}/data/activity_actions.txt
+docs/offline-sdk/broadcast_actions.txt                platforms/${PLATFORM_NAME}/data/broadcast_actions.txt
+docs/offline-sdk/service_actions.txt                  platforms/${PLATFORM_NAME}/data/service_actions.txt
+docs/offline-sdk/categories.txt                       platforms/${PLATFORM_NAME}/data/categories.txt
+docs/offline-sdk/widgets.txt                          platforms/${PLATFORM_NAME}/data/widgets.txt
+docs/offline-sdk/features.txt                         platforms/${PLATFORM_NAME}/data/features.txt
 
 # fonts for layoutlib.
 ${FONT_OUT}                       platforms/${PLATFORM_NAME}/data/fonts
@@ -403,7 +407,6 @@
 development/samples/AppNavigation              samples/${PLATFORM_NAME}/legacy/AppNavigation
 development/samples/BackupRestore              samples/${PLATFORM_NAME}/legacy/BackupRestore
 development/samples/BasicGLSurfaceView         samples/${PLATFORM_NAME}/legacy/BasicGLSurfaceView
-development/samples/BluetoothHDP               samples/${PLATFORM_NAME}/legacy/BluetoothHDP
 development/samples/ContactManager             samples/${PLATFORM_NAME}/legacy/ContactManager
 development/samples/CrossCompatibility         samples/${PLATFORM_NAME}/legacy/CrossCompatibility
 development/samples/CubeLiveWallpaper          samples/${PLATFORM_NAME}/legacy/CubeLiveWallpaper
@@ -416,7 +419,6 @@
 development/samples/LunarLander                samples/${PLATFORM_NAME}/legacy/LunarLander
 development/samples/MultiResolution            samples/${PLATFORM_NAME}/legacy/MultiResolution
 development/samples/NotePad                    samples/${PLATFORM_NAME}/legacy/NotePad
-development/samples/RandomMusicPlayer          samples/${PLATFORM_NAME}/legacy/RandomMusicPlayer
 development/samples/SpellChecker/SampleSpellCheckerService samples/${PLATFORM_NAME}/legacy/SpellChecker/SampleSpellCheckerService
 development/samples/SpellChecker/HelloSpellChecker         samples/${PLATFORM_NAME}/legacy/SpellChecker/HelloSpellChecker
 development/samples/SampleSyncAdapter          samples/${PLATFORM_NAME}/legacy/SampleSyncAdapter
diff --git a/build/tools/mk_sdk_repo_xml.sh b/build/tools/mk_sdk_repo_xml.sh
index 1ce8395..ed98980 100755
--- a/build/tools/mk_sdk_repo_xml.sh
+++ b/build/tools/mk_sdk_repo_xml.sh
@@ -40,6 +40,10 @@
   error "Missing tool: sha1sum (Linux: apt-get install coreutils; Mac: port install md5sha1sum)"
 fi
 
+if [[ -z "$XMLLINT" ]]; then
+  XMLLINT=xmllint
+fi
+
 # Parse input params
 OUT="$1"
 [[ -z "$OUT" ]] && error "Missing output.xml name."
@@ -54,7 +58,7 @@
 # This will be something like "http://schemas.android.com/sdk/android/addon/3"
 XMLNS=$(sed -n '/xmlns:sdk="/s/.*"\(.*\)".*/\1/p' "$SCHEMA")
 [[ -z "$XMLNS" ]] && error "Failed to find xmlns:sdk in $SCHEMA."
-echo "## Using xmlns:sdk=$XMLNS"
+#echo "## Using xmlns:sdk=$XMLNS"
 
 # Extract the schema version number from the XMLNS, e.g. it would extract "3"
 XSD_VERSION="${XMLNS##*/}"
@@ -63,7 +67,7 @@
 # which name starts with "sdk-" (e.g. sdk-repository, sdk-addon)
 ROOT=$(sed -n -e '/xsd:element.*name="sdk-/s/.*name="\(sdk-[^"]*\)".*/\1/p' "$SCHEMA")
 [[ -z "$ROOT" ]] && error "Failed to find root element in $SCHEMA."
-echo "## Using root element $ROOT"
+#echo "## Using root element $ROOT"
 
 # Generate XML header
 cat > "$OUT" <<EOFH
@@ -415,7 +419,7 @@
     fi
 
     # Generate archive info
-    echo "## Add $TYPE/$OS archive $SRC"
+    #echo "## Add $TYPE/$OS archive $SRC"
     if [[ $( uname ) == "Darwin" ]]; then
       SIZE=$( stat -f %z "$SRC" )
     else
@@ -461,6 +465,5 @@
 # Generate XML footer
 echo "</sdk:$ROOT>" >> "$OUT"
 
-echo "## Validate XML against schema"
-xmllint --schema $SCHEMA "$OUT"
-
+#echo "## Validate XML against schema"
+$XMLLINT --noout --schema $SCHEMA "$OUT"
diff --git a/build/tools/sdk_repo.mk b/build/tools/sdk_repo.mk
index adf6b27..ec89165 100644
--- a/build/tools/sdk_repo.mk
+++ b/build/tools/sdk_repo.mk
@@ -6,6 +6,8 @@
 SDK_REPO_XML_ARGS   :=
 SDK_EXTRAS_DEPS     :=
 SDK_EXTRAS_XML_ARGS :=
+SDK_SYSIMG_DEPS     :=
+SDK_SYSIMG_XML_ARGS :=
 
 # Define the name of a package zip file to generate
 # $1=OS (e.g. linux-x86, windows, etc)
@@ -97,17 +99,29 @@
 # $4=package to create, must be "sources"
 #
 define mk-sdk-repo-sources
-$(call sdk-repo-pkg-zip,$(2),$(3),$(4)): $(3) $(HOST_OUT)/development/sdk/source_source.properties
+$(call sdk-repo-pkg-zip,$(2),$(3),$(4)): $(3) development/build/tools/mk_sources_zip.py $(HOST_OUT)/development/sdk/source_source.properties
 	@echo "Building SDK sources package"
-	$(hide) $(TOPDIR)development/build/tools/mk_sources_zip.py --exec-zip \
+	development/build/tools/mk_sources_zip.py --exec-zip \
 	            $(HOST_OUT)/development/sdk/source_source.properties \
-	            $(call sdk-repo-pkg-zip,$(2),$(3),$(4)) \
-	            $(TOPDIR).
+	            $$@ .
 $(call dist-for-goals, sdk_repo, $(call sdk-repo-pkg-zip,$(2),$(3),$(4)))
 $(1) += $(4) $(2) \
     $(call sdk-repo-pkg-zip,$(2),$(3),$(4)):$(notdir $(call sdk-repo-pkg-zip,$(2),$(3),$(4)))
 endef
 
+# Defines the rule to build an XML file for a package.
+#
+# $1=output file
+# $2=schema file
+# $3=deps
+# $4=args
+define mk-sdk-repo-xml
+$(1): $$(XMLLINT) development/build/tools/mk_sdk_repo_xml.sh $(2) $(3)
+	XMLLINT=$$(XMLLINT) development/build/tools/mk_sdk_repo_xml.sh $$@ $(2) $(4)
+
+$$(call dist-for-goals,sdk_repo,$(1))
+endef
+
 # -----------------------------------------------------------------
 # Rules for main host sdk
 
@@ -158,19 +172,19 @@
 SDK_REPO_XSD := \
     $(lastword \
       $(wildcard \
-        $(TOPDIR)prebuilts/devtools/repository/sdk-repository-*.xsd \
+        prebuilts/devtools/repository/sdk-repository-*.xsd \
     ))
 
 SDK_ADDON_XSD := \
     $(lastword \
       $(wildcard \
-        $(TOPDIR)prebuilts/devtools/repository/sdk-addon-*.xsd \
+        prebuilts/devtools/repository/sdk-addon-*.xsd \
     ))
 
 SDK_SYSIMG_XSD := \
     $(lastword \
       $(wildcard \
-        $(TOPDIR)prebuilts/devtools/repository/sdk-sys-img-*.xsd \
+        prebuilts/devtools/repository/sdk-sys-img-*.xsd \
     ))
 
 
@@ -192,11 +206,10 @@
 
 SDK_ADDON_XML := $(dir $(ADDON_SDK_ZIP))/addon.xml
 
-$(SDK_ADDON_XML): $(ADDON_SDK_ZIP)
-	$(hide) $(TOPDIR)development/build/tools/mk_sdk_repo_xml.sh \
-	            $(SDK_ADDON_XML) $(SDK_ADDON_XSD) add-on $(HOST_OS) $(RENAMED_ADDON_ZIP)
+$(eval $(call mk-sdk-repo-xml,$(SDK_ADDON_XML),$(SDK_ADDON_XSD),$(ADDON_SDK_ZIP),add-on $(HOST_OS) $(RENAMED_ADDON_ZIP)))
 
-$(call dist-for-goals, sdk_repo, $(SDK_ADDON_XML))
+SDK_ADDON_XML :=
+RENAMED_ADDON_ZIP :=
 
 endif
 
@@ -212,11 +225,10 @@
 
 SDK_ADDON_IMG_XML := $(dir $(ADDON_SDK_ZIP))/addon-sys-img.xml
 
-$(SDK_ADDON_IMG_XML): $(ADDON_SDK_IMG_ZIP)
-	$(hide) $(TOPDIR)development/build/tools/mk_sdk_repo_xml.sh \
-	            $(SDK_ADDON_IMG_XML) $(SDK_SYSIMG_XSD) system-image $(HOST_OS) $(RENAMED_ADDON_IMG_ZIP)
+$(eval $(call mk-sdk-repo-xml,$(SDK_ADDON_IMG_XML),$(SDK_SYSIMG_XSD),$(ADDON_SDK_IMG_ZIP),system-image $(HOST_OS) $(RENAMED_ADDON_IMG_ZIP)))
 
-$(call dist-for-goals, sdk_repo, $(SDK_ADDON_IMG_XML))
+SDK_ADDON_IMG_XML :=
+RENAMED_ADDON_IMG_ZIP :=
 
 endif
 endif
@@ -229,51 +241,42 @@
 SDK_SYSIMG_XML := $(MAIN_SDK_DIR)/repo-sys-img.xml
 
 ifneq ($(SDK_REPO_XML_ARGS),)
-
-$(SDK_REPO_XML): $(SDK_REPO_DEPS)
-	$(hide) $(TOPDIR)development/build/tools/mk_sdk_repo_xml.sh \
-	            $(SDK_REPO_XML) $(SDK_REPO_XSD) $(SDK_REPO_XML_ARGS)
-
-$(call dist-for-goals, sdk_repo, $(SDK_REPO_XML))
-
+$(eval $(call mk-sdk-repo-xml,$(SDK_REPO_XML),$(SDK_REPO_XSD),$(SDK_REPO_DEPS),$(SDK_REPO_XML_ARGS)))
 else
-
-$(SDK_REPO_XML): ;
-
+SDK_REPO_XML :=
 endif
 
 
 ifneq ($(SDK_EXTRAS_XML_ARGS),)
-
-$(SDK_EXTRAS_XML): $(SDK_EXTRAS_DEPS)
-	$(hide) $(TOPDIR)development/build/tools/mk_sdk_repo_xml.sh \
-	            $(SDK_EXTRAS_XML) $(SDK_ADDON_XSD) $(SDK_EXTRAS_XML_ARGS)
-
-$(call dist-for-goals, sdk_repo, $(SDK_EXTRAS_XML))
-
+$(eval $(call mk-sdk-repo-xml,$(SDK_EXTRAS_XML),$(SDK_ADDON_XSD),$(SDK_EXTRAS_DEPS),$(SDK_EXTRAS_XML_ARGS)))
 else
-
-$(SDK_EXTRAS_XML): ;
-
+SDK_EXTRAS_XML :=
 endif
 
 
 ifneq ($(SDK_SYSIMG_XML_ARGS),)
-
-$(SDK_SYSIMG_XML): $(SDK_SYSIMG_DEPS)
-	$(hide) $(TOPDIR)development/build/tools/mk_sdk_repo_xml.sh \
-	            $(SDK_SYSIMG_XML) $(SDK_SYSIMG_XSD) $(SDK_SYSIMG_XML_ARGS)
-
-$(call dist-for-goals, sdk_repo, $(SDK_SYSIMG_XML))
-
+$(eval $(call mk-sdk-repo-xml,$(SDK_SYSIMG_XML),$(SDK_SYSIMG_XSD),$(SDK_SYSIMG_DEPS),$(SDK_SYSIMG_XML_ARGS)))
 else
-
-$(SDK_SYSIMG_XML): ;
-
+SDK_SYSIMG_XML :=
 endif
 
 # -----------------------------------------------------------------
 
 sdk_repo: $(SDK_REPO_DEPS) $(SDK_REPO_XML) $(SDK_EXTRAS_XML) $(SDK_SYSIMG_XML)
-	@echo "Packing of SDK repository done"
 
+SDK_REPO_DEPS :=
+SDK_REPO_XML :=
+SDK_REPO_XML_ARGS :=
+SDK_EXTRAS_DEPS :=
+SDK_EXTRAS_XML :=
+SDK_EXTRAS_XML_ARGS :=
+SDK_SYSIMG_DEPS :=
+SDK_SYSIMG_XML :=
+SDK_SYSIMG_XML_ARGS :=
+
+mk-sdk-repo-pkg-1 :=
+mk-sdk-repo-pkg-2 :=
+mk-sdk-repo-pkg-3 :=
+mk-sdk-repo-sources :=
+mk-sdk-repo-xml :=
+sdk-repo-pkg-zip :=
diff --git a/build/tools/windows_sdk.mk b/build/tools/windows_sdk.mk
index 28ac714..afe21c9 100644
--- a/build/tools/windows_sdk.mk
+++ b/build/tools/windows_sdk.mk
@@ -19,11 +19,6 @@
 $(error Need a unix2dos command. Please 'apt-get install tofrodos')
 endif
 
-# Define WIN_SDK_TARGETS (the list of targets located in topdir/sdk)
-# and the WIN_SDK_BUILD_PREREQ (the list of build prerequisites)
-# that are tools-dependent and not platform-dependent.
-include $(TOPDIR)sdk/build/windows_sdk_tools.mk
-
 # This is the list of targets that we want to generate as
 # Windows executables. All the targets specified here are located in
 # the topdir/development directory and are somehow platform-dependent.
@@ -43,8 +38,7 @@
 	llvm-rs-cc \
 	sqlite3 \
 	zipalign \
-	split-select \
-	$(WIN_SDK_TARGETS)
+	split-select
 
 WIN_TARGETS := $(foreach t,$(WIN_TARGETS),$(ALL_MODULES.host_cross_$(t).INSTALLED))
 
@@ -63,41 +57,21 @@
 
 .PHONY: win_sdk winsdk-tools
 
-define winsdk-banner
-$(info )
-$(info ====== [Windows SDK] $1 ======)
-$(info )
-endef
-
-define winsdk-info
-$(info MAIN_SDK_NAME: $(MAIN_SDK_NAME))
-$(info WIN_SDK_NAME : $(WIN_SDK_NAME))
-$(info WIN_SDK_DIR  : $(WIN_SDK_DIR))
-$(info WIN_SDK_ZIP  : $(WIN_SDK_ZIP))
-endef
-
 win_sdk: $(WIN_SDK_ZIP)
-	$(call winsdk-banner,Done)
 
 winsdk-tools: $(WIN_TARGETS)
-	$(call winsdk-banner,Tools Done)
 
-$(WIN_SDK_ZIP): $(WIN_TARGETS) $(INTERNAL_SDK_TARGET)
-	$(call winsdk-banner,Build $(WIN_SDK_NAME))
-	$(call winsdk-info)
-	$(hide) rm -rf $(WIN_SDK_DIR)
+$(WIN_SDK_ZIP): $(WIN_TARGETS) $(INTERNAL_SDK_TARGET) $(SOONG_ZIP) \
+		$(HOST_OUT_EXECUTABLES)/atree \
+		development/build/tools/patch_windows_sdk.sh \
+		development/build/sdk-windows-x86.atree
+	@echo Build Windows SDK $(WIN_SDK_NAME)
+	$(hide) rm -rf $(WIN_SDK_DIR) $@
 	$(hide) mkdir -p $(WIN_SDK_DIR)
 	$(hide) cp -rf $(MAIN_SDK_DIR)/$(MAIN_SDK_NAME) $(WIN_SDK_DIR)/$(WIN_SDK_NAME)
 	$(hide) USB_DRIVER_HOOK=$(USB_DRIVER_HOOK) \
 		PLATFORM_VERSION=$(PLATFORM_VERSION) \
-		$(TOPDIR)development/build/tools/patch_windows_sdk.sh $(subst @,-q,$(hide)) \
+		ATREE_STRIP=$(HOST_STRIP) \
+		development/build/tools/patch_windows_sdk.sh -q \
 		$(WIN_SDK_DIR)/$(WIN_SDK_NAME) $(OUT_DIR) $(TOPDIR)
-	$(hide) PLATFORM_VERSION=$(PLATFORM_VERSION) \
-		$(TOPDIR)sdk/build/patch_windows_sdk.sh $(subst @,-q,$(hide)) \
-		$(WIN_SDK_DIR)/$(WIN_SDK_NAME) $(OUT_DIR) $(TOPDIR)
-	$(hide) ( \
-		cd $(WIN_SDK_DIR) && \
-		rm -f $(WIN_SDK_NAME).zip && \
-		zip -rq $(subst @,-q,$(hide)) $(WIN_SDK_NAME).zip $(WIN_SDK_NAME) \
-		)
-	@echo "Windows SDK generated at $(WIN_SDK_ZIP)"
+	$(hide) $(SOONG_ZIP) -d -C $(WIN_SDK_DIR) -D $(WIN_SDK_DIR)/$(WIN_SDK_NAME) -o $@
diff --git a/gsi/OWNERS b/gsi/OWNERS
new file mode 100644
index 0000000..ce13509
--- /dev/null
+++ b/gsi/OWNERS
@@ -0,0 +1,3 @@
+bowgotsai@google.com
+pchsueh@google.com
+szuweilin@google.com
diff --git a/gsi/gsi_util/Android.bp b/gsi/gsi_util/Android.bp
index d1b1131..abc08f5 100644
--- a/gsi/gsi_util/Android.bp
+++ b/gsi/gsi_util/Android.bp
@@ -28,6 +28,7 @@
     "adb",
     "avbtool",
     "checkvintf",
+    "secilc",
     "simg2img",
   ],
   version: {
diff --git a/gsi/gsi_util/build.py b/gsi/gsi_util/build.py
index c8e09c7..a5ec304 100755
--- a/gsi/gsi_util/build.py
+++ b/gsi/gsi_util/build.py
@@ -37,6 +37,8 @@
     RequiredItem('bin/checkvintf', 'bin/checkvintf'),
     RequiredItem('lib64/libbase.so', 'lib64/libbase.so'),
     RequiredItem('lib64/liblog.so', 'lib64/liblog.so'),
+    RequiredItem('bin/secilc', 'bin/secilc'),
+    RequiredItem('lib64/libsepol.so', 'lib64/libsepol.so'),
     RequiredItem('bin/simg2img', 'bin/simg2img'),
     RequiredItem('lib64/libc++.so', 'lib64/libc++.so'),
 ]  # pyformat: disable
diff --git a/gsi/gsi_util/gsi_util.py b/gsi/gsi_util/gsi_util.py
index 938ecb6..1ab7780 100755
--- a/gsi/gsi_util/gsi_util.py
+++ b/gsi/gsi_util/gsi_util.py
@@ -65,7 +65,8 @@
       args.func(args)
     except Exception as e:
       logging.error('%s: %s', argv[0], e.message)
-      logging.exception(e)
+      if args.debug:
+        logging.exception(e)
       sys.exit(1)
 
 
diff --git a/gsi/gsi_util/gsi_util/dumpers/dump_info_list.py b/gsi/gsi_util/gsi_util/dumpers/dump_info_list.py
index defc2c2..fe44790 100644
--- a/gsi/gsi_util/gsi_util/dumpers/dump_info_list.py
+++ b/gsi/gsi_util/gsi_util/dumpers/dump_info_list.py
@@ -32,13 +32,20 @@
 # The total list of all possible dump info.
 # It will be output by the order of the list.
 DUMP_LIST = [
-    DumpInfoListItem('system_build_id', SYSTEM_BUILD_PROP_DUMPER, 'ro.build.display.id'),
+    # System
+    DumpInfoListItem('system_fingerprint', SYSTEM_BUILD_PROP_DUMPER, 'ro.build.fingerprint'),
     DumpInfoListItem('system_sdk_ver', SYSTEM_BUILD_PROP_DUMPER, 'ro.build.version.sdk'),
+    DumpInfoListItem('system_vndk_ver', SYSTEM_BUILD_PROP_DUMPER, 'ro.vndk.version'),
     DumpInfoListItem('system_security_patch_level', SYSTEM_BUILD_PROP_DUMPER, 'ro.build.version.security_patch'),
     DumpInfoListItem('system_kernel_sepolicy_ver', SYSTEM_MATRIX_DUMPER, './sepolicy/kernel-sepolicy-version'),
     DumpInfoListItem('system_support_sepolicy_ver', SYSTEM_MATRIX_DUMPER, './sepolicy/sepolicy-version'),
     DumpInfoListItem('system_avb_ver', SYSTEM_MATRIX_DUMPER, './avb/vbmeta-version'),
+    # Vendor
     DumpInfoListItem('vendor_fingerprint', VENDOR_BUILD_PROP_DUMPER, 'ro.vendor.build.fingerprint'),
+    DumpInfoListItem('vendor_vndk_ver', VENDOR_BUILD_PROP_DUMPER, 'ro.vndk.version'),
+    DumpInfoListItem('vendor_security_patch_level', SYSTEM_BUILD_PROP_DUMPER, 'ro.vendor.build.version.security_patch'),
     DumpInfoListItem('vendor_low_ram', VENDOR_BUILD_PROP_DUMPER, 'ro.config.low_ram'),
     DumpInfoListItem('vendor_zygote', VENDOR_DEFAULT_PROP_DUMPER, 'ro.zygote'),
+    DumpInfoListItem('vendor_oem_unlock_supported', VENDOR_DEFAULT_PROP_DUMPER, 'oem_unlock_supported'),
+    DumpInfoListItem('vendor_adb_secure', VENDOR_DEFAULT_PROP_DUMPER, 'ro.adb.secure'),
 ]  # pyformat: disable
diff --git a/gsi/gsi_util/gsi_util/mounters/adb_mounter.py b/gsi/gsi_util/gsi_util/mounters/adb_mounter.py
index 4626175..15bd304 100644
--- a/gsi/gsi_util/gsi_util/mounters/adb_mounter.py
+++ b/gsi/gsi_util/gsi_util/mounters/adb_mounter.py
@@ -49,11 +49,12 @@
   # override
   def _handle_prepare_file(self, filename_in_storage):
     filename = os.path.join(self._temp_dir, filename_in_storage)
-    logging.info('Prepare file %s -> %s', filename_in_storage, filename)
+    logging.info('_AdbFileAccessor: Prepare file %s -> %s',
+                 filename_in_storage, filename)
 
     self._make_parent_dirs(filename)
     if not adb_utils.pull(filename, filename_in_storage, self._serial_num):
-      logging.error('Fail to prepare file: %s', filename_in_storage)
+      logging.info('  Fail to prepare file: %s', filename_in_storage)
       return None
 
     return base_mounter.MounterFile(filename)
diff --git a/gsi/gsi_util/gsi_util/mounters/folder_mounter.py b/gsi/gsi_util/gsi_util/mounters/folder_mounter.py
index 59fdedb..003673e 100644
--- a/gsi/gsi_util/gsi_util/mounters/folder_mounter.py
+++ b/gsi/gsi_util/gsi_util/mounters/folder_mounter.py
@@ -34,9 +34,10 @@
   # override
   def _handle_prepare_file(self, filename_in_storage):
     filename = os.path.join(self._folder_dir, filename_in_storage)
-    logging.debug('Prepare file %s -> %s', filename_in_storage, filename)
+    logging.info('_FolderFileAccessor: Prepare file %s -> %s',
+                 filename_in_storage, filename)
     if not os.path.isfile(filename):
-      logging.error('File is not exist: %s', filename_in_storage)
+      logging.info('  File is not exist: %s', filename_in_storage)
       return None
     return base_mounter.MounterFile(filename)
 
diff --git a/gsi/gsi_util/gsi_util/mounters/image_mounter.py b/gsi/gsi_util/gsi_util/mounters/image_mounter.py
index a03415e..e24ffc0 100644
--- a/gsi/gsi_util/gsi_util/mounters/image_mounter.py
+++ b/gsi/gsi_util/gsi_util/mounters/image_mounter.py
@@ -49,12 +49,13 @@
   def _handle_prepare_file(self, filename_in_storage):
     filespec = os.path.join('/', filename_in_storage)
     out_file = os.path.join(self._temp_dir, filename_in_storage)
-    logging.info('Prepare file %s -> %s', filename_in_storage, out_file)
+    logging.info('_ImageFileAccessor: Prepare file %s -> %s',
+                 filename_in_storage, out_file)
 
     self._make_parent_dirs(out_file)
 
     if not debugfs.dump(self._raw_image_file, filespec, out_file):
-      logging.error('File does not exist: %s', filename_in_storage)
+      logging.info('  File does not exist: %s', filename_in_storage)
       return None
 
     return base_mounter.MounterFile(out_file)
diff --git a/gsi/gsi_util/gsi_util/utils/adb_utils.py b/gsi/gsi_util/gsi_util/utils/adb_utils.py
index 3a7bfb3..511863e 100644
--- a/gsi/gsi_util/gsi_util/utils/adb_utils.py
+++ b/gsi/gsi_util/gsi_util/utils/adb_utils.py
@@ -39,6 +39,6 @@
 
   # 'read_stdout=True' to disable output
   (returncode, _, _) = run_command(
-      command, raise_on_error=False, read_stdout=True, log_stdout=True)
+      command, raise_on_error=False, read_stdout=True)
 
   return returncode == 0
diff --git a/gsi/gsi_util/gsi_util/utils/cmd_utils.py b/gsi/gsi_util/gsi_util/utils/cmd_utils.py
index 4c5a212..4493b5c 100644
--- a/gsi/gsi_util/gsi_util/utils/cmd_utils.py
+++ b/gsi/gsi_util/gsi_util/utils/cmd_utils.py
@@ -17,18 +17,37 @@
 from collections import namedtuple
 import logging
 import os
+import shlex
 import subprocess
+import sys
 
 
 CommandResult = namedtuple('CommandResult', 'returncode stdoutdata, stderrdata')
 PIPE = subprocess.PIPE
 
+_LOCAL_BIN_PATH = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
+                               'bin')
+
+
+def _update_command_for_local(command, kwargs):
+  if kwargs.get('shell', False):
+    # do nothing for shell commands
+    return
+
+  prog = command[0]
+  local_prog = os.path.join(_LOCAL_BIN_PATH, prog)
+  if os.path.isfile(local_prog) and os.access(local_prog, os.X_OK):
+    logging.debug('Using local executable: %s', local_prog)
+    command[0] = local_prog
+
 
 def run_command(command, read_stdout=False, read_stderr=False,
                 log_stdout=False, log_stderr=False,
                 raise_on_error=True, sudo=False, **kwargs):
   """Runs a command and returns the results.
 
+    The method tries to use the executable in bin/ firstly.
+
   Args:
     command: A sequence of command arguments or else a single string.
     read_stdout: If True, includes stdout data in the returned tuple.
@@ -50,17 +69,14 @@
     OSError: Not such a command to execute, raised by subprocess.Popen().
     subprocess.CalledProcessError: The return code of the command is nonzero.
   """
+  _update_command_for_local(command, kwargs)
+
   if sudo and os.getuid() != 0:
     if kwargs.pop('shell', False):
       command = ['sudo', 'sh', '-c', command]
     else:
       command = ['sudo'] + command
 
-  if kwargs.get('shell'):
-    command_in_log = command
-  else:
-    command_in_log = ' '.join(arg for arg in command)
-
   if read_stdout or log_stdout:
     assert kwargs.get('stdout') in [None, PIPE]
     kwargs['stdout'] = PIPE
@@ -76,9 +92,14 @@
   else:
     proc.wait()  # no need to communicate; just wait.
 
-  log_level = logging.ERROR if proc.returncode != 0 else logging.INFO
-  logging.log(log_level, 'Executed command: %r (ret: %d)',
+  if kwargs.get('shell'):
+    command_in_log = command
+  else:
+    command_in_log = ' '.join(arg for arg in command)
+  logging.log(logging.INFO, 'Executed command: %r (ret: %d)',
               command_in_log, proc.returncode)
+
+  log_level = logging.ERROR if proc.returncode != 0 else logging.INFO
   if log_stdout:
     logging.log(log_level, '  stdout: %r', stdout)
   if log_stderr:
diff --git a/gsi/gsi_util/gsi_util/utils/tests/cmd_utils_unittest.py b/gsi/gsi_util/gsi_util/utils/tests/cmd_utils_unittest.py
index 18a27dc..9908fe0 100755
--- a/gsi/gsi_util/gsi_util/utils/tests/cmd_utils_unittest.py
+++ b/gsi/gsi_util/gsi_util/utils/tests/cmd_utils_unittest.py
@@ -72,7 +72,7 @@
                                    log_stderr=True)
     self.assertEqual((3, None, None), result)
     self.assertEqual(
-        ('ERROR', 'Executed command: %r (ret: %d)' % (error_cmd, 3)),
+        ('INFO', 'Executed command: %r (ret: %d)' % (error_cmd, 3)),
         self._log_entries[0])
     self.assertEqual(('ERROR', "  stderr: '123\\n456\\n'"),
                      self._log_entries[1])
@@ -83,7 +83,7 @@
                                    log_stdout=True, log_stderr=True)
     self.assertEqual((5, None, None), result)
     self.assertEqual(
-        ('ERROR', 'Executed command: %r (ret: %d)' % (error_cmd, 5)),
+        ('INFO', 'Executed command: %r (ret: %d)' % (error_cmd, 5)),
         self._log_entries[0])
     self.assertEqual(('ERROR', "  stdout: 'foo\\nbar\\n'"),
                      self._log_entries[1])
diff --git a/ndk/Android.bp b/ndk/Android.bp
index 03517be..694ed15 100644
--- a/ndk/Android.bp
+++ b/ndk/Android.bp
@@ -16,11 +16,11 @@
 
 ndk_headers {
     name: "libz_headers",
-    from: "platforms/android-14/include",
+    from: "zlib",
     to: "",
     srcs: [
-        "platforms/android-14/include/zconf.h",
-        "platforms/android-14/include/zlib.h",
+        "zlib/zconf.h",
+        "zlib/zlib.h",
     ],
-    license: "NOTICE.zlib",
+    license: "zlib/NOTICE",
 }
diff --git a/ndk/platforms/android-14/include/zconf.h b/ndk/platforms/android-14/include/zconf.h
deleted file mode 100644
index 03a9431..0000000
--- a/ndk/platforms/android-14/include/zconf.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- */
-#ifdef Z_PREFIX
-#  define deflateInit_          z_deflateInit_
-#  define deflate               z_deflate
-#  define deflateEnd            z_deflateEnd
-#  define inflateInit_          z_inflateInit_
-#  define inflate               z_inflate
-#  define inflateEnd            z_inflateEnd
-#  define deflateInit2_         z_deflateInit2_
-#  define deflateSetDictionary  z_deflateSetDictionary
-#  define deflateCopy           z_deflateCopy
-#  define deflateReset          z_deflateReset
-#  define deflateParams         z_deflateParams
-#  define deflateBound          z_deflateBound
-#  define deflatePrime          z_deflatePrime
-#  define inflateInit2_         z_inflateInit2_
-#  define inflateSetDictionary  z_inflateSetDictionary
-#  define inflateSync           z_inflateSync
-#  define inflateSyncPoint      z_inflateSyncPoint
-#  define inflateCopy           z_inflateCopy
-#  define inflateReset          z_inflateReset
-#  define inflateBack           z_inflateBack
-#  define inflateBackEnd        z_inflateBackEnd
-#  define compress              z_compress
-#  define compress2             z_compress2
-#  define compressBound         z_compressBound
-#  define uncompress            z_uncompress
-#  define adler32               z_adler32
-#  define crc32                 z_crc32
-#  define get_crc_table         z_get_crc_table
-#  define zError                z_zError
-
-#  define alloc_func            z_alloc_func
-#  define free_func             z_free_func
-#  define in_func               z_in_func
-#  define out_func              z_out_func
-#  define Byte                  z_Byte
-#  define uInt                  z_uInt
-#  define uLong                 z_uLong
-#  define Bytef                 z_Bytef
-#  define charf                 z_charf
-#  define intf                  z_intf
-#  define uIntf                 z_uIntf
-#  define uLongf                z_uLongf
-#  define voidpf                z_voidpf
-#  define voidp                 z_voidp
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-#  define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-#  define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-#  define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-#  ifndef WIN32
-#    define WIN32
-#  endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-#    ifndef SYS16BIT
-#      define SYS16BIT
-#    endif
-#  endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-#  define MAXSEG_64K
-#endif
-#ifdef MSDOS
-#  define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-#  ifndef STDC
-#    define STDC
-#  endif
-#  if __STDC_VERSION__ >= 199901L
-#    ifndef STDC99
-#      define STDC99
-#    endif
-#  endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-#  define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-#  define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
-#  define STDC
-#endif
-
-#ifndef STDC
-#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-#    define const       /* note: need a more gentle solution here */
-#  endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-#  define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-#  ifdef MAXSEG_64K
-#    define MAX_MEM_LEVEL 8
-#  else
-#    define MAX_MEM_LEVEL 9
-#  endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-#  define MAX_WBITS   15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
-            (1 << (windowBits+2)) +  (1 << (memLevel+9))
- that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
-     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
-   The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
-                        /* Type declarations */
-
-#ifndef OF /* function prototypes */
-#  ifdef STDC
-#    define OF(args)  args
-#  else
-#    define OF(args)  ()
-#  endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-#  if defined(M_I86SM) || defined(M_I86MM)
-     /* MSC small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef _MSC_VER
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#  if (defined(__SMALL__) || defined(__MEDIUM__))
-     /* Turbo C small or medium model */
-#    define SMALL_MEDIUM
-#    ifdef __BORLANDC__
-#      define FAR _far
-#    else
-#      define FAR far
-#    endif
-#  endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
-   /* If building or using zlib as a DLL, define ZLIB_DLL.
-    * This is not mandatory, but it offers a little performance increase.
-    */
-#  ifdef ZLIB_DLL
-#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-#      ifdef ZLIB_INTERNAL
-#        define ZEXTERN extern __declspec(dllexport)
-#      else
-#        define ZEXTERN extern __declspec(dllimport)
-#      endif
-#    endif
-#  endif  /* ZLIB_DLL */
-   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
-    * define ZLIB_WINAPI.
-    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
-    */
-#  ifdef ZLIB_WINAPI
-#    ifdef FAR
-#      undef FAR
-#    endif
-#    include <windows.h>
-     /* No need for _export, use ZLIB.DEF instead. */
-     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-#    define ZEXPORT WINAPI
-#    ifdef WIN32
-#      define ZEXPORTVA WINAPIV
-#    else
-#      define ZEXPORTVA FAR CDECL
-#    endif
-#  endif
-#endif
-
-#if defined (__BEOS__)
-#  ifdef ZLIB_DLL
-#    ifdef ZLIB_INTERNAL
-#      define ZEXPORT   __declspec(dllexport)
-#      define ZEXPORTVA __declspec(dllexport)
-#    else
-#      define ZEXPORT   __declspec(dllimport)
-#      define ZEXPORTVA __declspec(dllimport)
-#    endif
-#  endif
-#endif
-
-#ifndef ZEXTERN
-#  define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-#  define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-#  define ZEXPORTVA
-#endif
-
-#ifndef FAR
-#  define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char  Byte;  /* 8 bits */
-#endif
-typedef unsigned int   uInt;  /* 16 bits or more */
-typedef unsigned long  uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
-   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-#  define Bytef Byte FAR
-#else
-   typedef Byte  FAR Bytef;
-#endif
-typedef char  FAR charf;
-typedef int   FAR intf;
-typedef uInt  FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
-   typedef void const *voidpc;
-   typedef void FAR   *voidpf;
-   typedef void       *voidp;
-#else
-   typedef Byte const *voidpc;
-   typedef Byte FAR   *voidpf;
-   typedef Byte       *voidp;
-#endif
-
-#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
-#  include <sys/types.h> /* for off_t */
-#  include <unistd.h>    /* for SEEK_* and off_t */
-#  ifdef VMS
-#    include <unixio.h>   /* for off_t */
-#  endif
-#  define z_off_t off_t
-#endif
-#ifndef SEEK_SET
-#  define SEEK_SET        0       /* Seek from beginning of file.  */
-#  define SEEK_CUR        1       /* Seek from current position.  */
-#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
-#endif
-#ifndef z_off_t
-#  define z_off_t long
-#endif
-
-#if defined(__OS400__)
-#  define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-#  define NO_vsnprintf
-#  ifdef FAR
-#    undef FAR
-#  endif
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-#   pragma map(deflateInit_,"DEIN")
-#   pragma map(deflateInit2_,"DEIN2")
-#   pragma map(deflateEnd,"DEEND")
-#   pragma map(deflateBound,"DEBND")
-#   pragma map(inflateInit_,"ININ")
-#   pragma map(inflateInit2_,"ININ2")
-#   pragma map(inflateEnd,"INEND")
-#   pragma map(inflateSync,"INSY")
-#   pragma map(inflateSetDictionary,"INSEDI")
-#   pragma map(compressBound,"CMBND")
-#   pragma map(inflate_table,"INTABL")
-#   pragma map(inflate_fast,"INFA")
-#   pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/ndk/platforms/android-14/include/zlib.h b/ndk/platforms/android-14/include/zlib.h
deleted file mode 100644
index 0228179..0000000
--- a/ndk/platforms/android-14/include/zlib.h
+++ /dev/null
@@ -1,1357 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.3, July 18th, 2005
-
-  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  Jean-loup Gailly        Mark Adler
-  jloup@gzip.org          madler@alumni.caltech.edu
-
-
-  The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
-  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.3"
-#define ZLIB_VERNUM 0x1230
-
-/*
-     The 'zlib' compression library provides in-memory compression and
-  decompression functions, including integrity checks of the uncompressed
-  data.  This version of the library supports only one compression method
-  (deflation) but other algorithms will be added later and will have the same
-  stream interface.
-
-     Compression can be done in a single step if the buffers are large
-  enough (for example if an input file is mmap'ed), or can be done by
-  repeated calls of the compression function.  In the latter case, the
-  application must provide more input and/or consume the output
-  (providing more output space) before each call.
-
-     The compressed data format used by default by the in-memory functions is
-  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
-  around a deflate stream, which is itself documented in RFC 1951.
-
-     The library also supports reading and writing files in gzip (.gz) format
-  with an interface similar to that of stdio using the functions that start
-  with "gz".  The gzip format is different from the zlib format.  gzip is a
-  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
-     This library can optionally read and write gzip streams in memory as well.
-
-     The zlib format was designed to be compact and fast for use in memory
-  and on communications channels.  The gzip format was designed for single-
-  file compression on file systems, has a larger header than zlib to maintain
-  directory information, and uses a different, slower check method than zlib.
-
-     The library does not install any signal handler. The decoder checks
-  the consistency of the compressed data, so the library should never
-  crash even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
-    Bytef    *next_in;  /* next input byte */
-    uInt     avail_in;  /* number of bytes available at next_in */
-    uLong    total_in;  /* total nb of input bytes read so far */
-
-    Bytef    *next_out; /* next output byte should be put there */
-    uInt     avail_out; /* remaining free space at next_out */
-    uLong    total_out; /* total nb of bytes output so far */
-
-    char     *msg;      /* last error message, NULL if no error */
-    struct internal_state FAR *state; /* not visible by applications */
-
-    alloc_func zalloc;  /* used to allocate the internal state */
-    free_func  zfree;   /* used to free the internal state */
-    voidpf     opaque;  /* private data object passed to zalloc and zfree */
-
-    int     data_type;  /* best guess about the data type: binary or text */
-    uLong   adler;      /* adler32 value of the uncompressed data */
-    uLong   reserved;   /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
-     gzip header information passed to and from zlib routines.  See RFC 1952
-  for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
-    int     text;       /* true if compressed data believed to be text */
-    uLong   time;       /* modification time */
-    int     xflags;     /* extra flags (not used when writing a gzip file) */
-    int     os;         /* operating system */
-    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
-    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
-    uInt    extra_max;  /* space at extra (only when reading header) */
-    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
-    uInt    name_max;   /* space at name (only when reading header) */
-    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
-    uInt    comm_max;   /* space at comment (only when reading header) */
-    int     hcrc;       /* true if there was or will be a header crc */
-    int     done;       /* true when done reading gzip header (not used
-                           when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
-   The application must update next_in and avail_in when avail_in has
-   dropped to zero. It must update next_out and avail_out when avail_out
-   has dropped to zero. The application must initialize zalloc, zfree and
-   opaque before calling the init function. All other fields are set by the
-   compression library and must not be updated by the application.
-
-   The opaque value provided by the application will be passed as the first
-   parameter for calls of zalloc and zfree. This can be useful for custom
-   memory management. The compression library attaches no meaning to the
-   opaque value.
-
-   zalloc must return Z_NULL if there is not enough memory for the object.
-   If zlib is used in a multi-threaded application, zalloc and zfree must be
-   thread safe.
-
-   On 16-bit systems, the functions zalloc and zfree must be able to allocate
-   exactly 65536 bytes, but will not be required to allocate more than this
-   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
-   pointers returned by zalloc for objects of exactly 65536 bytes *must*
-   have their offset normalized to zero. The default allocation function
-   provided by this library ensures this (see zutil.c). To reduce memory
-   requirements and avoid any allocation of 64K objects, at the expense of
-   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
-   The fields total_in and total_out can be used for statistics or
-   progress reports. After compression, total_in holds the total size of
-   the uncompressed data and may be saved for use in the decompressor
-   (particularly if the decompressor wants to decompress everything in
-   a single step).
-*/
-
-                        /* constants */
-
-#define Z_NO_FLUSH      0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
-#define Z_SYNC_FLUSH    2
-#define Z_FULL_FLUSH    3
-#define Z_FINISH        4
-#define Z_BLOCK         5
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK            0
-#define Z_STREAM_END    1
-#define Z_NEED_DICT     2
-#define Z_ERRNO        (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR   (-3)
-#define Z_MEM_ERROR    (-4)
-#define Z_BUF_ERROR    (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION         0
-#define Z_BEST_SPEED             1
-#define Z_BEST_COMPRESSION       9
-#define Z_DEFAULT_COMPRESSION  (-1)
-/* compression levels */
-
-#define Z_FILTERED            1
-#define Z_HUFFMAN_ONLY        2
-#define Z_RLE                 3
-#define Z_FIXED               4
-#define Z_DEFAULT_STRATEGY    0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY   0
-#define Z_TEXT     1
-#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN  2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED   8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
-                        /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
-   If the first character differs, the library code actually used is
-   not compatible with the zlib.h header file used by the application.
-   This check is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
-     Initializes the internal stream state for compression. The fields
-   zalloc, zfree and opaque must be initialized before by the caller.
-   If zalloc and zfree are set to Z_NULL, deflateInit updates them to
-   use default allocation functions.
-
-     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
-   1 gives best speed, 9 gives best compression, 0 gives no compression at
-   all (the input data is simply copied a block at a time).
-   Z_DEFAULT_COMPRESSION requests a default compromise between speed and
-   compression (currently equivalent to level 6).
-
-     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if level is not a valid compression level,
-   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
-   with the version assumed by the caller (ZLIB_VERSION).
-   msg is set to null if there is no error message.  deflateInit does not
-   perform any compression: this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
-    deflate compresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full. It may introduce some
-  output latency (reading input without producing any output) except when
-  forced to flush.
-
-    The detailed semantics are as follows. deflate performs one or both of the
-  following actions:
-
-  - Compress more input starting at next_in and update next_in and avail_in
-    accordingly. If not all input can be processed (because there is not
-    enough room in the output buffer), next_in and avail_in are updated and
-    processing will resume at this point for the next call of deflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly. This action is forced if the parameter flush is non zero.
-    Forcing flush frequently degrades the compression ratio, so this parameter
-    should be set only when necessary (in interactive applications).
-    Some output may be provided even if flush is not set.
-
-  Before the call of deflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming
-  more output, and updating avail_in or avail_out accordingly; avail_out
-  should never be zero before the call. The application can consume the
-  compressed output when it wants, for example when the output buffer is full
-  (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
-  and with zero avail_out, it must be called again after making room in the
-  output buffer because there might be more output pending.
-
-    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
-  decide how much data to accumualte before producing output, in order to
-  maximize compression.
-
-    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
-  flushed to the output buffer and the output is aligned on a byte boundary, so
-  that the decompressor can get all input data available so far. (In particular
-  avail_in is zero after the call if enough output space has been provided
-  before the call.)  Flushing may degrade compression for some compression
-  algorithms and so it should be used only when necessary.
-
-    If flush is set to Z_FULL_FLUSH, all output is flushed as with
-  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
-  restart from this point if previous compressed data has been damaged or if
-  random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
-  compression.
-
-    If deflate returns with avail_out == 0, this function must be called again
-  with the same value of the flush parameter and more output space (updated
-  avail_out), until the flush is complete (deflate returns with non-zero
-  avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
-  avail_out is greater than six to avoid repeated flush markers due to
-  avail_out == 0 on return.
-
-    If the parameter flush is set to Z_FINISH, pending input is processed,
-  pending output is flushed and deflate returns with Z_STREAM_END if there
-  was enough output space; if deflate returns with Z_OK, this function must be
-  called again with Z_FINISH and more output space (updated avail_out) but no
-  more input data, until it returns with Z_STREAM_END or an error. After
-  deflate has returned Z_STREAM_END, the only possible operations on the
-  stream are deflateReset or deflateEnd.
-
-    Z_FINISH can be used immediately after deflateInit if all the compression
-  is to be done in a single step. In this case, avail_out must be at least
-  the value returned by deflateBound (see below). If deflate does not return
-  Z_STREAM_END, then it must be called again as described above.
-
-    deflate() sets strm->adler to the adler32 checksum of all input read
-  so far (that is, total_in bytes).
-
-    deflate() may update strm->data_type if it can make a good guess about
-  the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
-  binary. This field is only for information purposes and does not affect
-  the compression algorithm in any manner.
-
-    deflate() returns Z_OK if some progress has been made (more input
-  processed or more output produced), Z_STREAM_END if all input has been
-  consumed and all output has been produced (only when flush is set to
-  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
-  if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
-  (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
-  fatal, and deflate() can be called again with more input and more output
-  space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any
-   pending output.
-
-     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
-   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
-   prematurely (some input or output was discarded). In the error case,
-   msg may be set but then points to a static string (which must not be
-   deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
-     Initializes the internal stream state for decompression. The fields
-   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
-   the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
-   value depends on the compression method), inflateInit determines the
-   compression method from the zlib header and allocates all data structures
-   accordingly; otherwise the allocation will be deferred to the first call of
-   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
-   use default allocation functions.
-
-     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
-   version assumed by the caller.  msg is set to null if there is no error
-   message. inflateInit does not perform any decompression apart from reading
-   the zlib header if present: this will be done by inflate().  (So next_in and
-   avail_in may be modified, but next_out and avail_out are unchanged.)
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
-    inflate decompresses as much data as possible, and stops when the input
-  buffer becomes empty or the output buffer becomes full. It may introduce
-  some output latency (reading input without producing any output) except when
-  forced to flush.
-
-  The detailed semantics are as follows. inflate performs one or both of the
-  following actions:
-
-  - Decompress more input starting at next_in and update next_in and avail_in
-    accordingly. If not all input can be processed (because there is not
-    enough room in the output buffer), next_in is updated and processing
-    will resume at this point for the next call of inflate().
-
-  - Provide more output starting at next_out and update next_out and avail_out
-    accordingly.  inflate() provides as much output as possible, until there
-    is no more input data or no more space in the output buffer (see below
-    about the flush parameter).
-
-  Before the call of inflate(), the application should ensure that at least
-  one of the actions is possible, by providing more input and/or consuming
-  more output, and updating the next_* and avail_* values accordingly.
-  The application can consume the uncompressed output when it wants, for
-  example when the output buffer is full (avail_out == 0), or after each
-  call of inflate(). If inflate returns Z_OK and with zero avail_out, it
-  must be called again after making room in the output buffer because there
-  might be more output pending.
-
-    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
-  Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
-  output as possible to the output buffer. Z_BLOCK requests that inflate() stop
-  if and when it gets to the next deflate block boundary. When decoding the
-  zlib or gzip format, this will cause inflate() to return immediately after
-  the header and before the first block. When doing a raw inflate, inflate()
-  will go ahead and process the first block, and will return when it gets to
-  the end of that block, or when it runs out of data.
-
-    The Z_BLOCK option assists in appending to or combining deflate streams.
-  Also to assist in this, on return inflate() will set strm->data_type to the
-  number of unused bits in the last byte taken from strm->next_in, plus 64
-  if inflate() is currently decoding the last block in the deflate stream,
-  plus 128 if inflate() returned immediately after decoding an end-of-block
-  code or decoding the complete header up to just before the first byte of the
-  deflate stream. The end-of-block will not be indicated until all of the
-  uncompressed data from that block has been written to strm->next_out.  The
-  number of unused bits may in general be greater than seven, except when
-  bit 7 of data_type is set, in which case the number of unused bits will be
-  less than eight.
-
-    inflate() should normally be called until it returns Z_STREAM_END or an
-  error. However if all decompression is to be performed in a single step
-  (a single call of inflate), the parameter flush should be set to
-  Z_FINISH. In this case all pending input is processed and all pending
-  output is flushed; avail_out must be large enough to hold all the
-  uncompressed data. (The size of the uncompressed data may have been saved
-  by the compressor for this purpose.) The next operation on this stream must
-  be inflateEnd to deallocate the decompression state. The use of Z_FINISH
-  is never required, but can be used to inform inflate that a faster approach
-  may be used for the single inflate() call.
-
-     In this implementation, inflate() always flushes as much output as
-  possible to the output buffer, and always uses the faster approach on the
-  first call. So the only effect of the flush parameter in this implementation
-  is on the return value of inflate(), as noted below, or when it returns early
-  because Z_BLOCK is used.
-
-     If a preset dictionary is needed after this call (see inflateSetDictionary
-  below), inflate sets strm->adler to the adler32 checksum of the dictionary
-  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
-  strm->adler to the adler32 checksum of all output produced so far (that is,
-  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
-  below. At the end of the stream, inflate() checks that its computed adler32
-  checksum is equal to that saved by the compressor and returns Z_STREAM_END
-  only if the checksum is correct.
-
-    inflate() will decompress and check either zlib-wrapped or gzip-wrapped
-  deflate data.  The header type is detected automatically.  Any information
-  contained in the gzip header is not retained, so applications that need that
-  information should instead use raw inflate, see inflateInit2() below, or
-  inflateBack() and perform their own processing of the gzip header and
-  trailer.
-
-    inflate() returns Z_OK if some progress has been made (more input processed
-  or more output produced), Z_STREAM_END if the end of the compressed data has
-  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
-  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
-  corrupted (input stream not conforming to the zlib format or incorrect check
-  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
-  if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
-  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
-  output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
-  inflate() can be called again with more input and more output space to
-  continue decompressing. If Z_DATA_ERROR is returned, the application may then
-  call inflateSync() to look for a good compression block if a partial recovery
-  of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
-     All dynamically allocated data structures for this stream are freed.
-   This function discards any unprocessed input and does not flush any
-   pending output.
-
-     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
-   was inconsistent. In the error case, msg may be set but then points to a
-   static string (which must not be deallocated).
-*/
-
-                        /* Advanced functions */
-
-/*
-    The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
-                                     int  level,
-                                     int  method,
-                                     int  windowBits,
-                                     int  memLevel,
-                                     int  strategy));
-
-     This is another version of deflateInit with more compression options. The
-   fields next_in, zalloc, zfree and opaque must be initialized before by
-   the caller.
-
-     The method parameter is the compression method. It must be Z_DEFLATED in
-   this version of the library.
-
-     The windowBits parameter is the base two logarithm of the window size
-   (the size of the history buffer). It should be in the range 8..15 for this
-   version of the library. Larger values of this parameter result in better
-   compression at the expense of memory usage. The default value is 15 if
-   deflateInit is used instead.
-
-     windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
-   determines the window size. deflate() will then generate raw deflate data
-   with no zlib header or trailer, and will not compute an adler32 check value.
-
-     windowBits can also be greater than 15 for optional gzip encoding. Add
-   16 to windowBits to write a simple gzip header and trailer around the
-   compressed data instead of a zlib wrapper. The gzip header will have no
-   file name, no extra data, no comment, no modification time (set to zero),
-   no header crc, and the operating system will be set to 255 (unknown).  If a
-   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
-     The memLevel parameter specifies how much memory should be allocated
-   for the internal compression state. memLevel=1 uses minimum memory but
-   is slow and reduces compression ratio; memLevel=9 uses maximum memory
-   for optimal speed. The default value is 8. See zconf.h for total memory
-   usage as a function of windowBits and memLevel.
-
-     The strategy parameter is used to tune the compression algorithm. Use the
-   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
-   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
-   string match), or Z_RLE to limit match distances to one (run-length
-   encoding). Filtered data consists mostly of small values with a somewhat
-   random distribution. In this case, the compression algorithm is tuned to
-   compress them better. The effect of Z_FILTERED is to force more Huffman
-   coding and less string matching; it is somewhat intermediate between
-   Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
-   Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
-   parameter only affects the compression ratio but not the correctness of the
-   compressed output even if it is not set appropriately.  Z_FIXED prevents the
-   use of dynamic Huffman codes, allowing for a simpler decoder for special
-   applications.
-
-      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
-   method). msg is set to null if there is no error message.  deflateInit2 does
-   not perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the compression dictionary from the given byte sequence
-   without producing any compressed output. This function must be called
-   immediately after deflateInit, deflateInit2 or deflateReset, before any
-   call of deflate. The compressor and decompressor must use exactly the same
-   dictionary (see inflateSetDictionary).
-
-     The dictionary should consist of strings (byte sequences) that are likely
-   to be encountered later in the data to be compressed, with the most commonly
-   used strings preferably put towards the end of the dictionary. Using a
-   dictionary is most useful when the data to be compressed is short and can be
-   predicted with good accuracy; the data can then be compressed better than
-   with the default empty dictionary.
-
-     Depending on the size of the compression data structures selected by
-   deflateInit or deflateInit2, a part of the dictionary may in effect be
-   discarded, for example if the dictionary is larger than the window size in
-   deflate or deflate2. Thus the strings most likely to be useful should be
-   put at the end of the dictionary, not at the front. In addition, the
-   current implementation of deflate will use at most the window size minus
-   262 bytes of the provided dictionary.
-
-     Upon return of this function, strm->adler is set to the adler32 value
-   of the dictionary; the decompressor may later use this value to determine
-   which dictionary has been used by the compressor. (The adler32 value
-   applies to the whole dictionary even if only a subset of the dictionary is
-   actually used by the compressor.) If a raw deflate was requested, then the
-   adler32 value is not computed and strm->adler is not set.
-
-     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
-   parameter is invalid (such as NULL dictionary) or the stream state is
-   inconsistent (for example if deflate has already been called for this stream
-   or if the compression method is bsort). deflateSetDictionary does not
-   perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
-                                    z_streamp source));
-/*
-     Sets the destination stream as a complete copy of the source stream.
-
-     This function can be useful when several compression strategies will be
-   tried, for example when there are several ways of pre-processing the input
-   data with a filter. The streams that will be discarded should then be freed
-   by calling deflateEnd.  Note that deflateCopy duplicates the internal
-   compression state which can be quite large, so this strategy is slow and
-   can consume lots of memory.
-
-     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
-   (such as zalloc being NULL). msg is left unchanged in both source and
-   destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to deflateEnd followed by deflateInit,
-   but does not free and reallocate all the internal compression state.
-   The stream will keep the same compression level and any other attributes
-   that may have been set by deflateInit2.
-
-      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
-                                      int level,
-                                      int strategy));
-/*
-     Dynamically update the compression level and compression strategy.  The
-   interpretation of level and strategy is as in deflateInit2.  This can be
-   used to switch between compression and straight copy of the input data, or
-   to switch to a different kind of input data requiring a different
-   strategy. If the compression level is changed, the input available so far
-   is compressed with the old level (and may be flushed); the new level will
-   take effect only at the next call of deflate().
-
-     Before the call of deflateParams, the stream state must be set as for
-   a call of deflate(), since the currently available input may have to
-   be compressed and flushed. In particular, strm->avail_out must be non-zero.
-
-     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
-   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
-   if strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
-                                    int good_length,
-                                    int max_lazy,
-                                    int nice_length,
-                                    int max_chain));
-/*
-     Fine tune deflate's internal compression parameters.  This should only be
-   used by someone who understands the algorithm used by zlib's deflate for
-   searching for the best matching string, and even then only by the most
-   fanatic optimizer trying to squeeze out the last compressed bit for their
-   specific input data.  Read the deflate.c source code for the meaning of the
-   max_lazy, good_length, nice_length, and max_chain parameters.
-
-     deflateTune() can be called after deflateInit() or deflateInit2(), and
-   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
-                                       uLong sourceLen));
-/*
-     deflateBound() returns an upper bound on the compressed size after
-   deflation of sourceLen bytes.  It must be called after deflateInit()
-   or deflateInit2().  This would be used to allocate an output buffer
-   for deflation in a single pass, and so would be called before deflate().
-*/
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
-                                     int bits,
-                                     int value));
-/*
-     deflatePrime() inserts bits in the deflate output stream.  The intent
-  is that this function is used to start off the deflate output with the
-  bits leftover from a previous deflate stream when appending to it.  As such,
-  this function can only be used for raw deflate, and must be used before the
-  first deflate() call after a deflateInit2() or deflateReset().  bits must be
-  less than or equal to 16, and that many of the least significant bits of
-  value will be inserted in the output.
-
-      deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
-                                         gz_headerp head));
-/*
-      deflateSetHeader() provides gzip header information for when a gzip
-   stream is requested by deflateInit2().  deflateSetHeader() may be called
-   after deflateInit2() or deflateReset() and before the first call of
-   deflate().  The text, time, os, extra field, name, and comment information
-   in the provided gz_header structure are written to the gzip header (xflag is
-   ignored -- the extra flags are set according to the compression level).  The
-   caller must assure that, if not Z_NULL, name and comment are terminated with
-   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
-   available there.  If hcrc is true, a gzip header crc is included.  Note that
-   the current versions of the command-line version of gzip (up through version
-   1.3.x) do not support header crc's, and will report that it is a "multi-part
-   gzip file" and give up.
-
-      If deflateSetHeader is not used, the default gzip header has text false,
-   the time set to zero, and os set to 255, with no extra, name, or comment
-   fields.  The gzip header is returned to the default state by deflateReset().
-
-      deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
-                                     int  windowBits));
-
-     This is another version of inflateInit with an extra parameter. The
-   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
-   before by the caller.
-
-     The windowBits parameter is the base two logarithm of the maximum window
-   size (the size of the history buffer).  It should be in the range 8..15 for
-   this version of the library. The default value is 15 if inflateInit is used
-   instead. windowBits must be greater than or equal to the windowBits value
-   provided to deflateInit2() while compressing, or it must be equal to 15 if
-   deflateInit2() was not used. If a compressed stream with a larger window
-   size is given as input, inflate() will return with the error code
-   Z_DATA_ERROR instead of trying to allocate a larger window.
-
-     windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
-   determines the window size. inflate() will then process raw deflate data,
-   not looking for a zlib or gzip header, not generating a check value, and not
-   looking for any check values for comparison at the end of the stream. This
-   is for use with other formats that use the deflate compressed data format
-   such as zip.  Those formats provide their own check values. If a custom
-   format is developed using the raw deflate format for compressed data, it is
-   recommended that a check value such as an adler32 or a crc32 be applied to
-   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
-   most applications, the zlib format should be used as is. Note that comments
-   above on the use in deflateInit2() applies to the magnitude of windowBits.
-
-     windowBits can also be greater than 15 for optional gzip decoding. Add
-   32 to windowBits to enable zlib and gzip decoding with automatic header
-   detection, or add 16 to decode only the gzip format (the zlib format will
-   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is
-   a crc32 instead of an adler32.
-
-     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
-   is set to null if there is no error message.  inflateInit2 does not perform
-   any decompression apart from reading the zlib header if present: this will
-   be done by inflate(). (So next_in and avail_in may be modified, but next_out
-   and avail_out are unchanged.)
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
-                                             const Bytef *dictionary,
-                                             uInt  dictLength));
-/*
-     Initializes the decompression dictionary from the given uncompressed byte
-   sequence. This function must be called immediately after a call of inflate,
-   if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
-   can be determined from the adler32 value returned by that call of inflate.
-   The compressor and decompressor must use exactly the same dictionary (see
-   deflateSetDictionary).  For raw inflate, this function can be called
-   immediately after inflateInit2() or inflateReset() and before any call of
-   inflate() to set the dictionary.  The application must insure that the
-   dictionary that was used for compression is provided.
-
-     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
-   parameter is invalid (such as NULL dictionary) or the stream state is
-   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
-   expected one (incorrect adler32 value). inflateSetDictionary does not
-   perform any decompression: this will be done by subsequent calls of
-   inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
-    Skips invalid compressed data until a full flush point (see above the
-  description of deflate with Z_FULL_FLUSH) can be found, or until all
-  available input is skipped. No output is provided.
-
-    inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
-  if no more input was provided, Z_DATA_ERROR if no flush point has been found,
-  or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
-  case, the application may save the current current value of total_in which
-  indicates where valid compressed data was found. In the error case, the
-  application may repeatedly call inflateSync, providing more input each time,
-  until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
-                                    z_streamp source));
-/*
-     Sets the destination stream as a complete copy of the source stream.
-
-     This function can be useful when randomly accessing a large stream.  The
-   first pass through the stream can periodically record the inflate state,
-   allowing restarting inflate at those points when randomly accessing the
-   stream.
-
-     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
-   (such as zalloc being NULL). msg is left unchanged in both source and
-   destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
-     This function is equivalent to inflateEnd followed by inflateInit,
-   but does not free and reallocate all the internal decompression state.
-   The stream will keep attributes that may have been set by inflateInit2.
-
-      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
-                                     int bits,
-                                     int value));
-/*
-     This function inserts bits in the inflate input stream.  The intent is
-  that this function is used to start inflating at a bit position in the
-  middle of a byte.  The provided bits will be used before any bytes are used
-  from next_in.  This function should only be used with raw inflate, and
-  should be used before the first inflate() call after inflateInit2() or
-  inflateReset().  bits must be less than or equal to 16, and that many of the
-  least significant bits of value will be inserted in the input.
-
-      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
-                                         gz_headerp head));
-/*
-      inflateGetHeader() requests that gzip header information be stored in the
-   provided gz_header structure.  inflateGetHeader() may be called after
-   inflateInit2() or inflateReset(), and before the first call of inflate().
-   As inflate() processes the gzip stream, head->done is zero until the header
-   is completed, at which time head->done is set to one.  If a zlib stream is
-   being decoded, then head->done is set to -1 to indicate that there will be
-   no gzip header information forthcoming.  Note that Z_BLOCK can be used to
-   force inflate() to return immediately after header processing is complete
-   and before any actual data is decompressed.
-
-      The text, time, xflags, and os fields are filled in with the gzip header
-   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
-   was valid if done is set to one.)  If extra is not Z_NULL, then extra_max
-   contains the maximum number of bytes to write to extra.  Once done is true,
-   extra_len contains the actual extra field length, and extra contains the
-   extra field, or that field truncated if extra_max is less than extra_len.
-   If name is not Z_NULL, then up to name_max characters are written there,
-   terminated with a zero unless the length is greater than name_max.  If
-   comment is not Z_NULL, then up to comm_max characters are written there,
-   terminated with a zero unless the length is greater than comm_max.  When
-   any of extra, name, or comment are not Z_NULL and the respective field is
-   not present in the header, then that field is set to Z_NULL to signal its
-   absence.  This allows the use of deflateSetHeader() with the returned
-   structure to duplicate the header.  However if those fields are set to
-   allocated memory, then the application will need to save those pointers
-   elsewhere so that they can be eventually freed.
-
-      If inflateGetHeader is not used, then the header information is simply
-   discarded.  The header is always checked for validity, including the header
-   CRC if present.  inflateReset() will reset the process to discard the header
-   information.  The application would need to call inflateGetHeader() again to
-   retrieve the header from the next gzip stream.
-
-      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
-   stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
-                                        unsigned char FAR *window));
-
-     Initialize the internal stream state for decompression using inflateBack()
-   calls.  The fields zalloc, zfree and opaque in strm must be initialized
-   before the call.  If zalloc and zfree are Z_NULL, then the default library-
-   derived memory allocation routines are used.  windowBits is the base two
-   logarithm of the window size, in the range 8..15.  window is a caller
-   supplied buffer of that size.  Except for special applications where it is
-   assured that deflate was used with small window sizes, windowBits must be 15
-   and a 32K byte window must be supplied to be able to decompress general
-   deflate streams.
-
-     See inflateBack() for the usage of these routines.
-
-     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
-   the paramaters are invalid, Z_MEM_ERROR if the internal state could not
-   be allocated, or Z_VERSION_ERROR if the version of the library does not
-   match the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
-                                    in_func in, void FAR *in_desc,
-                                    out_func out, void FAR *out_desc));
-/*
-     inflateBack() does a raw inflate with a single call using a call-back
-   interface for input and output.  This is more efficient than inflate() for
-   file i/o applications in that it avoids copying between the output and the
-   sliding window by simply making the window itself the output buffer.  This
-   function trusts the application to not change the output buffer passed by
-   the output function, at least until inflateBack() returns.
-
-     inflateBackInit() must be called first to allocate the internal state
-   and to initialize the state with the user-provided window buffer.
-   inflateBack() may then be used multiple times to inflate a complete, raw
-   deflate stream with each call.  inflateBackEnd() is then called to free
-   the allocated state.
-
-     A raw deflate stream is one with no zlib or gzip header or trailer.
-   This routine would normally be used in a utility that reads zip or gzip
-   files and writes out uncompressed files.  The utility would decode the
-   header and process the trailer on its own, hence this routine expects
-   only the raw deflate stream to decompress.  This is different from the
-   normal behavior of inflate(), which expects either a zlib or gzip header and
-   trailer around the deflate stream.
-
-     inflateBack() uses two subroutines supplied by the caller that are then
-   called by inflateBack() for input and output.  inflateBack() calls those
-   routines until it reads a complete deflate stream and writes out all of the
-   uncompressed data, or until it encounters an error.  The function's
-   parameters and return types are defined above in the in_func and out_func
-   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
-   number of bytes of provided input, and a pointer to that input in buf.  If
-   there is no input available, in() must return zero--buf is ignored in that
-   case--and inflateBack() will return a buffer error.  inflateBack() will call
-   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
-   should return zero on success, or non-zero on failure.  If out() returns
-   non-zero, inflateBack() will return with an error.  Neither in() nor out()
-   are permitted to change the contents of the window provided to
-   inflateBackInit(), which is also the buffer that out() uses to write from.
-   The length written by out() will be at most the window size.  Any non-zero
-   amount of input may be provided by in().
-
-     For convenience, inflateBack() can be provided input on the first call by
-   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
-   in() will be called.  Therefore strm->next_in must be initialized before
-   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
-   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
-   must also be initialized, and then if strm->avail_in is not zero, input will
-   initially be taken from strm->next_in[0 .. strm->avail_in - 1].
-
-     The in_desc and out_desc parameters of inflateBack() is passed as the
-   first parameter of in() and out() respectively when they are called.  These
-   descriptors can be optionally used to pass any information that the caller-
-   supplied in() and out() functions need to do their job.
-
-     On return, inflateBack() will set strm->next_in and strm->avail_in to
-   pass back any unused input that was provided by the last in() call.  The
-   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
-   if in() or out() returned an error, Z_DATA_ERROR if there was a format
-   error in the deflate stream (in which case strm->msg is set to indicate the
-   nature of the error), or Z_STREAM_ERROR if the stream was not properly
-   initialized.  In the case of Z_BUF_ERROR, an input or output error can be
-   distinguished using strm->next_in which will be Z_NULL only if in() returned
-   an error.  If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
-   out() returning non-zero.  (in() will always be called before out(), so
-   strm->next_in is assured to be defined if out() returns non-zero.)  Note
-   that inflateBack() cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
-     All memory allocated by inflateBackInit() is freed.
-
-     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
-   state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
-    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
-     1.0: size of uInt
-     3.2: size of uLong
-     5.4: size of voidpf (pointer)
-     7.6: size of z_off_t
-
-    Compiler, assembler, and debug options:
-     8: DEBUG
-     9: ASMV or ASMINF -- use ASM code
-     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
-     11: 0 (reserved)
-
-    One-time table building (smaller code, but not thread-safe if true):
-     12: BUILDFIXED -- build static block decoding tables when needed
-     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
-     14,15: 0 (reserved)
-
-    Library content (indicates missing functionality):
-     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
-                          deflate code when not needed)
-     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
-                    and decode gzip streams (to avoid linking crc code)
-     18-19: 0 (reserved)
-
-    Operation variations (changes in library functionality):
-     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
-     21: FASTEST -- deflate algorithm with only one, lowest compression level
-     22,23: 0 (reserved)
-
-    The sprintf variant used by gzprintf (zero is best):
-     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
-     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
-     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
-    Remainder:
-     27-31: 0 (reserved)
- */
-
-
-                        /* utility functions */
-
-/*
-     The following utility functions are implemented on top of the
-   basic stream-oriented functions. To simplify the interface, some
-   default options are assumed (compression level and memory usage,
-   standard memory allocation functions). The source code of these
-   utility functions can easily be modified if you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
-                                 const Bytef *source, uLong sourceLen));
-/*
-     Compresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be at least the value returned
-   by compressBound(sourceLen). Upon exit, destLen is the actual size of the
-   compressed buffer.
-     This function can be used to compress a whole file at once if the
-   input file is mmap'ed.
-     compress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
-                                  const Bytef *source, uLong sourceLen,
-                                  int level));
-/*
-     Compresses the source buffer into the destination buffer. The level
-   parameter has the same meaning as in deflateInit.  sourceLen is the byte
-   length of the source buffer. Upon entry, destLen is the total size of the
-   destination buffer, which must be at least the value returned by
-   compressBound(sourceLen). Upon exit, destLen is the actual size of the
-   compressed buffer.
-
-     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
-   Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
-     compressBound() returns an upper bound on the compressed size after
-   compress() or compress2() on sourceLen bytes.  It would be used before
-   a compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
-                                   const Bytef *source, uLong sourceLen));
-/*
-     Decompresses the source buffer into the destination buffer.  sourceLen is
-   the byte length of the source buffer. Upon entry, destLen is the total
-   size of the destination buffer, which must be large enough to hold the
-   entire uncompressed data. (The size of the uncompressed data must have
-   been saved previously by the compressor and transmitted to the decompressor
-   by some mechanism outside the scope of this compression library.)
-   Upon exit, destLen is the actual size of the compressed buffer.
-     This function can be used to decompress a whole file at once if the
-   input file is mmap'ed.
-
-     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
-   enough memory, Z_BUF_ERROR if there was not enough room in the output
-   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
-*/
-
-
-typedef voidp gzFile;
-
-ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
-/*
-     Opens a gzip (.gz) file for reading or writing. The mode parameter
-   is as in fopen ("rb" or "wb") but can also include a compression level
-   ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
-   Huffman only compression as in "wb1h", or 'R' for run-length encoding
-   as in "wb1R". (See the description of deflateInit2 for more information
-   about the strategy parameter.)
-
-     gzopen can be used to read a file which is not in gzip format; in this
-   case gzread will directly read from the file without decompression.
-
-     gzopen returns NULL if the file could not be opened or if there was
-   insufficient memory to allocate the (de)compression state; errno
-   can be checked to distinguish the two cases (if errno is zero, the
-   zlib error is Z_MEM_ERROR).  */
-
-ZEXTERN gzFile ZEXPORT gzdopen  OF((int fd, const char *mode));
-/*
-     gzdopen() associates a gzFile with the file descriptor fd.  File
-   descriptors are obtained from calls like open, dup, creat, pipe or
-   fileno (in the file has been previously opened with fopen).
-   The mode parameter is as in gzopen.
-     The next call of gzclose on the returned gzFile will also close the
-   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
-   descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
-     gzdopen returns NULL if there was insufficient memory to allocate
-   the (de)compression state.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
-     Dynamically update the compression level or strategy. See the description
-   of deflateInit2 for the meaning of these parameters.
-     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
-   opened for writing.
-*/
-
-ZEXTERN int ZEXPORT    gzread  OF((gzFile file, voidp buf, unsigned len));
-/*
-     Reads the given number of uncompressed bytes from the compressed file.
-   If the input file was not in gzip format, gzread copies the given number
-   of bytes into the buffer.
-     gzread returns the number of uncompressed bytes actually read (0 for
-   end of file, -1 for error). */
-
-ZEXTERN int ZEXPORT    gzwrite OF((gzFile file,
-                                   voidpc buf, unsigned len));
-/*
-     Writes the given number of uncompressed bytes into the compressed file.
-   gzwrite returns the number of uncompressed bytes actually written
-   (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
-/*
-     Converts, formats, and writes the args to the compressed file under
-   control of the format string, as in fprintf. gzprintf returns the number of
-   uncompressed bytes actually written (0 in case of error).  The number of
-   uncompressed bytes written is limited to 4095. The caller should assure that
-   this limit is not exceeded. If it is exceeded, then gzprintf() will return
-   return an error (0) with nothing written. In this case, there may also be a
-   buffer overflow with unpredictable consequences, which is possible only if
-   zlib was compiled with the insecure functions sprintf() or vsprintf()
-   because the secure snprintf() or vsnprintf() functions were not available.
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
-      Writes the given null-terminated string to the compressed file, excluding
-   the terminating null character.
-      gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
-      Reads bytes from the compressed file until len-1 characters are read, or
-   a newline character is read and transferred to buf, or an end-of-file
-   condition is encountered.  The string is then terminated with a null
-   character.
-      gzgets returns buf, or Z_NULL in case of error.
-*/
-
-ZEXTERN int ZEXPORT    gzputc OF((gzFile file, int c));
-/*
-      Writes c, converted to an unsigned char, into the compressed file.
-   gzputc returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT    gzgetc OF((gzFile file));
-/*
-      Reads one byte from the compressed file. gzgetc returns this byte
-   or -1 in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT    gzungetc OF((int c, gzFile file));
-/*
-      Push one character back onto the stream to be read again later.
-   Only one character of push-back is allowed.  gzungetc() returns the
-   character pushed, or -1 on failure.  gzungetc() will fail if a
-   character has been pushed but not read yet, or if c is -1. The pushed
-   character will be discarded if the stream is repositioned with gzseek()
-   or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
-/*
-     Flushes all pending output into the compressed file. The parameter
-   flush is as in the deflate() function. The return value is the zlib
-   error number (see function gzerror below). gzflush returns Z_OK if
-   the flush parameter is Z_FINISH and all output could be flushed.
-     gzflush should be called only when strictly necessary because it can
-   degrade compression.
-*/
-
-ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
-                                      z_off_t offset, int whence));
-/*
-      Sets the starting position for the next gzread or gzwrite on the
-   given compressed file. The offset represents a number of bytes in the
-   uncompressed data stream. The whence parameter is defined as in lseek(2);
-   the value SEEK_END is not supported.
-     If the file is opened for reading, this function is emulated but can be
-   extremely slow. If the file is opened for writing, only forward seeks are
-   supported; gzseek then compresses a sequence of zeroes up to the new
-   starting position.
-
-      gzseek returns the resulting offset location as measured in bytes from
-   the beginning of the uncompressed stream, or -1 in case of error, in
-   particular if the file is opened for writing and the new starting position
-   would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
-/*
-     Rewinds the given file. This function is supported only for reading.
-
-   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
-/*
-     Returns the starting position for the next gzread or gzwrite on the
-   given compressed file. This position represents a number of bytes in the
-   uncompressed data stream.
-
-   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
-     Returns 1 when EOF has previously been detected reading the given
-   input stream, otherwise zero.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
-     Returns 1 if file is being read directly without decompression, otherwise
-   zero.
-*/
-
-ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
-/*
-     Flushes all pending output if necessary, closes the compressed file
-   and deallocates all the (de)compression state. The return value is the zlib
-   error number (see function gzerror below).
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
-     Returns the error message for the last error which occurred on the
-   given compressed file. errnum is set to zlib error number. If an
-   error occurred in the file system and not in the compression library,
-   errnum is set to Z_ERRNO and the application may consult errno
-   to get the exact error code.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
-     Clears the error and end-of-file flags for file. This is analogous to the
-   clearerr() function in stdio. This is useful for continuing to read a gzip
-   file that is being written concurrently.
-*/
-
-                        /* checksum functions */
-
-/*
-     These functions are not related to compression but are exported
-   anyway because they might be useful in applications using the
-   compression library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
-     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
-   return the updated checksum. If buf is NULL, this function returns
-   the required initial value for the checksum.
-   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
-   much faster. Usage example:
-
-     uLong adler = adler32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       adler = adler32(adler, buffer, length);
-     }
-     if (adler != original_adler) error();
-*/
-
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
-                                          z_off_t len2));
-/*
-     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
-   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
-   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
-   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
-*/
-
-ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
-/*
-     Update a running CRC-32 with the bytes buf[0..len-1] and return the
-   updated CRC-32. If buf is NULL, this function returns the required initial
-   value for the for the crc. Pre- and post-conditioning (one's complement) is
-   performed within this function so it shouldn't be done by the application.
-   Usage example:
-
-     uLong crc = crc32(0L, Z_NULL, 0);
-
-     while (read_buffer(buffer, length) != EOF) {
-       crc = crc32(crc, buffer, length);
-     }
-     if (crc != original_crc) error();
-*/
-
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
-/*
-     Combine two CRC-32 check values into one.  For two sequences of bytes,
-   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
-   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
-   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
-   len2.
-*/
-
-
-                        /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
-                                     const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
-                                      int windowBits, int memLevel,
-                                      int strategy, const char *version,
-                                      int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
-                                      const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
-                                         unsigned char FAR *window,
-                                         const char *version,
-                                         int stream_size));
-#define deflateInit(strm, level) \
-        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
-        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
-        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
-                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
-        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
-        inflateBackInit_((strm), (windowBits), (window), \
-        ZLIB_VERSION, sizeof(z_stream))
-
-
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
-    struct internal_state {int dummy;}; /* hack for buggy compilers */
-#endif
-
-ZEXTERN const char   * ZEXPORT zError           OF((int));
-ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
diff --git a/ndk/NOTICE.zlib b/ndk/zlib/NOTICE
similarity index 94%
rename from ndk/NOTICE.zlib
rename to ndk/zlib/NOTICE
index 785e1e1..563ecdd 100644
--- a/ndk/NOTICE.zlib
+++ b/ndk/zlib/NOTICE
@@ -1,4 +1,4 @@
- (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ (C) 1995-2012 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
diff --git a/ndk/zlib/zconf.h b/ndk/zlib/zconf.h
new file mode 100644
index 0000000..55d46c1
--- /dev/null
+++ b/ndk/zlib/zconf.h
@@ -0,0 +1,506 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2012 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+#  define Z_PREFIX_SET
+
+/* all linked symbols */
+#  define _dist_code            z__dist_code
+#  define _length_code          z__length_code
+#  define _tr_align             z__tr_align
+#  define _tr_flush_block       z__tr_flush_block
+#  define _tr_init              z__tr_init
+#  define _tr_stored_block      z__tr_stored_block
+#  define _tr_tally             z__tr_tally
+#  define adler32               z_adler32
+#  define adler32_combine       z_adler32_combine
+#  define adler32_combine64     z_adler32_combine64
+#  ifndef Z_SOLO
+#    define compress              z_compress
+#    define compress2             z_compress2
+#    define compressBound         z_compressBound
+#  endif
+#  define crc32                 z_crc32
+#  define crc32_combine         z_crc32_combine
+#  define crc32_combine64       z_crc32_combine64
+#  define deflate               z_deflate
+#  define deflateBound          z_deflateBound
+#  define deflateCopy           z_deflateCopy
+#  define deflateEnd            z_deflateEnd
+#  define deflateInit2_         z_deflateInit2_
+#  define deflateInit_          z_deflateInit_
+#  define deflateParams         z_deflateParams
+#  define deflatePending        z_deflatePending
+#  define deflatePrime          z_deflatePrime
+#  define deflateReset          z_deflateReset
+#  define deflateResetKeep      z_deflateResetKeep
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateSetHeader      z_deflateSetHeader
+#  define deflateTune           z_deflateTune
+#  define deflate_copyright     z_deflate_copyright
+#  define get_crc_table         z_get_crc_table
+#  ifndef Z_SOLO
+#    define gz_error              z_gz_error
+#    define gz_intmax             z_gz_intmax
+#    define gz_strwinerror        z_gz_strwinerror
+#    define gzbuffer              z_gzbuffer
+#    define gzclearerr            z_gzclearerr
+#    define gzclose               z_gzclose
+#    define gzclose_r             z_gzclose_r
+#    define gzclose_w             z_gzclose_w
+#    define gzdirect              z_gzdirect
+#    define gzdopen               z_gzdopen
+#    define gzeof                 z_gzeof
+#    define gzerror               z_gzerror
+#    define gzflush               z_gzflush
+#    define gzgetc                z_gzgetc
+#    define gzgetc_               z_gzgetc_
+#    define gzgets                z_gzgets
+#    define gzoffset              z_gzoffset
+#    define gzoffset64            z_gzoffset64
+#    define gzopen                z_gzopen
+#    define gzopen64              z_gzopen64
+#    ifdef _WIN32
+#      define gzopen_w              z_gzopen_w
+#    endif
+#    define gzprintf              z_gzprintf
+#    define gzputc                z_gzputc
+#    define gzputs                z_gzputs
+#    define gzread                z_gzread
+#    define gzrewind              z_gzrewind
+#    define gzseek                z_gzseek
+#    define gzseek64              z_gzseek64
+#    define gzsetparams           z_gzsetparams
+#    define gztell                z_gztell
+#    define gztell64              z_gztell64
+#    define gzungetc              z_gzungetc
+#    define gzwrite               z_gzwrite
+#  endif
+#  define inflate               z_inflate
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define inflateBackInit_      z_inflateBackInit_
+#  define inflateCopy           z_inflateCopy
+#  define inflateEnd            z_inflateEnd
+#  define inflateGetHeader      z_inflateGetHeader
+#  define inflateInit2_         z_inflateInit2_
+#  define inflateInit_          z_inflateInit_
+#  define inflateMark           z_inflateMark
+#  define inflatePrime          z_inflatePrime
+#  define inflateReset          z_inflateReset
+#  define inflateReset2         z_inflateReset2
+#  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateSync           z_inflateSync
+#  define inflateSyncPoint      z_inflateSyncPoint
+#  define inflateUndermine      z_inflateUndermine
+#  define inflateResetKeep      z_inflateResetKeep
+#  define inflate_copyright     z_inflate_copyright
+#  define inflate_fast          z_inflate_fast
+#  define inflate_table         z_inflate_table
+#  ifndef Z_SOLO
+#    define uncompress            z_uncompress
+#  endif
+#  define zError                z_zError
+#  ifndef Z_SOLO
+#    define zcalloc               z_zcalloc
+#    define zcfree                z_zcfree
+#  endif
+#  define zlibCompileFlags      z_zlibCompileFlags
+#  define zlibVersion           z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+#  define Byte                  z_Byte
+#  define Bytef                 z_Bytef
+#  define alloc_func            z_alloc_func
+#  define charf                 z_charf
+#  define free_func             z_free_func
+#  ifndef Z_SOLO
+#    define gzFile                z_gzFile
+#  endif
+#  define gz_header             z_gz_header
+#  define gz_headerp            z_gz_headerp
+#  define in_func               z_in_func
+#  define intf                  z_intf
+#  define out_func              z_out_func
+#  define uInt                  z_uInt
+#  define uIntf                 z_uIntf
+#  define uLong                 z_uLong
+#  define uLongf                z_uLongf
+#  define voidp                 z_voidp
+#  define voidpc                z_voidpc
+#  define voidpf                z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+#  define gz_header_s           z_gz_header_s
+#  define internal_state        z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+#  define z_const const
+#else
+#  define z_const
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#  define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+#ifndef Z_ARG /* function prototypes for stdarg */
+#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
+#    define Z_ARG(args)  args
+#  else
+#    define Z_ARG(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+typedef unsigned long  uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#define Z_U4 unsigned   /* ./configure put the #define Z_U4 here */
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+#  include <limits.h>
+#  if (UINT_MAX == 0xffffffffUL)
+#    define Z_U4 unsigned
+#  else
+#    if (ULONG_MAX == 0xffffffffUL)
+#      define Z_U4 unsigned long
+#    else
+#      if (USHRT_MAX == 0xffffffffUL)
+#        define Z_U4 unsigned short
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef Z_U4
+   typedef Z_U4 z_crc_t;
+#else
+   typedef unsigned long z_crc_t;
+#endif
+
+#if 1    /* was set to #if 1 by ./configure */
+#  define Z_HAVE_UNISTD_H
+#endif
+
+#if 1    /* was set to #if 1 by ./configure */
+#  define Z_HAVE_STDARG_H
+#endif
+
+#ifdef STDC
+#  ifndef Z_SOLO
+#    include <sys/types.h>      /* for off_t */
+#  endif
+#endif
+
+#ifdef _WIN32
+#  include <stddef.h>           /* for wchar_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+#  undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+#  define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+#  if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE)
+#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+#    ifdef VMS
+#      include <unixio.h>       /* for off_t */
+#    endif
+#    ifndef z_off_t
+#      define z_off_t off_t
+#    endif
+#  endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+#  define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+#  define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+#  define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+#  define z_off64_t off64_t
+#else
+#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+#    define z_off64_t __int64
+#  else
+#    define z_off64_t z_off_t
+#  endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+  #pragma map(deflateInit_,"DEIN")
+  #pragma map(deflateInit2_,"DEIN2")
+  #pragma map(deflateEnd,"DEEND")
+  #pragma map(deflateBound,"DEBND")
+  #pragma map(inflateInit_,"ININ")
+  #pragma map(inflateInit2_,"ININ2")
+  #pragma map(inflateEnd,"INEND")
+  #pragma map(inflateSync,"INSY")
+  #pragma map(inflateSetDictionary,"INSEDI")
+  #pragma map(compressBound,"CMBND")
+  #pragma map(inflate_table,"INTABL")
+  #pragma map(inflate_fast,"INFA")
+  #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/ndk/zlib/zlib.h b/ndk/zlib/zlib.h
new file mode 100644
index 0000000..3edf3ac
--- /dev/null
+++ b/ndk/zlib/zlib.h
@@ -0,0 +1,1744 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.7, May 2nd, 2012
+
+  Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.7"
+#define ZLIB_VERNUM 0x1270
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 7
+#define ZLIB_VER_SUBREVISION 0
+
+/*
+    The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed data.
+  This version of the library supports only one compression method (deflation)
+  but other algorithms will be added later and will have the same stream
+  interface.
+
+    Compression can be done in a single step if the buffers are large enough,
+  or can be done by repeated calls of the compression function.  In the latter
+  case, the application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+    The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+    The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+    This library can optionally read and write gzip streams in memory as well.
+
+    The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+    The library does not install any signal handler.  The decoder checks
+  the consistency of the compressed data, so the library should never crash
+  even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    z_const Bytef *next_in;     /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total number of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte should be put there */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total number of bytes output so far */
+
+    z_const char *msg;  /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text */
+    uLong   adler;      /* adler32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+     The application must update next_in and avail_in when avail_in has dropped
+   to zero.  It must update next_out and avail_out when avail_out has dropped
+   to zero.  The application must initialize zalloc, zfree and opaque before
+   calling the init function.  All other fields are set by the compression
+   library and must not be updated by the application.
+
+     The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree.  This can be useful for custom
+   memory management.  The compression library attaches no meaning to the
+   opaque value.
+
+     zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.
+
+     On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this if
+   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers
+   returned by zalloc for objects of exactly 65536 bytes *must* have their
+   offset normalized to zero.  The default allocation function provided by this
+   library ensures this (see zutil.c).  To reduce memory requirements and avoid
+   any allocation of 64K objects, at the expense of compression ratio, compile
+   the library with -DMAX_WBITS=14 (see zconf.h).
+
+     The fields total_in and total_out can be used for statistics or progress
+   reports.  After compression, total_in holds the total size of the
+   uncompressed data and may be saved for use in the decompressor (particularly
+   if the decompressor wants to decompress everything in a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+#define Z_TREES         6
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is not
+   compatible with the zlib.h header file used by the application.  This check
+   is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression.  The fields
+   zalloc, zfree and opaque must be initialized before by the caller.  If
+   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+   allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at all
+   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION
+   requests a default compromise between speed and compression (currently
+   equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if level is not a valid compression level, or
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null
+   if there is no error message.  deflateInit does not perform any compression:
+   this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows.  deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary (in interactive applications).  Some
+    output may be provided even if flush is not set.
+
+    Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating avail_in or avail_out accordingly; avail_out should
+  never be zero before the call.  The application can consume the compressed
+  output when it wants, for example when the output buffer is full (avail_out
+  == 0), or after each call of deflate().  If deflate returns Z_OK and with
+  zero avail_out, it must be called again after making room in the output
+  buffer because there might be more output pending.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumulate before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far.  (In
+  particular avail_in is zero after the call if enough output space has been
+  provided before the call.) Flushing may degrade compression for some
+  compression algorithms and so it should be used only when necessary.  This
+  completes the current deflate block and follows it with an empty stored block
+  that is three bits plus filler bits to the next byte, followed by four bytes
+  (00 00 ff ff).
+
+    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+  output buffer, but the output is not aligned to a byte boundary.  All of the
+  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+  This completes the current deflate block and follows it with an empty fixed
+  codes block that is 10 bits long.  This assures that enough bytes are output
+  in order for the decompressor to finish the block before the empty fixed code
+  block.
+
+    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+  seven bits of the current block are held to be written as the next byte after
+  the next deflate block is completed.  In this case, the decompressor may not
+  be provided enough bits at this point in order to complete decompression of
+  the data provided so far to the compressor.  It may need to wait for the next
+  block to be emitted.  This is for advanced applications that need to control
+  the emission of deflate blocks.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there was
+  enough output space; if deflate returns with Z_OK, this function must be
+  called again with Z_FINISH and more output space (updated avail_out) but no
+  more input data, until it returns with Z_STREAM_END or an error.  After
+  deflate has returned Z_STREAM_END, the only possible operations on the stream
+  are deflateReset or deflateEnd.
+
+    Z_FINISH can be used immediately after deflateInit if all the compression
+  is to be done in a single step.  In this case, avail_out must be at least the
+  value returned by deflateBound (see below).  Then deflate is guaranteed to
+  return Z_STREAM_END.  If not enough output space is provided, deflate will
+  not return Z_STREAM_END, and it must be called again as described above.
+
+    deflate() sets strm->adler to the adler32 checksum of all input read
+  so far (that is, total_in bytes).
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered
+  binary.  This field is only for information purposes and does not affect the
+  compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
+  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not
+  fatal, and deflate() can be called again with more input and more output
+  space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded).  In the error case, msg
+   may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression.  The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller.  If next_in is not Z_NULL and avail_in is large enough (the
+   exact value depends on the compression method), inflateInit determines the
+   compression method from the zlib header and allocates all data structures
+   accordingly; otherwise the allocation will be deferred to the first call of
+   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+   use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit() does not process any header information -- that is deferred
+   until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full.  It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows.  inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly.  If not all input can be processed (because there is not
+    enough room in the output buffer), next_in is updated and processing will
+    resume at this point for the next call of inflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there is
+    no more input data or no more space in the output buffer (see below about
+    the flush parameter).
+
+    Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming more
+  output, and updating the next_* and avail_* values accordingly.  The
+  application can consume the uncompressed output when it wants, for example
+  when the output buffer is full (avail_out == 0), or after each call of
+  inflate().  If inflate returns Z_OK and with zero avail_out, it must be
+  called again after making room in the output buffer because there might be
+  more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer.  Z_BLOCK requests that inflate()
+  stop if and when it gets to the next deflate block boundary.  When decoding
+  the zlib or gzip format, this will cause inflate() to return immediately
+  after the header and before the first block.  When doing a raw inflate,
+  inflate() will go ahead and process the first block, and will return when it
+  gets to the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  Also to assist in this, on return inflate() will set strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64 if
+  inflate() is currently decoding the last block in the deflate stream, plus
+  128 if inflate() returned immediately after decoding an end-of-block code or
+  decoding the complete header up to just before the first byte of the deflate
+  stream.  The end-of-block will not be indicated until all of the uncompressed
+  data from that block has been written to strm->next_out.  The number of
+  unused bits may in general be greater than seven, except when bit 7 of
+  data_type is set, in which case the number of unused bits will be less than
+  eight.  data_type is set as noted here every time inflate() returns for all
+  flush options, and so can be used to determine the amount of currently
+  consumed input in bits.
+
+    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+  end of each deflate block header is reached, before any actual data in that
+  block is decoded.  This allows the caller to determine the length of the
+  deflate block header for later use in random access within a deflate block.
+  256 is added to the value of strm->data_type when inflate() returns
+  immediately after reaching the end of the deflate block header.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error.  However if all decompression is to be performed in a single step (a
+  single call of inflate), the parameter flush should be set to Z_FINISH.  In
+  this case all pending input is processed and all pending output is flushed;
+  avail_out must be large enough to hold all of the uncompressed data for the
+  operation to complete.  (The size of the uncompressed data may have been
+  saved by the compressor for this purpose.) The use of Z_FINISH is not
+  required to perform an inflation in one step.  However it may be used to
+  inform inflate that a faster approach can be used for the single inflate()
+  call.  Z_FINISH also informs inflate to not maintain a sliding window if the
+  stream completes, which reduces inflate's memory footprint.  If the stream
+  does not complete, either because not all of the stream is provided or not
+  enough output space is provided, then a sliding window will be allocated and
+  inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+  been used.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call.  So the effects of the flush parameter in this implementation are
+  on the return value of inflate() as noted below, when inflate() returns early
+  when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+  memory for a sliding window when Z_FINISH is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the Adler-32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below.  At the end of the stream, inflate() checks that its computed adler32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically, if requested when
+  initializing with inflateInit2().  Any information contained in the gzip
+  header is not retained, so applications that need that information should
+  instead use raw inflate, see inflateInit2() below, or inflateBack() and
+  perform their own processing of the gzip header and trailer.  When processing
+  gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+  producted so far.  The CRC-32 is checked against the gzip trailer.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
+  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing.  If Z_DATA_ERROR is returned, the application may
+  then call inflateSync() to look for a good compression block if a partial
+  recovery of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any pending
+   output.
+
+     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+   was inconsistent.  In the error case, msg may be set but then points to a
+   static string (which must not be deallocated).
+*/
+
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options.  The
+   fields next_in, zalloc, zfree and opaque must be initialized before by the
+   caller.
+
+     The method parameter is the compression method.  It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer).  It should be in the range 8..15 for this
+   version of the library.  Larger values of this parameter result in better
+   compression at the expense of memory usage.  The default value is 15 if
+   deflateInit is used instead.
+
+     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
+   determines the window size.  deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute an adler32 check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding.  Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper.  The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero), no
+   header crc, and the operating system will be set to 255 (unknown).  If a
+   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state.  memLevel=1 uses minimum memory but is
+   slow and reduces compression ratio; memLevel=9 uses maximum memory for
+   optimal speed.  The default value is 8.  See zconf.h for total memory usage
+   as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm.  Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding).  Filtered data consists mostly of small values with a somewhat
+   random distribution.  In this case, the compression algorithm is tuned to
+   compress them better.  The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as
+   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The
+   strategy parameter only affects the compression ratio but not the
+   correctness of the compressed output even if it is not set appropriately.
+   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+   decoder for special applications.
+
+     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is
+   set to null if there is no error message.  deflateInit2 does not perform any
+   compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output.  When using the zlib format, this
+   function must be called immediately after deflateInit, deflateInit2 or
+   deflateReset, and before any call of deflate.  When doing raw deflate, this
+   function must be called either before any call of deflate, or immediately
+   after the completion of a deflate block, i.e. after all input has been
+   consumed and all output has been delivered when using any of the flush
+   options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The
+   compressor and decompressor must use exactly the same dictionary (see
+   inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary.  Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size
+   provided in deflateInit or deflateInit2.  Thus the strings most likely to be
+   useful should be put at the end of the dictionary, not at the front.  In
+   addition, the current implementation of deflate will use at most the window
+   size minus 262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the adler32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor.  (The adler32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   adler32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if not at a block boundary for raw deflate).  deflateSetDictionary does
+   not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter.  The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and can
+   consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit,
+   but does not free and reallocate all the internal compression state.  The
+   stream will keep the same compression level and any other attributes that
+   may have been set by deflateInit2.
+
+     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2.  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different strategy.
+   If the compression level is changed, the input available so far is
+   compressed with the old level (and may be flushed); the new level will take
+   effect only at the next call of deflate().
+
+     Before the call of deflateParams, the stream state must be set as for
+   a call of deflate(), since the currently available input may have to be
+   compressed and flushed.  In particular, strm->avail_out must be non-zero.
+
+     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
+   strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit() or
+   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
+   to allocate an output buffer for deflation in a single pass, and so would be
+   called before deflate().  If that first deflate() call is provided the
+   sourceLen input bytes, an output buffer allocated to the size returned by
+   deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+   to return Z_STREAM_END.  Note that it is possible for the compressed size to
+   be larger than the value returned by deflateBound() if flush options other
+   than Z_FINISH or Z_NO_FLUSH are used.
+*/
+
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+                                       unsigned *pending,
+                                       int *bits));
+/*
+     deflatePending() returns the number of bytes and bits of output that have
+   been generated, but not yet provided in the available output.  The bytes not
+   provided would be due to the available output space having being consumed.
+   The number of bits of output not provided are between 0 and 7, where they
+   await more bits to join them in order to fill out a full byte.  If pending
+   or bits are Z_NULL, then those values are not set.
+
+     deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+ */
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+   is that this function is used to start off the deflate output with the bits
+   leftover from a previous deflate stream when appending to it.  As such, this
+   function can only be used for raw deflate, and must be used before the first
+   deflate() call after a deflateInit2() or deflateReset().  bits must be less
+   than or equal to 16, and that many of the least significant bits of value
+   will be inserted in the output.
+
+     deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+   room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+     If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter.  The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library.  The default value is 15 if inflateInit is used
+   instead.  windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used.  If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be zero to request that inflate use the window size in
+   the zlib header of the compressed stream.
+
+     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits
+   determines the window size.  inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream.  This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values.  If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an adler32 or a crc32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is.  Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding.  Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a
+   crc32 instead of an adler32.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message.  inflateInit2 does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.) The current implementation
+   of inflateInit2() does not process any header information -- that is
+   deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence.  This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor
+   can be determined from the adler32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called at any
+   time to set the dictionary.  If the provided dictionary is smaller than the
+   window and there is already data in the window, then the provided dictionary
+   will amend what's there.  The application must insure that the dictionary
+   that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect adler32 value).  inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+     Skips invalid compressed data until a possible full flush point (see above
+   for the description of deflate with Z_FULL_FLUSH) can be found, or until all
+   available input is skipped.  No output is provided.
+
+     inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+   All full flush points have this pattern, but not all occurences of this
+   pattern are full flush points.
+
+     inflateSync returns Z_OK if a possible full flush point has been found,
+   Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+   has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+   In the success case, the application may save the current current value of
+   total_in which indicates where valid compressed data was found.  In the
+   error case, the application may repeatedly call inflateSync, providing more
+   input each time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being Z_NULL).  msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate all the internal decompression state.  The
+   stream will keep attributes that may have been set by inflateInit2.
+
+     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+                                      int windowBits));
+/*
+     This function is the same as inflateReset, but it also permits changing
+   the wrap and window size requests.  The windowBits parameter is interpreted
+   the same as it is for inflateInit2.
+
+     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+   the windowBits parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+   that this function is used to start inflating at a bit position in the
+   middle of a byte.  The provided bits will be used before any bytes are used
+   from next_in.  This function should only be used with raw inflate, and
+   should be used before the first inflate() call after inflateInit2() or
+   inflateReset().  bits must be less than or equal to 16, and that many of the
+   least significant bits of value will be inserted in the input.
+
+     If bits is negative, then the input stream bit buffer is emptied.  Then
+   inflatePrime() can be called again to put bits in the buffer.  This is used
+   to clear out bits leftover after feeding inflate a block description prior
+   to feeding inflate codes.
+
+     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+     This function returns two values, one in the lower 16 bits of the return
+   value, and the other in the remaining upper bits, obtained by shifting the
+   return value down 16 bits.  If the upper value is -1 and the lower value is
+   zero, then inflate() is currently decoding information outside of a block.
+   If the upper value is -1 and the lower value is non-zero, then inflate is in
+   the middle of a stored block, with the lower value equaling the number of
+   bytes from the input remaining to copy.  If the upper value is not -1, then
+   it is the number of bits back from the current bit position in the input of
+   the code (literal or length/distance pair) currently being processed.  In
+   that case the lower value is the number of bytes already emitted for that
+   code.
+
+     A code is being processed if inflate is waiting for more input to complete
+   decoding of the code, or if it has completed decoding but is waiting for
+   more output space to write the literal or match data.
+
+     inflateMark() is used to mark locations in the input data for random
+   access, which may be at bit positions, and to note those cases where the
+   output of a code may span boundaries of random access blocks.  The current
+   location in the input stream can be determined from avail_in and data_type
+   as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+     inflateMark returns the value noted above or -1 << 16 if the provided
+   source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+     inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
+   used to force inflate() to return immediately after header processing is
+   complete and before any actual data is decompressed.
+
+     The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When any
+   of extra, name, or comment are not Z_NULL and the respective field is not
+   present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+     If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the parameters are invalid, Z_MEM_ERROR if the internal state could not be
+   allocated, or Z_VERSION_ERROR if the version of the library does not match
+   the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is more efficient than inflate() for
+   file i/o applications in that it avoids copying between the output and the
+   sliding window by simply making the window itself the output buffer.  This
+   function trusts the application to not change the output buffer passed by
+   the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free the
+   allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects only
+   the raw deflate stream to decompress.  This is different from the normal
+   behavior of inflate(), which expects either a zlib or gzip header and
+   trailer around the deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero--buf is ignored in that
+   case--and inflateBack() will return a buffer error.  inflateBack() will call
+   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
+   should return zero on success, or non-zero on failure.  If out() returns
+   non-zero, inflateBack() will return with an error.  Neither in() nor out()
+   are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+   in the deflate stream (in which case strm->msg is set to indicate the nature
+   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+   In the case of Z_BUF_ERROR, an input or output error can be distinguished
+   using strm->next_in which will be Z_NULL only if in() returned an error.  If
+   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+   non-zero.  (in() will always be called before out(), so strm->next_in is
+   assured to be defined if out() returns non-zero.) Note that inflateBack()
+   cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+#ifndef Z_SOLO
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the basic
+   stream-oriented functions.  To simplify the interface, some default options
+   are assumed (compression level and memory usage, standard memory allocation
+   functions).  The source code of these utility functions can be modified if
+   you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer.  The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer.  Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen).  Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before a
+   compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer.  Upon entry, destLen is the total size
+   of the destination buffer, which must be large enough to hold the entire
+   uncompressed data.  (The size of the uncompressed data must have been saved
+   previously by the compressor and transmitted to the decompressor by some
+   mechanism outside the scope of this compression library.) Upon exit, destLen
+   is the actual size of the uncompressed buffer.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In
+   the case where there is not enough room, uncompress() will fill the output
+   buffer with the uncompressed data up to that point.
+*/
+
+                        /* gzip file access functions */
+
+/*
+     This library supports reading and writing files in gzip (.gz) format with
+   an interface similar to that of stdio, using the functions that start with
+   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
+   wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
+   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+   for fixed code compression as in "wb9F".  (See the description of
+   deflateInit2 for more information about the strategy parameter.)  'T' will
+   request transparent writing or appending with no compression and not using
+   the gzip format.
+
+     "a" can be used instead of "w" to request that the gzip stream that will
+   be written be appended to the file.  "+" will result in an error, since
+   reading and writing to the same gzip file is not supported.  The addition of
+   "x" when writing will create the file exclusively, which fails if the file
+   already exists.  On systems that support it, the addition of "e" when
+   reading or writing will set the flag to close the file on an execve() call.
+
+     These functions, as well as gzip, will read and decode a sequence of gzip
+   streams in a file.  The append function of gzopen() can be used to create
+   such a file.  (Also see gzflush() for another way to do this.)  When
+   appending, gzopen does not test whether the file begins with a gzip stream,
+   nor does it look for the end of the gzip streams to begin appending.  gzopen
+   will simply append a gzip stream to the existing file.
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.  When
+   reading, this will be detected automatically by looking for the magic two-
+   byte gzip header.
+
+     gzopen returns NULL if the file could not be opened, if there was
+   insufficient memory to allocate the gzFile state, or if an invalid mode was
+   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+   errno can be checked to determine if the reason gzopen failed was that the
+   file could not be opened.
+*/
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+     gzdopen associates a gzFile with the file descriptor fd.  File descriptors
+   are obtained from calls like open, dup, creat, pipe or fileno (if the file
+   has been previously opened with fopen).  The mode parameter is as in gzopen.
+
+     The next call of gzclose on the returned gzFile will also close the file
+   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+   mode);.  The duplicated descriptor should be saved to avoid a leak, since
+   gzdopen does not close fd if it fails.  If you are using fileno() to get the
+   file descriptor from a FILE *, then you will have to use dup() to avoid
+   double-close()ing the file descriptor.  Both gzclose() and fclose() will
+   close the associated file descriptor, so they need to have different file
+   descriptors.
+
+     gzdopen returns NULL if there was insufficient memory to allocate the
+   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+   provided, or '+' was provided), or if fd is -1.  The file descriptor is not
+   used until the next gz* read, write, seek, or close operation, so gzdopen
+   will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+     Set the internal buffer size used by this library's functions.  The
+   default buffer size is 8192 bytes.  This function must be called after
+   gzopen() or gzdopen(), and before any other calls that read or write the
+   file.  The buffer memory allocation is always deferred to the first read or
+   write.  Two buffers are allocated, either both of the specified size when
+   writing, or one of the specified size and the other twice that size when
+   reading.  A larger buffer size of, for example, 64K or 128K bytes will
+   noticeably increase the speed of decompression (reading).
+
+     The new buffer size also affects the maximum length for gzprintf().
+
+     gzbuffer() returns 0 on success, or -1 on failure, such as being called
+   too late.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy.  See the description
+   of deflateInit2 for the meaning of these parameters.
+
+     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+   opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.  If
+   the input file is not in gzip format, gzread copies the given number of
+   bytes into the buffer directly from the file.
+
+     After reaching the end of a gzip stream in the input, gzread will continue
+   to read, looking for another gzip stream.  Any number of gzip streams may be
+   concatenated in the input file, and will all be decompressed by gzread().
+   If something other than a gzip stream is encountered after a gzip stream,
+   that remaining trailing garbage is ignored (and no error is returned).
+
+     gzread can be used to read a gzip file that is being concurrently written.
+   Upon reaching the end of the input, gzread will return with the available
+   data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+   gzclearerr can be used to clear the end of file indicator in order to permit
+   gzread to be tried again.  Z_OK indicates that a gzip stream was completed
+   on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the
+   middle of a gzip stream.  Note that gzread does not return -1 in the event
+   of an incomplete gzip stream.  This error is deferred until gzclose(), which
+   will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+   stream.  Alternatively, gzerror can be used before gzclose to detect this
+   case.
+
+     gzread returns the number of uncompressed bytes actually read, less than
+   len for end of file, or -1 for error.
+*/
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+                                voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes written or 0 in case of
+   error.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the arguments to the compressed file under
+   control of the format string, as in fprintf.  gzprintf returns the number of
+   uncompressed bytes actually written, or 0 in case of error.  The number of
+   uncompressed bytes written is limited to 8191, or one less than the buffer
+   size given to gzbuffer().  The caller should assure that this limit is not
+   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with
+   nothing written.  In this case, there may also be a buffer overflow with
+   unpredictable consequences, which is possible only if zlib was compiled with
+   the insecure functions sprintf() or vsprintf() because the secure snprintf()
+   or vsnprintf() functions were not available.  This can be determined using
+   zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+     Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+
+     gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+     Reads bytes from the compressed file until len-1 characters are read, or a
+   newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  If any characters are read or if len == 1, the
+   string is terminated with a null character.  If no characters are read due
+   to an end-of-file or len < 1, then the buffer is left untouched.
+
+     gzgets returns buf which is a null-terminated string, or it returns NULL
+   for end-of-file or in case of error.  If there was an error, the contents at
+   buf are indeterminate.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+     Writes c, converted to an unsigned char, into the compressed file.  gzputc
+   returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+     Reads one byte from the compressed file.  gzgetc returns this byte or -1
+   in case of end of file or error.  This is implemented as a macro for speed.
+   As such, it does not do all of the checking the other functions do.  I.e.
+   it does not check to see if file is NULL, nor whether the structure file
+   points to has been clobbered or not.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+     Push one character back onto the stream to be read as the first character
+   on the next read.  At least one character of push-back is allowed.
+   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will
+   fail if c is -1, and may fail if a character has been pushed but not read
+   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the
+   output buffer size of pushed characters is allowed.  (See gzbuffer above.)
+   The pushed character will be discarded if the stream is repositioned with
+   gzseek() or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file.  The parameter flush
+   is as in the deflate() function.  The return value is the zlib error number
+   (see function gzerror below).  gzflush is only permitted when writing.
+
+     If the flush parameter is Z_FINISH, the remaining data is written and the
+   gzip stream is completed in the output.  If gzwrite() is called again, a new
+   gzip stream will be started in the output.  gzread() is able to read such
+   concatented gzip streams.
+
+     gzflush should be called only when strictly necessary because it will
+   degrade compression if called too often.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+                                   z_off_t offset, int whence));
+
+     Sets the starting position for the next gzread or gzwrite on the given
+   compressed file.  The offset represents a number of bytes in the
+   uncompressed data stream.  The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow.  If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+     gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+
+     Returns the starting position for the next gzread or gzwrite on the given
+   compressed file.  This position represents a number of bytes in the
+   uncompressed data stream, and is zero when starting, even if appending or
+   reading a gzip stream from the middle of a file using gzdopen().
+
+     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+     Returns the current offset in the file being read or written.  This offset
+   includes the count of bytes that precede the gzip stream, for example when
+   appending or when using gzdopen() for reading.  When reading, the offset
+   does not include as yet unused buffered input.  This information can be used
+   for a progress indicator.  On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns true (1) if the end-of-file indicator has been set while reading,
+   false (0) otherwise.  Note that the end-of-file indicator is set only if the
+   read tried to go past the end of the input, but came up short.  Therefore,
+   just like feof(), gzeof() may return false even if there is no more data to
+   read, in the event that the last read request was for the exact number of
+   bytes remaining in the input file.  This will happen if the input file size
+   is an exact multiple of the buffer size.
+
+     If gzeof() returns true, then the read functions will return no more data,
+   unless the end-of-file indicator is reset by gzclearerr() and the input file
+   has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns true (1) if file is being copied directly while reading, or false
+   (0) if file is a gzip stream being decompressed.
+
+     If the input file is empty, gzdirect() will return true, since the input
+   does not contain a gzip stream.
+
+     If gzdirect() is used immediately after gzopen() or gzdopen() it will
+   cause buffers to be allocated to allow reading the file to determine if it
+   is a gzip file.  Therefore if gzbuffer() is used, it should be called before
+   gzdirect().
+
+     When writing, gzdirect() returns true (1) if transparent writing was
+   requested ("wT" for the gzopen() mode), or false (0) otherwise.  (Note:
+   gzdirect() is not needed when writing.  Transparent writing must be
+   explicitly requested, so the application already knows the answer.  When
+   linking statically, using gzdirect() will include all of the zlib code for
+   gzip file reading and decompression, which may not be desired.)
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file and
+   deallocates the (de)compression state.  Note that once file is closed, you
+   cannot call gzerror with file, since its structures have been deallocated.
+   gzclose must not be called more than once on the same file, just as free
+   must not be called more than once on the same allocation.
+
+     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+   file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+   last read ended in the middle of a gzip stream, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+     Same as gzclose(), but gzclose_r() is only for use when reading, and
+   gzclose_w() is only for use when writing or appending.  The advantage to
+   using these instead of gzclose() is that they avoid linking in zlib
+   compression or decompression code that is not used when only reading or only
+   writing respectively.  If gzclose() is used, then both compression and
+   decompression code will be included the application when linking to a static
+   zlib library.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the given
+   compressed file.  errnum is set to zlib error number.  If an error occurred
+   in the file system and not in the compression library, errnum is set to
+   Z_ERRNO and the application may consult errno to get the exact error code.
+
+     The application must not modify the returned string.  Future calls to
+   this function may invalidate the previously returned string.  If file is
+   closed, then the string previously returned by gzerror will no longer be
+   available.
+
+     gzerror() should be used to distinguish errors from end-of-file for those
+   functions above that do not distinguish those cases in their return values.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file.  This is analogous to the
+   clearerr() function in stdio.  This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+#endif /* !Z_SOLO */
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the compression
+   library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum.  If buf is Z_NULL, this function returns the
+   required initial value for the checksum.
+
+     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster.
+
+   Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note
+   that the z_off_t type (like off_t) is a signed integer.  If len2 is
+   negative, the result has no meaning or utility.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32.  If buf is Z_NULL, this function returns the required
+   initial value for the crc.  Pre- and post-conditioning (one's complement) is
+   performed within this function so it shouldn't be done by the application.
+
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#define deflateInit(strm, level) \
+        deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit(strm) \
+        inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                      (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+                      (int)sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+        inflateBackInit_((strm), (windowBits), (window), \
+                      ZLIB_VERSION, (int)sizeof(z_stream))
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure.  Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro.  The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously.  They can
+ * only be used by the gzgetc() macro.  You have been warned.
+ */
+struct gzFile_s {
+    unsigned have;
+    unsigned char *next;
+    z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
+#ifdef Z_PREFIX_SET
+#  undef z_gzgetc
+#  define z_gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#else
+#  define gzgetc(g) \
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#endif
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#ifdef Z_LARGE64
+   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+#  ifdef Z_PREFIX_SET
+#    define z_gzopen z_gzopen64
+#    define z_gzseek z_gzseek64
+#    define z_gztell z_gztell64
+#    define z_gzoffset z_gzoffset64
+#    define z_adler32_combine z_adler32_combine64
+#    define z_crc32_combine z_crc32_combine64
+#  else
+#    define gzopen gzopen64
+#    define gzseek gzseek64
+#    define gztell gztell64
+#    define gzoffset gzoffset64
+#    define adler32_combine adler32_combine64
+#    define crc32_combine crc32_combine64
+#  endif
+#  ifndef Z_LARGE64
+     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+#  endif
+#else
+   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+#else /* Z_SOLO */
+
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+
+#endif /* !Z_SOLO */
+
+/* hack for buggy compilers */
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+    struct internal_state {int dummy;};
+#endif
+
+/* undocumented functions */
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
+ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
+                                            const char *mode));
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/python-packages/adb/.gitignore b/python-packages/adb/.gitignore
new file mode 100644
index 0000000..894a44c
--- /dev/null
+++ b/python-packages/adb/.gitignore
@@ -0,0 +1,104 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# pyenv
+.python-version
+
+# celery beat schedule file
+celerybeat-schedule
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
diff --git a/samples/BluetoothHDP/Android.mk b/samples/BluetoothHDP/Android.mk
deleted file mode 100644
index 3c7c49f..0000000
--- a/samples/BluetoothHDP/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := samples
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := BluetoothHDP
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_PACKAGE)
-
-# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/BluetoothHDP/AndroidManifest.xml b/samples/BluetoothHDP/AndroidManifest.xml
deleted file mode 100644
index 21723d1..0000000
--- a/samples/BluetoothHDP/AndroidManifest.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.example.bluetooth.health"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <uses-sdk android:minSdkVersion="14"
-              android:targetSdkVersion="14" />
-    <uses-permission android:name="android.permission.BLUETOOTH" />
-
-    <application android:icon="@drawable/icon" android:label="@string/app_name">
-        <activity android:name=".BluetoothHDPActivity"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-        <service android:name=".BluetoothHDPService" />
-    </application>
-</manifest>
diff --git a/samples/BluetoothHDP/_index.jd b/samples/BluetoothHDP/_index.jd
deleted file mode 100644
index 526e318..0000000
--- a/samples/BluetoothHDP/_index.jd
+++ /dev/null
@@ -1,16 +0,0 @@
-page.tags="Bluetooth", "HDP", "Health"
-sample.group=Connectivity
-@jd:body
-
-<p>A sample application that demonstrates how to communicate with a Bluetooth Health Device Profile (HDP) device.  This feature is available on Android 4.0 (API level 14) or above platforms. The Android Bluetooth Health API lets you create
-applications that use Bluetooth to communicate with health devices that support
-Bluetooth, such as heart-rate monitors, blood meters, thermometers, scales, and
-so on. For a list of supported devices and their corresponding device data
-specialization codes, refer to <strong>Bluetooth Assigned Numbers</strong> at <a
-href="http://www.bluetooth.org">www.bluetooth.org</a>. Note that these values
-are also referenced in the ISO/IEEE 11073-20601 [7] specification as
-MDC_DEV_SPEC_PROFILE_* in the Nomenclature Codes Annex.</p>
-
-<p>The application manages connection with Bluetooth HDP-enabled devices.  Possible device type include blood pressure monitor, glucose meter, thermometer, etc.  Upon connection, the application retrieves raw data sent from the device.  Note that in order to interpret the data, a parser that conforms to the IEEE 11073-xxxxx specifications would be required.</p>
-
-<img alt="" src="../images/BluetoothHDP.png" />
\ No newline at end of file
diff --git a/samples/BluetoothHDP/res/drawable-hdpi/icon.png b/samples/BluetoothHDP/res/drawable-hdpi/icon.png
deleted file mode 100644
index e43c502..0000000
--- a/samples/BluetoothHDP/res/drawable-hdpi/icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/BluetoothHDP/res/drawable-mdpi/icon.png b/samples/BluetoothHDP/res/drawable-mdpi/icon.png
deleted file mode 100644
index 8d9e9df..0000000
--- a/samples/BluetoothHDP/res/drawable-mdpi/icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/BluetoothHDP/res/drawable-xhdpi/icon.png b/samples/BluetoothHDP/res/drawable-xhdpi/icon.png
deleted file mode 100644
index 1aea335..0000000
--- a/samples/BluetoothHDP/res/drawable-xhdpi/icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/BluetoothHDP/res/drawable-xhdpi/led_off.png b/samples/BluetoothHDP/res/drawable-xhdpi/led_off.png
deleted file mode 100644
index 884533c..0000000
--- a/samples/BluetoothHDP/res/drawable-xhdpi/led_off.png
+++ /dev/null
Binary files differ
diff --git a/samples/BluetoothHDP/res/drawable-xhdpi/led_on.png b/samples/BluetoothHDP/res/drawable-xhdpi/led_on.png
deleted file mode 100644
index 6542b00..0000000
--- a/samples/BluetoothHDP/res/drawable-xhdpi/led_on.png
+++ /dev/null
Binary files differ
diff --git a/samples/BluetoothHDP/res/drawable/led_indicator.xml b/samples/BluetoothHDP/res/drawable/led_indicator.xml
deleted file mode 100644
index d6140c8..0000000
--- a/samples/BluetoothHDP/res/drawable/led_indicator.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<level-list xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:maxLevel="0" android:drawable="@drawable/led_off" />
-    <item android:maxLevel="1" android:drawable="@drawable/led_on" />
-</level-list>
diff --git a/samples/BluetoothHDP/res/layout/console.xml b/samples/BluetoothHDP/res/layout/console.xml
deleted file mode 100644
index 8d8a3fe..0000000
--- a/samples/BluetoothHDP/res/layout/console.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-    <LinearLayout android:orientation="vertical"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_margin="5dp">
-        <TextView android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/app_registration"
-            android:textSize="20sp"
-            android:textStyle="bold" />
-        <LinearLayout android:orientation="horizontal"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dp"
-            android:gravity="center" >
-            <Button android:id="@+id/button_register_app"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content"
-                android:minWidth="130dp"
-                android:text="@string/register" />
-            <Button android:id="@+id/button_unregister_app"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content"
-                android:minWidth="130dp"
-                android:text="@string/unregister" />
-        </LinearLayout>
-
-        <TextView android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/channel_connection"
-            android:textSize="20sp"
-            android:textStyle="bold" />
-        <TextView android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/channel_connection_desc"
-            android:textSize="14sp" />
-        <LinearLayout android:orientation="horizontal"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dp"
-            android:gravity="center" >
-            <Button android:id="@+id/button_connect_channel"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content"
-                android:minWidth="130dp"
-                android:text="@string/connect" />
-            <Button android:id="@+id/button_disconnect_channel"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content"
-                android:minWidth="130dp"
-                android:text="@string/disconnect" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dp"
-            android:orientation="horizontal" >
-            <TextView android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/connection_state"
-                android:textSize="20sp"
-                android:textStyle="bold" />
-            <Space android:layout_width="10dp"
-                android:layout_height="0px" />
-            <TextView android:id="@+id/connect_ind"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/disconnected"
-                android:textSize="18sp"/>
-        </LinearLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dp"
-            android:orientation="horizontal" >
-            <TextView android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/data_ind"
-                android:textSize="20sp"
-                android:textStyle="bold" />
-            <Space android:layout_width="10dp"
-                android:layout_height="0px" />
-            <ImageView android:id="@+id/data_ind"
-                android:layout_width="20dp"
-                android:layout_height="20dp"
-                android:layout_marginTop="4dp"
-                android:src="@drawable/led_indicator" />
-        </LinearLayout>
-        <View android:layout_width="match_parent"
-            android:layout_height="1dp"
-            android:background="#FFFFFF"/>
-        <TextView android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_margin="5dp"
-            android:text="@string/status_msg"
-            android:textSize="20sp"
-            android:textStyle="bold" />
-        <TextView android:id="@+id/status_msg"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/empty"
-            android:textSize="18sp"
-            android:layout_margin="10dp"/>
-    </LinearLayout>
-</ScrollView>
diff --git a/samples/BluetoothHDP/res/values/strings.xml b/samples/BluetoothHDP/res/values/strings.xml
deleted file mode 100644
index 21e3a84..0000000
--- a/samples/BluetoothHDP/res/values/strings.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<resources>
-    <string name="app_name">HDP Sample</string>
-    <string name="app_registration">App Registration</string>
-    <string name="bluetooth_not_available">Bluetooth is not available</string>
-    <string name="bluetooth_health_profile_not_available">Bluetooth health profile is not available</string>
-    <string name="channel_connection">Channel Connection</string>
-    <string name="channel_connection_desc">(some devices automatically initiate connection)</string>
-    <string name="connect">Connect</string>
-    <string name="connected">CONNECTED</string>
-    <string name="connection_state">Connection State</string>
-    <string name="data_ind">Data Indicator</string>
-    <string name="disconnect">Disconnect</string>
-    <string name="disconnected">DISCONNECTED</string>
-    <string name="empty"> </string>
-    <string name="none">None...</string>
-    <string name="ok">Okay</string>
-    <string name="read_data">Reading data...</string>
-    <string name="read_data_done">Done with reading data...</string>
-    <string name="register">Register</string>
-    <string name="select_device">Select a device</string>
-    <string name="status_create_channel">Create channel status: %d</string>
-    <string name="status_destroy_channel">Destroy channel status: %d</string>
-    <string name="status_msg">Status Message</string>
-    <string name="status_reg">App registration status: %d</string>
-    <string name="status_unreg">App unregistration status: %d</string>
-    <string name="unregister">Unregister</string>
-</resources>
diff --git a/samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPActivity.java b/samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPActivity.java
deleted file mode 100644
index ca8b182..0000000
--- a/samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPActivity.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.bluetooth.health;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.ServiceConnection;
-import android.content.res.Resources;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.ImageView;
-import android.widget.TextView;
-import android.widget.Toast;
-
-/**
- * Main user interface for the Sample application.  All Bluetooth health-related
- * operations happen in {@link BluetoothHDPService}.  This activity passes messages to and from
- * the service.
- */
-public class BluetoothHDPActivity extends Activity {
-    private static final String TAG = "BluetoothHealthActivity";
-
-    // Use the appropriate IEEE 11073 data types based on the devices used.
-    // Below are some examples.  Refer to relevant Bluetooth HDP specifications for detail.
-    //     0x1007 - blood pressure meter
-    //     0x1008 - body thermometer
-    //     0x100F - body weight scale
-    private static final int HEALTH_PROFILE_SOURCE_DATA_TYPE = 0x1007;
-
-    private static final int REQUEST_ENABLE_BT = 1;
-
-    private TextView mConnectIndicator;
-    private ImageView mDataIndicator;
-    private TextView mStatusMessage;
-
-    private BluetoothAdapter mBluetoothAdapter;
-    private BluetoothDevice[] mAllBondedDevices;
-    private BluetoothDevice mDevice;
-    private int mDeviceIndex = 0;
-    private Resources mRes;
-    private Messenger mHealthService;
-    private boolean mHealthServiceBound;
-
-    // Handles events sent by {@link HealthHDPService}.
-    private Handler mIncomingHandler = new Handler() {
-        @Override
-        public void handleMessage(Message msg) {
-            switch (msg.what) {
-                // Application registration complete.
-                case BluetoothHDPService.STATUS_HEALTH_APP_REG:
-                    mStatusMessage.setText(
-                            String.format(mRes.getString(R.string.status_reg),
-                            msg.arg1));
-                    break;
-                // Application unregistration complete.
-                case BluetoothHDPService.STATUS_HEALTH_APP_UNREG:
-                    mStatusMessage.setText(
-                            String.format(mRes.getString(R.string.status_unreg),
-                            msg.arg1));
-                    break;
-                // Reading data from HDP device.
-                case BluetoothHDPService.STATUS_READ_DATA:
-                    mStatusMessage.setText(mRes.getString(R.string.read_data));
-                    mDataIndicator.setImageLevel(1);
-                    break;
-                // Finish reading data from HDP device.
-                case BluetoothHDPService.STATUS_READ_DATA_DONE:
-                    mStatusMessage.setText(mRes.getString(R.string.read_data_done));
-                    mDataIndicator.setImageLevel(0);
-                    break;
-                // Channel creation complete.  Some devices will automatically establish
-                // connection.
-                case BluetoothHDPService.STATUS_CREATE_CHANNEL:
-                    mStatusMessage.setText(
-                            String.format(mRes.getString(R.string.status_create_channel),
-                            msg.arg1));
-                    mConnectIndicator.setText(R.string.connected);
-                    break;
-                // Channel destroy complete.  This happens when either the device disconnects or
-                // there is extended inactivity.
-                case BluetoothHDPService.STATUS_DESTROY_CHANNEL:
-                    mStatusMessage.setText(
-                            String.format(mRes.getString(R.string.status_destroy_channel),
-                            msg.arg1));
-                    mConnectIndicator.setText(R.string.disconnected);
-                    break;
-                default:
-                    super.handleMessage(msg);
-            }
-        }
-    };
-
-    private final Messenger mMessenger = new Messenger(mIncomingHandler);
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        // Check for Bluetooth availability on the Android platform.
-        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
-        if (mBluetoothAdapter == null) {
-            Toast.makeText(this, R.string.bluetooth_not_available, Toast.LENGTH_LONG);
-            finish();
-            return;
-        }
-        setContentView(R.layout.console);
-        mConnectIndicator = (TextView) findViewById(R.id.connect_ind);
-        mStatusMessage = (TextView) findViewById(R.id.status_msg);
-        mDataIndicator = (ImageView) findViewById(R.id.data_ind);
-        mRes = getResources();
-        mHealthServiceBound = false;
-
-        // Initiates application registration through {@link BluetoothHDPService}.
-        Button registerAppButton = (Button) findViewById(R.id.button_register_app);
-        registerAppButton.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                sendMessage(BluetoothHDPService.MSG_REG_HEALTH_APP,
-                        HEALTH_PROFILE_SOURCE_DATA_TYPE);
-            }
-        });
-
-        // Initiates application unregistration through {@link BluetoothHDPService}.
-        Button unregisterAppButton = (Button) findViewById(R.id.button_unregister_app);
-        unregisterAppButton.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                sendMessage(BluetoothHDPService.MSG_UNREG_HEALTH_APP, 0);
-            }
-        });
-
-        // Initiates channel creation through {@link BluetoothHDPService}.  Some devices will
-        // initiate the channel connection, in which case, it is not necessary to do this in the
-        // application.  When pressed, the user is asked to select from one of the bonded devices
-        // to connect to.
-        Button connectButton = (Button) findViewById(R.id.button_connect_channel);
-        connectButton.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                mAllBondedDevices =
-                        (BluetoothDevice[]) mBluetoothAdapter.getBondedDevices().toArray(
-                                new BluetoothDevice[0]);
-
-                if (mAllBondedDevices.length > 0) {
-                    int deviceCount = mAllBondedDevices.length;
-                    if (mDeviceIndex < deviceCount) mDevice = mAllBondedDevices[mDeviceIndex];
-                    else {
-                        mDeviceIndex = 0;
-                        mDevice = mAllBondedDevices[0];
-                    }
-                    String[] deviceNames = new String[deviceCount];
-                    int i = 0;
-                    for (BluetoothDevice device : mAllBondedDevices) {
-                        deviceNames[i++] = device.getName();
-                    }
-                    SelectDeviceDialogFragment deviceDialog =
-                            SelectDeviceDialogFragment.newInstance(deviceNames, mDeviceIndex);
-                    deviceDialog.show(getFragmentManager(), "deviceDialog");
-                }
-            }
-        });
-
-        // Initiates channel disconnect through {@link BluetoothHDPService}.
-        Button disconnectButton = (Button) findViewById(R.id.button_disconnect_channel);
-        disconnectButton.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                disconnectChannel();
-            }
-        });
-        registerReceiver(mReceiver, initIntentFilter());
-    }
-
-    // Sets up communication with {@link BluetoothHDPService}.
-    private ServiceConnection mConnection = new ServiceConnection() {
-        public void onServiceConnected(ComponentName name, IBinder service) {
-            mHealthServiceBound = true;
-            Message msg = Message.obtain(null, BluetoothHDPService.MSG_REG_CLIENT);
-            msg.replyTo = mMessenger;
-            mHealthService = new Messenger(service);
-            try {
-                mHealthService.send(msg);
-            } catch (RemoteException e) {
-                Log.w(TAG, "Unable to register client to service.");
-                e.printStackTrace();
-            }
-        }
-
-        public void onServiceDisconnected(ComponentName name) {
-            mHealthService = null;
-            mHealthServiceBound = false;
-        }
-    };
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        if (mHealthServiceBound) unbindService(mConnection);
-        unregisterReceiver(mReceiver);
-    }
-
-    @Override
-    protected void onStart() {
-        super.onStart();
-        // If Bluetooth is not on, request that it be enabled.
-        if (!mBluetoothAdapter.isEnabled()) {
-            Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
-            startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
-        } else {
-            initialize();
-        }
-    }
-
-    /**
-     * Ensures user has turned on Bluetooth on the Android device.
-     */
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        switch (requestCode) {
-        case REQUEST_ENABLE_BT:
-            if (resultCode == Activity.RESULT_OK) {
-                initialize();
-            } else {
-                finish();
-                return;
-            }
-        }
-    }
-
-    /**
-     * Used by {@link SelectDeviceDialogFragment} to record the bonded Bluetooth device selected
-     * by the user.
-     *
-     * @param position Position of the bonded Bluetooth device in the array.
-     */
-    public void setDevice(int position) {
-        mDevice = this.mAllBondedDevices[position];
-        mDeviceIndex = position;
-    }
-
-    private void connectChannel() {
-        sendMessageWithDevice(BluetoothHDPService.MSG_CONNECT_CHANNEL);
-    }
-
-    private void disconnectChannel() {
-        sendMessageWithDevice(BluetoothHDPService.MSG_DISCONNECT_CHANNEL);
-    }
-
-    private void initialize() {
-        // Starts health service.
-        Intent intent = new Intent(this, BluetoothHDPService.class);
-        startService(intent);
-        bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
-    }
-
-    // Intent filter and broadcast receive to handle Bluetooth on event.
-    private IntentFilter initIntentFilter() {
-        IntentFilter filter = new IntentFilter();
-        filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
-        return filter;
-    }
-
-    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            final String action = intent.getAction();
-            if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action)) {
-                if (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR) ==
-                    BluetoothAdapter.STATE_ON) {
-                    initialize();
-                }
-            }
-        }
-    };
-
-    // Sends a message to {@link BluetoothHDPService}.
-    private void sendMessage(int what, int value) {
-        if (mHealthService == null) {
-            Log.d(TAG, "Health Service not connected.");
-            return;
-        }
-
-        try {
-            mHealthService.send(Message.obtain(null, what, value, 0));
-        } catch (RemoteException e) {
-            Log.w(TAG, "Unable to reach service.");
-            e.printStackTrace();
-        }
-    }
-
-    // Sends an update message, along with an HDP BluetoothDevice object, to
-    // {@link BluetoothHDPService}.  The BluetoothDevice object is needed by the channel creation
-    // method.
-    private void sendMessageWithDevice(int what) {
-        if (mHealthService == null) {
-            Log.d(TAG, "Health Service not connected.");
-            return;
-        }
-
-        try {
-            mHealthService.send(Message.obtain(null, what, mDevice));
-        } catch (RemoteException e) {
-            Log.w(TAG, "Unable to reach service.");
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Dialog to display a list of bonded Bluetooth devices for user to select from.  This is
-     * needed only for channel connection initiated from the application.
-     */
-    public static class SelectDeviceDialogFragment extends DialogFragment {
-
-        public static SelectDeviceDialogFragment newInstance(String[] names, int position) {
-            SelectDeviceDialogFragment frag = new SelectDeviceDialogFragment();
-            Bundle args = new Bundle();
-            args.putStringArray("names", names);
-            args.putInt("position", position);
-            frag.setArguments(args);
-            return frag;
-        }
-
-        @Override
-        public Dialog onCreateDialog(Bundle savedInstanceState) {
-            String[] deviceNames = getArguments().getStringArray("names");
-            int position = getArguments().getInt("position", -1);
-            if (position == -1) position = 0;
-            return new AlertDialog.Builder(getActivity())
-                    .setTitle(R.string.select_device)
-                    .setPositiveButton(R.string.ok,
-                        new DialogInterface.OnClickListener() {
-                            public void onClick(DialogInterface dialog, int which) {
-                                ((BluetoothHDPActivity) getActivity()).connectChannel();
-                            }
-                        })
-                    .setSingleChoiceItems(deviceNames, position,
-                        new DialogInterface.OnClickListener() {
-                            public void onClick(DialogInterface dialog, int which) {
-                                ((BluetoothHDPActivity) getActivity()).setDevice(which);
-                            }
-                        }
-                    )
-                    .create();
-        }
-    }
-}
diff --git a/samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPService.java b/samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPService.java
deleted file mode 100644
index f090aa7..0000000
--- a/samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPService.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.bluetooth.health;
-
-import android.app.Service;
-import android.bluetooth.BluetoothAdapter;
-import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothHealth;
-import android.bluetooth.BluetoothHealthAppConfiguration;
-import android.bluetooth.BluetoothHealthCallback;
-import android.bluetooth.BluetoothProfile;
-import android.content.Intent;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.ParcelFileDescriptor;
-import android.os.RemoteException;
-import android.util.Log;
-import android.widget.Toast;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * This Service encapsulates Bluetooth Health API to establish, manage, and disconnect
- * communication between the Android device and a Bluetooth HDP-enabled device.  Possible HDP
- * device type includes blood pressure monitor, glucose meter, thermometer, etc.
- *
- * As outlined in the
- * <a href="http://developer.android.com/reference/android/bluetooth/BluetoothHealth.html">BluetoothHealth</a>
- * documentation, the steps involve:
- * 1. Get a reference to the BluetoothHealth proxy object.
- * 2. Create a BluetoothHealth callback and register an application configuration that acts as a
- *    Health SINK.
- * 3. Establish connection to a health device.  Some devices will initiate the connection.  It is
- *    unnecessary to carry out this step for those devices.
- * 4. When connected successfully, read / write to the health device using the file descriptor.
- *    The received data needs to be interpreted using a health manager which implements the
- *    IEEE 11073-xxxxx specifications.
- * 5. When done, close the health channel and unregister the application.  The channel will
- *    also close when there is extended inactivity.
- */
-public class BluetoothHDPService extends Service {
-    private static final String TAG = "BluetoothHDPService";
-
-    public static final int RESULT_OK = 0;
-    public static final int RESULT_FAIL = -1;
-
-    // Status codes sent back to the UI client.
-    // Application registration complete.
-    public static final int STATUS_HEALTH_APP_REG = 100;
-    // Application unregistration complete.
-    public static final int STATUS_HEALTH_APP_UNREG = 101;
-    // Channel creation complete.
-    public static final int STATUS_CREATE_CHANNEL = 102;
-    // Channel destroy complete.
-    public static final int STATUS_DESTROY_CHANNEL = 103;
-    // Reading data from Bluetooth HDP device.
-    public static final int STATUS_READ_DATA = 104;
-    // Done with reading data.
-    public static final int STATUS_READ_DATA_DONE = 105;
-
-    // Message codes received from the UI client.
-    // Register client with this service.
-    public static final int MSG_REG_CLIENT = 200;
-    // Unregister client from this service.
-    public static final int MSG_UNREG_CLIENT = 201;
-    // Register health application.
-    public static final int MSG_REG_HEALTH_APP = 300;
-    // Unregister health application.
-    public static final int MSG_UNREG_HEALTH_APP = 301;
-    // Connect channel.
-    public static final int MSG_CONNECT_CHANNEL = 400;
-    // Disconnect channel.
-    public static final int MSG_DISCONNECT_CHANNEL = 401;
-
-    private BluetoothHealthAppConfiguration mHealthAppConfig;
-    private BluetoothAdapter mBluetoothAdapter;
-    private BluetoothHealth mBluetoothHealth;
-    private BluetoothDevice mDevice;
-    private int mChannelId;
-
-    private Messenger mClient;
-
-    // Handles events sent by {@link HealthHDPActivity}.
-    private class IncomingHandler extends Handler {
-        @Override
-        public void handleMessage(Message msg) {
-            switch (msg.what) {
-                // Register UI client to this service so the client can receive messages.
-                case MSG_REG_CLIENT:
-                    Log.d(TAG, "Activity client registered");
-                    mClient = msg.replyTo;
-                    break;
-                // Unregister UI client from this service.
-                case MSG_UNREG_CLIENT:
-                    mClient = null;
-                    break;
-                // Register health application.
-                case MSG_REG_HEALTH_APP:
-                    registerApp(msg.arg1);
-                    break;
-                // Unregister health application.
-                case MSG_UNREG_HEALTH_APP:
-                    unregisterApp();
-                    break;
-                // Connect channel.
-                case MSG_CONNECT_CHANNEL:
-                    mDevice = (BluetoothDevice) msg.obj;
-                    connectChannel();
-                    break;
-                // Disconnect channel.
-                case MSG_DISCONNECT_CHANNEL:
-                    mDevice = (BluetoothDevice) msg.obj;
-                    disconnectChannel();
-                    break;
-                default:
-                    super.handleMessage(msg);
-            }
-        }
-    }
-
-    final Messenger mMessenger = new Messenger(new IncomingHandler());
-
-    /**
-     * Make sure Bluetooth and health profile are available on the Android device.  Stop service
-     * if they are not available.
-     */
-    @Override
-    public void onCreate() {
-        super.onCreate();
-        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
-        if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
-            // Bluetooth adapter isn't available.  The client of the service is supposed to
-            // verify that it is available and activate before invoking this service.
-            stopSelf();
-            return;
-        }
-        if (!mBluetoothAdapter.getProfileProxy(this, mBluetoothServiceListener,
-                BluetoothProfile.HEALTH)) {
-            Toast.makeText(this, R.string.bluetooth_health_profile_not_available,
-                    Toast.LENGTH_LONG);
-            stopSelf();
-            return;
-        }
-    }
-
-    @Override
-    public int onStartCommand(Intent intent, int flags, int startId) {
-        Log.d(TAG, "BluetoothHDPService is running.");
-        return START_STICKY;
-    }
-
-    @Override
-    public IBinder onBind(Intent intent) {
-        return mMessenger.getBinder();
-    };
-
-    // Register health application through the Bluetooth Health API.
-    private void registerApp(int dataType) {
-        mBluetoothHealth.registerSinkAppConfiguration(TAG, dataType, mHealthCallback);
-    }
-
-    // Unregister health application through the Bluetooth Health API.
-    private void unregisterApp() {
-        mBluetoothHealth.unregisterAppConfiguration(mHealthAppConfig);
-    }
-
-    // Connect channel through the Bluetooth Health API.
-    private void connectChannel() {
-        Log.i(TAG, "connectChannel()");
-        mBluetoothHealth.connectChannelToSource(mDevice, mHealthAppConfig);
-    }
-
-    // Disconnect channel through the Bluetooth Health API.
-    private void disconnectChannel() {
-        Log.i(TAG, "disconnectChannel()");
-        mBluetoothHealth.disconnectChannel(mDevice, mHealthAppConfig, mChannelId);
-    }
-
-    // Callbacks to handle connection set up and disconnection clean up.
-    private final BluetoothProfile.ServiceListener mBluetoothServiceListener =
-            new BluetoothProfile.ServiceListener() {
-        public void onServiceConnected(int profile, BluetoothProfile proxy) {
-            if (profile == BluetoothProfile.HEALTH) {
-                mBluetoothHealth = (BluetoothHealth) proxy;
-                if (Log.isLoggable(TAG, Log.DEBUG))
-                    Log.d(TAG, "onServiceConnected to profile: " + profile);
-            }
-        }
-
-        public void onServiceDisconnected(int profile) {
-            if (profile == BluetoothProfile.HEALTH) {
-                mBluetoothHealth = null;
-            }
-        }
-    };
-
-    private final BluetoothHealthCallback mHealthCallback = new BluetoothHealthCallback() {
-        // Callback to handle application registration and unregistration events.  The service
-        // passes the status back to the UI client.
-        public void onHealthAppConfigurationStatusChange(BluetoothHealthAppConfiguration config,
-                int status) {
-            if (status == BluetoothHealth.APP_CONFIG_REGISTRATION_FAILURE) {
-                mHealthAppConfig = null;
-                sendMessage(STATUS_HEALTH_APP_REG, RESULT_FAIL);
-            } else if (status == BluetoothHealth.APP_CONFIG_REGISTRATION_SUCCESS) {
-                mHealthAppConfig = config;
-                sendMessage(STATUS_HEALTH_APP_REG, RESULT_OK);
-            } else if (status == BluetoothHealth.APP_CONFIG_UNREGISTRATION_FAILURE ||
-                    status == BluetoothHealth.APP_CONFIG_UNREGISTRATION_SUCCESS) {
-                sendMessage(STATUS_HEALTH_APP_UNREG,
-                        status == BluetoothHealth.APP_CONFIG_UNREGISTRATION_SUCCESS ?
-                        RESULT_OK : RESULT_FAIL);
-            }
-        }
-
-        // Callback to handle channel connection state changes.
-        // Note that the logic of the state machine may need to be modified based on the HDP device.
-        // When the HDP device is connected, the received file descriptor is passed to the
-        // ReadThread to read the content.
-        public void onHealthChannelStateChange(BluetoothHealthAppConfiguration config,
-                BluetoothDevice device, int prevState, int newState, ParcelFileDescriptor fd,
-                int channelId) {
-            if (Log.isLoggable(TAG, Log.DEBUG))
-                Log.d(TAG, String.format("prevState\t%d ----------> newState\t%d",
-                        prevState, newState));
-            if (prevState == BluetoothHealth.STATE_CHANNEL_DISCONNECTED &&
-                    newState == BluetoothHealth.STATE_CHANNEL_CONNECTED) {
-                if (config.equals(mHealthAppConfig)) {
-                    mChannelId = channelId;
-                    sendMessage(STATUS_CREATE_CHANNEL, RESULT_OK);
-                    (new ReadThread(fd)).start();
-                } else {
-                    sendMessage(STATUS_CREATE_CHANNEL, RESULT_FAIL);
-                }
-            } else if (prevState == BluetoothHealth.STATE_CHANNEL_CONNECTING &&
-                       newState == BluetoothHealth.STATE_CHANNEL_DISCONNECTED) {
-                sendMessage(STATUS_CREATE_CHANNEL, RESULT_FAIL);
-            } else if (newState == BluetoothHealth.STATE_CHANNEL_DISCONNECTED) {
-                if (config.equals(mHealthAppConfig)) {
-                    sendMessage(STATUS_DESTROY_CHANNEL, RESULT_OK);
-                } else {
-                    sendMessage(STATUS_DESTROY_CHANNEL, RESULT_FAIL);
-                }
-            }
-        }
-    };
-
-    // Sends an update message to registered UI client.
-    private void sendMessage(int what, int value) {
-        if (mClient == null) {
-            Log.d(TAG, "No clients registered.");
-            return;
-        }
-
-        try {
-            mClient.send(Message.obtain(null, what, value, 0));
-        } catch (RemoteException e) {
-            // Unable to reach client.
-            e.printStackTrace();
-        }
-    }
-
-    // Thread to read incoming data received from the HDP device.  This sample application merely
-    // reads the raw byte from the incoming file descriptor.  The data should be interpreted using
-    // a health manager which implements the IEEE 11073-xxxxx specifications.
-    private class ReadThread extends Thread {
-        private ParcelFileDescriptor mFd;
-
-        public ReadThread(ParcelFileDescriptor fd) {
-            super();
-            mFd = fd;
-        }
-
-        @Override
-        public void run() {
-            FileInputStream fis = new FileInputStream(mFd.getFileDescriptor());
-            final byte data[] = new byte[8192];
-            try {
-                while(fis.read(data) > -1) {
-                    // At this point, the application can pass the raw data to a parser that
-                    // has implemented the IEEE 11073-xxxxx specifications.  Instead, this sample
-                    // simply indicates that some data has been received.
-                    sendMessage(STATUS_READ_DATA, 0);
-                }
-            } catch(IOException ioe) {}
-            if (mFd != null) {
-                try {
-                    mFd.close();
-                } catch (IOException e) { /* Do nothing. */ }
-            }
-            sendMessage(STATUS_READ_DATA_DONE, 0);
-        }
-    }
-}
diff --git a/samples/RandomMusicPlayer/Android.mk b/samples/RandomMusicPlayer/Android.mk
deleted file mode 100644
index 9990d7c..0000000
--- a/samples/RandomMusicPlayer/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := samples
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := RandomMusicPlayer
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_DEX_PREOPT := false
-
-include $(BUILD_PACKAGE)
-
-# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/RandomMusicPlayer/AndroidManifest.xml b/samples/RandomMusicPlayer/AndroidManifest.xml
deleted file mode 100644
index 6e52b61..0000000
--- a/samples/RandomMusicPlayer/AndroidManifest.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.android.musicplayer"
-    android:versionCode="1"
-    android:versionName="1.0">
-
-    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14" />
-
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
-
-    <application android:icon="@drawable/ic_launcher" android:label="@string/app_title">
-
-        <activity android:name=".MainActivity"
-            android:label="@string/app_title"
-            android:theme="@android:style/Theme.Black.NoTitleBar">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <service android:exported="false" android:name=".MusicService">
-            <intent-filter>
-                <action android:name="com.example.android.musicplayer.action.TOGGLE_PLAYBACK" />
-                <action android:name="com.example.android.musicplayer.action.PLAY" />
-                <action android:name="com.example.android.musicplayer.action.PAUSE" />
-                <action android:name="com.example.android.musicplayer.action.SKIP" />
-                <action android:name="com.example.android.musicplayer.action.REWIND" />
-                <action android:name="com.example.android.musicplayer.action.STOP" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="com.example.android.musicplayer.action.URL" />
-                <data android:scheme="http" />
-            </intent-filter>
-        </service>
-
-        <receiver android:name=".MusicIntentReceiver">
-            <intent-filter>
-                <action android:name="android.media.AUDIO_BECOMING_NOISY" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="android.intent.action.MEDIA_BUTTON" />
-            </intent-filter>
-        </receiver>
-
-    </application>
-</manifest>
diff --git a/samples/RandomMusicPlayer/_index.html b/samples/RandomMusicPlayer/_index.html
deleted file mode 100644
index f1d9769..0000000
--- a/samples/RandomMusicPlayer/_index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<p>A simple music player that illustrates how to make a multimedia application
-that manages media playback from a service. It allows the user to play music
-available on the device or specify a URL from which the media should be
-streamed.  It also illustrates how to use the notification system to indicate
-an ongoing task and how to deal with audio focus changes.</p>
-
-<p class="note"><strong>Update:</strong> This sample also illustrates how to use the
-<code><a href="../../../reference/android/media/RemoteControlClient.html">RemoteControlClient</a></code>
-class added in API level 14 to integrate with music playback remote controls
-such as those found on the lockscreen.</p>
-
-<img alt="" src="../images/randommusicplayer.png" />
-
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi-v11/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-hdpi-v11/ic_stat_playing.png
deleted file mode 100755
index cc62c29..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi-v11/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi-v9/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-hdpi-v9/ic_stat_playing.png
deleted file mode 100755
index 9351f4b..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi-v9/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/eject.png b/samples/RandomMusicPlayer/res/drawable-hdpi/eject.png
deleted file mode 100644
index 650b38a..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/eject.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/eject_pressed.png b/samples/RandomMusicPlayer/res/drawable-hdpi/eject_pressed.png
deleted file mode 100644
index 065b30d..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/eject_pressed.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/ff.png b/samples/RandomMusicPlayer/res/drawable-hdpi/ff.png
deleted file mode 100644
index 508f741..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/ff.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/ff_pressed.png b/samples/RandomMusicPlayer/res/drawable-hdpi/ff_pressed.png
deleted file mode 100644
index 468ae8e..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/ff_pressed.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/ic_launcher.png b/samples/RandomMusicPlayer/res/drawable-hdpi/ic_launcher.png
deleted file mode 100755
index 972c791..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-hdpi/ic_stat_playing.png
deleted file mode 100755
index 099c44e..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/pause.png b/samples/RandomMusicPlayer/res/drawable-hdpi/pause.png
deleted file mode 100644
index 13581de..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/pause.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/pause_pressed.png b/samples/RandomMusicPlayer/res/drawable-hdpi/pause_pressed.png
deleted file mode 100644
index 9ddd07d..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/pause_pressed.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/play.png b/samples/RandomMusicPlayer/res/drawable-hdpi/play.png
deleted file mode 100644
index e34b48e..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/play.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/play_pressed.png b/samples/RandomMusicPlayer/res/drawable-hdpi/play_pressed.png
deleted file mode 100644
index 790cd29..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/play_pressed.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/rew.png b/samples/RandomMusicPlayer/res/drawable-hdpi/rew.png
deleted file mode 100644
index 26864b7..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/rew.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/rew_pressed.png b/samples/RandomMusicPlayer/res/drawable-hdpi/rew_pressed.png
deleted file mode 100644
index 54c38a7..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/rew_pressed.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/stop.png b/samples/RandomMusicPlayer/res/drawable-hdpi/stop.png
deleted file mode 100644
index 45eff23..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/stop.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-hdpi/stop_pressed.png b/samples/RandomMusicPlayer/res/drawable-hdpi/stop_pressed.png
deleted file mode 100644
index c7bda81..0000000
--- a/samples/RandomMusicPlayer/res/drawable-hdpi/stop_pressed.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-mdpi-v11/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-mdpi-v11/ic_stat_playing.png
deleted file mode 100755
index 049ff3d..0000000
--- a/samples/RandomMusicPlayer/res/drawable-mdpi-v11/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-mdpi-v9/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-mdpi-v9/ic_stat_playing.png
deleted file mode 100755
index 7970cb9..0000000
--- a/samples/RandomMusicPlayer/res/drawable-mdpi-v9/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-mdpi/ic_launcher.png b/samples/RandomMusicPlayer/res/drawable-mdpi/ic_launcher.png
deleted file mode 100755
index 01b53fd..0000000
--- a/samples/RandomMusicPlayer/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-mdpi/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-mdpi/ic_stat_playing.png
deleted file mode 100755
index 5ffc8cc..0000000
--- a/samples/RandomMusicPlayer/res/drawable-mdpi/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-nodpi/dummy_album_art.png b/samples/RandomMusicPlayer/res/drawable-nodpi/dummy_album_art.png
deleted file mode 100644
index e50b97e..0000000
--- a/samples/RandomMusicPlayer/res/drawable-nodpi/dummy_album_art.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-xhdpi-v11/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-xhdpi-v11/ic_stat_playing.png
deleted file mode 100755
index f940498..0000000
--- a/samples/RandomMusicPlayer/res/drawable-xhdpi-v11/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-xhdpi-v9/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-xhdpi-v9/ic_stat_playing.png
deleted file mode 100755
index d0f2a2b..0000000
--- a/samples/RandomMusicPlayer/res/drawable-xhdpi-v9/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-xhdpi/ic_launcher.png b/samples/RandomMusicPlayer/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100755
index af762f2..0000000
--- a/samples/RandomMusicPlayer/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable-xhdpi/ic_stat_playing.png b/samples/RandomMusicPlayer/res/drawable-xhdpi/ic_stat_playing.png
deleted file mode 100755
index aa46a0c..0000000
--- a/samples/RandomMusicPlayer/res/drawable-xhdpi/ic_stat_playing.png
+++ /dev/null
Binary files differ
diff --git a/samples/RandomMusicPlayer/res/drawable/btn_eject.xml b/samples/RandomMusicPlayer/res/drawable/btn_eject.xml
deleted file mode 100644
index e3e40ae..0000000
--- a/samples/RandomMusicPlayer/res/drawable/btn_eject.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/eject_pressed" />
-    <item android:state_focused="true" android:drawable="@drawable/eject_pressed" />
-    <item android:drawable="@drawable/eject" />
-</selector>
diff --git a/samples/RandomMusicPlayer/res/drawable/btn_ff.xml b/samples/RandomMusicPlayer/res/drawable/btn_ff.xml
deleted file mode 100644
index c87fa06..0000000
--- a/samples/RandomMusicPlayer/res/drawable/btn_ff.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/ff_pressed" />
-    <item android:state_focused="true" android:drawable="@drawable/ff_pressed" />
-    <item android:drawable="@drawable/ff" />
-</selector>
diff --git a/samples/RandomMusicPlayer/res/drawable/btn_pause.xml b/samples/RandomMusicPlayer/res/drawable/btn_pause.xml
deleted file mode 100644
index 7aadd2f..0000000
--- a/samples/RandomMusicPlayer/res/drawable/btn_pause.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/pause_pressed" />
-    <item android:state_focused="true" android:drawable="@drawable/pause_pressed" />
-    <item android:drawable="@drawable/pause" />
-</selector>
diff --git a/samples/RandomMusicPlayer/res/drawable/btn_play.xml b/samples/RandomMusicPlayer/res/drawable/btn_play.xml
deleted file mode 100644
index dc319c5..0000000
--- a/samples/RandomMusicPlayer/res/drawable/btn_play.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/play_pressed" />
-    <item android:state_focused="true" android:drawable="@drawable/play_pressed" />
-    <item android:drawable="@drawable/play" />
-</selector>
diff --git a/samples/RandomMusicPlayer/res/drawable/btn_rew.xml b/samples/RandomMusicPlayer/res/drawable/btn_rew.xml
deleted file mode 100644
index cc4dad8..0000000
--- a/samples/RandomMusicPlayer/res/drawable/btn_rew.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/rew_pressed" />
-    <item android:state_focused="true" android:drawable="@drawable/rew_pressed" />
-    <item android:drawable="@drawable/rew" />
-</selector>
diff --git a/samples/RandomMusicPlayer/res/drawable/btn_stop.xml b/samples/RandomMusicPlayer/res/drawable/btn_stop.xml
deleted file mode 100644
index 5ce2d17..0000000
--- a/samples/RandomMusicPlayer/res/drawable/btn_stop.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true" android:drawable="@drawable/stop_pressed" />
-    <item android:state_focused="true" android:drawable="@drawable/stop_pressed" />
-    <item android:drawable="@drawable/stop" />
-</selector>
diff --git a/samples/RandomMusicPlayer/res/layout-land/main.xml b/samples/RandomMusicPlayer/res/layout-land/main.xml
deleted file mode 100644
index b8070bb..0000000
--- a/samples/RandomMusicPlayer/res/layout-land/main.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:gravity="center"
-    android:background="#000040">
-
-    <TextView android:text="@string/app_title"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:padding="20dp"
-        android:textColor="#ffffff"
-        android:textSize="20sp"
-        android:textStyle="bold" />
-
-    <LinearLayout android:orientation="horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:gravity="center">
-        <Button android:id="@+id/rewindbutton"
-            android:background="@drawable/btn_rew"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/playbutton"
-            android:background="@drawable/btn_play"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/pausebutton"
-            android:background="@drawable/btn_pause"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/skipbutton"
-            android:background="@drawable/btn_ff"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/stopbutton"
-            android:background="@drawable/btn_stop"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/ejectbutton"
-            android:background="@drawable/btn_eject"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-
-    </LinearLayout>
-</LinearLayout>
diff --git a/samples/RandomMusicPlayer/res/layout/main.xml b/samples/RandomMusicPlayer/res/layout/main.xml
deleted file mode 100644
index a41a710..0000000
--- a/samples/RandomMusicPlayer/res/layout/main.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:gravity="center"
-    android:background="#000040">
-
-    <TextView android:text="@string/app_title"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:padding="20dp"
-        android:textColor="#ffffff"
-        android:textSize="20sp"
-        android:textStyle="bold" />
-
-    <LinearLayout android:orientation="horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:gravity="center"
-        android:layout_margin="10dp">
-        <Button android:id="@+id/rewindbutton"
-            android:background="@drawable/btn_rew"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/playbutton"
-            android:background="@drawable/btn_play"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/pausebutton"
-            android:background="@drawable/btn_pause"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/skipbutton"
-            android:background="@drawable/btn_ff"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-    </LinearLayout>
-
-    <LinearLayout android:orientation="horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:gravity="center"
-        android:layout_margin="10dp">
-        <Button android:id="@+id/stopbutton"
-            android:background="@drawable/btn_stop"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-        <Button android:id="@+id/ejectbutton"
-            android:background="@drawable/btn_eject"
-            android:layout_width="64dp"
-            android:layout_height="64dp"
-            android:layout_margin="5dp" />
-
-    </LinearLayout>
-</LinearLayout>
diff --git a/samples/RandomMusicPlayer/res/values/strings.xml b/samples/RandomMusicPlayer/res/values/strings.xml
deleted file mode 100644
index 39db75e..0000000
--- a/samples/RandomMusicPlayer/res/values/strings.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
-  Copyright (C) 2011 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<resources>
-    <string name="app_title">Random Music Player</string>
-</resources>
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/AudioFocusHelper.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/AudioFocusHelper.java
deleted file mode 100644
index 980bac8..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/AudioFocusHelper.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*   
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.content.Context;
-import android.media.AudioManager;
-
-/** 
- * Convenience class to deal with audio focus. This class deals with everything related to audio
- * focus: it can request and abandon focus, and will intercept focus change events and deliver
- * them to a MusicFocusable interface (which, in our case, is implemented by {@link MusicService}).
- *
- * This class can only be used on SDK level 8 and above, since it uses API features that are not
- * available on previous SDK's.
- */
-public class AudioFocusHelper implements AudioManager.OnAudioFocusChangeListener {
-    AudioManager mAM;
-    MusicFocusable mFocusable;
-
-    public AudioFocusHelper(Context ctx, MusicFocusable focusable) {
-        mAM = (AudioManager) ctx.getSystemService(Context.AUDIO_SERVICE);
-        mFocusable = focusable;
-    }
-
-    /** Requests audio focus. Returns whether request was successful or not. */
-    public boolean requestFocus() {
-        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED ==
-            mAM.requestAudioFocus(this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);
-    }
-
-    /** Abandons audio focus. Returns whether request was successful or not. */
-    public boolean abandonFocus() {
-        return AudioManager.AUDIOFOCUS_REQUEST_GRANTED == mAM.abandonAudioFocus(this);
-    }
-
-    /** 
-     * Called by AudioManager on audio focus changes. We implement this by calling our
-     * MusicFocusable appropriately to relay the message.
-     */
-    public void onAudioFocusChange(int focusChange) {
-        if (mFocusable == null) return;
-        switch (focusChange) {
-            case AudioManager.AUDIOFOCUS_GAIN:
-                mFocusable.onGainedAudioFocus();
-                break;
-            case AudioManager.AUDIOFOCUS_LOSS:
-            case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
-                mFocusable.onLostAudioFocus(false);
-                break;
-            case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
-                mFocusable.onLostAudioFocus(true);
-                break;
-             default:
-        }
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MainActivity.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MainActivity.java
deleted file mode 100644
index 4d5224b..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MainActivity.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*   
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.EditText;
-
-/** 
- * Main activity: shows media player buttons. This activity shows the media player buttons and
- * lets the user click them. No media handling is done here -- everything is done by passing
- * Intents to our {@link MusicService}.
- * */
-public class MainActivity extends Activity implements OnClickListener {
-    /**
-     * The URL we suggest as default when adding by URL. This is just so that the user doesn't
-     * have to find an URL to test this sample.
-     */
-    final String SUGGESTED_URL = "http://www.vorbis.com/music/Epoq-Lepidoptera.ogg";
-
-    Button mPlayButton;
-    Button mPauseButton;
-    Button mSkipButton;
-    Button mRewindButton;
-    Button mStopButton;
-    Button mEjectButton;
-
-    /**
-     * Called when the activity is first created. Here, we simply set the event listeners and
-     * start the background service ({@link MusicService}) that will handle the actual media
-     * playback.
-     */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-
-        mPlayButton = (Button) findViewById(R.id.playbutton);
-        mPauseButton = (Button) findViewById(R.id.pausebutton);
-        mSkipButton = (Button) findViewById(R.id.skipbutton);
-        mRewindButton = (Button) findViewById(R.id.rewindbutton);
-        mStopButton = (Button) findViewById(R.id.stopbutton);
-        mEjectButton = (Button) findViewById(R.id.ejectbutton);
-
-        mPlayButton.setOnClickListener(this);
-        mPauseButton.setOnClickListener(this);
-        mSkipButton.setOnClickListener(this);
-        mRewindButton.setOnClickListener(this);
-        mStopButton.setOnClickListener(this);
-        mEjectButton.setOnClickListener(this);
-    }
-
-    public void onClick(View target) {
-        // Send the correct intent to the MusicService, according to the button that was clicked
-        if (target == mPlayButton)
-            startService(new Intent(MusicService.ACTION_PLAY));
-        else if (target == mPauseButton)
-            startService(new Intent(MusicService.ACTION_PAUSE));
-        else if (target == mSkipButton)
-            startService(new Intent(MusicService.ACTION_SKIP));
-        else if (target == mRewindButton)
-            startService(new Intent(MusicService.ACTION_REWIND));
-        else if (target == mStopButton)
-            startService(new Intent(MusicService.ACTION_STOP));
-        else if (target == mEjectButton) {
-            showUrlDialog();
-        }
-    }
-
-    /** 
-     * Shows an alert dialog where the user can input a URL. After showing the dialog, if the user
-     * confirms, sends the appropriate intent to the {@link MusicService} to cause that URL to be
-     * played.
-     */
-    void showUrlDialog() {
-        AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
-        alertBuilder.setTitle("Manual Input");
-        alertBuilder.setMessage("Enter a URL (must be http://)");
-        final EditText input = new EditText(this);
-        alertBuilder.setView(input);
-
-        input.setText(SUGGESTED_URL);
-
-        alertBuilder.setPositiveButton("Play!", new DialogInterface.OnClickListener() {
-            public void onClick(DialogInterface dlg, int whichButton) {
-                // Send an intent with the URL of the song to play. This is expected by
-                // MusicService.
-                Intent i = new Intent(MusicService.ACTION_URL);
-                Uri uri = Uri.parse(input.getText().toString());
-                i.setData(uri);
-                startService(i);
-            }
-        });
-        alertBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
-            public void onClick(DialogInterface dlg, int whichButton) {}
-        });
-
-        alertBuilder.show();
-    }
-
-    @Override
-    public boolean onKeyDown(int keyCode, KeyEvent event) {
-        switch (keyCode) {
-            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
-            case KeyEvent.KEYCODE_HEADSETHOOK:
-                startService(new Intent(MusicService.ACTION_TOGGLE_PLAYBACK));
-                return true;
-        }
-        return super.onKeyDown(keyCode, event);
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MediaButtonHelper.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MediaButtonHelper.java
deleted file mode 100644
index 1bacee5..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MediaButtonHelper.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.example.android.musicplayer;
-
-import android.content.ComponentName;
-import android.media.AudioManager;
-import android.util.Log;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- * Class that assists with handling new media button APIs available in API level 8.
- */
-public class MediaButtonHelper {
-    // Backwards compatibility code (methods available as of API Level 8)
-    private static final String TAG = "MediaButtonHelper";
-
-    static {
-        initializeStaticCompatMethods();
-    }
-
-    static Method sMethodRegisterMediaButtonEventReceiver;
-    static Method sMethodUnregisterMediaButtonEventReceiver;
-
-    static void initializeStaticCompatMethods() {
-        try {
-            sMethodRegisterMediaButtonEventReceiver = AudioManager.class.getMethod(
-                    "registerMediaButtonEventReceiver",
-                    new Class[] { ComponentName.class });
-            sMethodUnregisterMediaButtonEventReceiver = AudioManager.class.getMethod(
-                    "unregisterMediaButtonEventReceiver",
-                    new Class[] { ComponentName.class });
-        } catch (NoSuchMethodException e) {
-            // Silently fail when running on an OS before API level 8.
-        }
-    }
-
-    public static void registerMediaButtonEventReceiverCompat(AudioManager audioManager,
-            ComponentName receiver) {
-        if (sMethodRegisterMediaButtonEventReceiver == null)
-            return;
-
-        try {
-            sMethodRegisterMediaButtonEventReceiver.invoke(audioManager, receiver);
-        } catch (InvocationTargetException e) {
-            // Unpack original exception when possible
-            Throwable cause = e.getCause();
-            if (cause instanceof RuntimeException) {
-                throw (RuntimeException) cause;
-            } else if (cause instanceof Error) {
-                throw (Error) cause;
-            } else {
-                // Unexpected checked exception; wrap and re-throw
-                throw new RuntimeException(e);
-            }
-        } catch (IllegalAccessException e) {
-            Log.e(TAG, "IllegalAccessException invoking registerMediaButtonEventReceiver.");
-            e.printStackTrace();
-        }
-    }
-
-    @SuppressWarnings("unused")
-    public static void unregisterMediaButtonEventReceiverCompat(AudioManager audioManager,
-            ComponentName receiver) {
-        if (sMethodUnregisterMediaButtonEventReceiver == null)
-            return;
-
-        try {
-            sMethodUnregisterMediaButtonEventReceiver.invoke(audioManager, receiver);
-        } catch (InvocationTargetException e) {
-            // Unpack original exception when possible
-            Throwable cause = e.getCause();
-            if (cause instanceof RuntimeException) {
-                throw (RuntimeException) cause;
-            } else if (cause instanceof Error) {
-                throw (Error) cause;
-            } else {
-                // Unexpected checked exception; wrap and re-throw
-                throw new RuntimeException(e);
-            }
-        } catch (IllegalAccessException e) {
-            Log.e(TAG, "IllegalAccessException invoking unregisterMediaButtonEventReceiver.");
-            e.printStackTrace();
-        }
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicFocusable.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicFocusable.java
deleted file mode 100644
index aea8b49..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicFocusable.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*   
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-/**
- * Represents something that can react to audio focus events. We implement this instead of just
- * using AudioManager.OnAudioFocusChangeListener because that interface is only available in SDK
- * level 8 and above, and we want our application to work on previous SDKs.
- */
-public interface MusicFocusable {
-    /** Signals that audio focus was gained. */
-    public void onGainedAudioFocus();
-
-    /**
-     * Signals that audio focus was lost.
-     *
-     * @param canDuck If true, audio can continue in "ducked" mode (low volume). Otherwise, all
-     * audio must stop.
-     */
-    public void onLostAudioFocus(boolean canDuck);
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicIntentReceiver.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicIntentReceiver.java
deleted file mode 100644
index 28f19d4..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicIntentReceiver.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*   
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.widget.Toast;
-
-/**
- * Receives broadcasted intents. In particular, we are interested in the
- * android.media.AUDIO_BECOMING_NOISY and android.intent.action.MEDIA_BUTTON intents, which is
- * broadcast, for example, when the user disconnects the headphones. This class works because we are
- * declaring it in a &lt;receiver&gt; tag in AndroidManifest.xml.
- */
-public class MusicIntentReceiver extends BroadcastReceiver {
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        if (intent.getAction().equals(android.media.AudioManager.ACTION_AUDIO_BECOMING_NOISY)) {
-            Toast.makeText(context, "Headphones disconnected.", Toast.LENGTH_SHORT).show();
-
-            // send an intent to our MusicService to telling it to pause the audio
-            context.startService(new Intent(MusicService.ACTION_PAUSE));
-
-        } else if (intent.getAction().equals(Intent.ACTION_MEDIA_BUTTON)) {
-            KeyEvent keyEvent = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT);
-            if (keyEvent.getAction() != KeyEvent.ACTION_DOWN)
-                return;
-
-            switch (keyEvent.getKeyCode()) {
-                case KeyEvent.KEYCODE_HEADSETHOOK:
-                case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
-                    context.startService(new Intent(MusicService.ACTION_TOGGLE_PLAYBACK));
-                    break;
-                case KeyEvent.KEYCODE_MEDIA_PLAY:
-                    context.startService(new Intent(MusicService.ACTION_PLAY));
-                    break;
-                case KeyEvent.KEYCODE_MEDIA_PAUSE:
-                    context.startService(new Intent(MusicService.ACTION_PAUSE));
-                    break;
-                case KeyEvent.KEYCODE_MEDIA_STOP:
-                    context.startService(new Intent(MusicService.ACTION_STOP));
-                    break;
-                case KeyEvent.KEYCODE_MEDIA_NEXT:
-                    context.startService(new Intent(MusicService.ACTION_SKIP));
-                    break;
-                case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
-                    // TODO: ensure that doing this in rapid succession actually plays the
-                    // previous song
-                    context.startService(new Intent(MusicService.ACTION_REWIND));
-                    break;
-            }
-        }
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicRetriever.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicRetriever.java
deleted file mode 100644
index 5e6f2f1..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicRetriever.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*   
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.database.Cursor;
-import android.net.Uri;
-import android.provider.MediaStore;
-import android.util.Log;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-/**
- * Retrieves and organizes media to play. Before being used, you must call {@link #prepare()},
- * which will retrieve all of the music on the user's device (by performing a query on a content
- * resolver). After that, it's ready to retrieve a random song, with its title and URI, upon
- * request.
- */
-public class MusicRetriever {
-    final String TAG = "MusicRetriever";
-
-    ContentResolver mContentResolver;
-
-    // the items (songs) we have queried
-    List<Item> mItems = new ArrayList<Item>();
-
-    Random mRandom = new Random();
-
-    public MusicRetriever(ContentResolver cr) {
-        mContentResolver = cr;
-    }
-
-    /**
-     * Loads music data. This method may take long, so be sure to call it asynchronously without
-     * blocking the main thread.
-     */
-    public void prepare() {
-        Uri uri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
-        Log.i(TAG, "Querying media...");
-        Log.i(TAG, "URI: " + uri.toString());
-
-        // Perform a query on the content resolver. The URI we're passing specifies that we
-        // want to query for all audio media on external storage (e.g. SD card)
-        Cursor cur = mContentResolver.query(uri, null,
-                MediaStore.Audio.Media.IS_MUSIC + " = 1", null, null);
-        Log.i(TAG, "Query finished. " + (cur == null ? "Returned NULL." : "Returned a cursor."));
-
-        if (cur == null) {
-            // Query failed...
-            Log.e(TAG, "Failed to retrieve music: cursor is null :-(");
-            return;
-        }
-        if (!cur.moveToFirst()) {
-            // Nothing to query. There is no music on the device. How boring.
-            Log.e(TAG, "Failed to move cursor to first row (no query results).");
-            return;
-        }
-
-        Log.i(TAG, "Listing...");
-
-        // retrieve the indices of the columns where the ID, title, etc. of the song are
-        int artistColumn = cur.getColumnIndex(MediaStore.Audio.Media.ARTIST);
-        int titleColumn = cur.getColumnIndex(MediaStore.Audio.Media.TITLE);
-        int albumColumn = cur.getColumnIndex(MediaStore.Audio.Media.ALBUM);
-        int durationColumn = cur.getColumnIndex(MediaStore.Audio.Media.DURATION);
-        int idColumn = cur.getColumnIndex(MediaStore.Audio.Media._ID);
-
-        Log.i(TAG, "Title column index: " + String.valueOf(titleColumn));
-        Log.i(TAG, "ID column index: " + String.valueOf(titleColumn));
-
-        // add each song to mItems
-        do {
-            Log.i(TAG, "ID: " + cur.getString(idColumn) + " Title: " + cur.getString(titleColumn));
-            mItems.add(new Item(
-                    cur.getLong(idColumn),
-                    cur.getString(artistColumn),
-                    cur.getString(titleColumn),
-                    cur.getString(albumColumn),
-                    cur.getLong(durationColumn)));
-        } while (cur.moveToNext());
-
-        Log.i(TAG, "Done querying media. MusicRetriever is ready.");
-    }
-
-    public ContentResolver getContentResolver() {
-        return mContentResolver;
-    }
-
-    /** Returns a random Item. If there are no items available, returns null. */
-    public Item getRandomItem() {
-        if (mItems.size() <= 0) return null;
-        return mItems.get(mRandom.nextInt(mItems.size()));
-    }
-
-    public static class Item {
-        long id;
-        String artist;
-        String title;
-        String album;
-        long duration;
-
-        public Item(long id, String artist, String title, String album, long duration) {
-            this.id = id;
-            this.artist = artist;
-            this.title = title;
-            this.album = album;
-            this.duration = duration;
-        }
-
-        public long getId() {
-            return id;
-        }
-
-        public String getArtist() {
-            return artist;
-        }
-
-        public String getTitle() {
-            return title;
-        }
-
-        public String getAlbum() {
-            return album;
-        }
-
-        public long getDuration() {
-            return duration;
-        }
-
-        public Uri getURI() {
-            return ContentUris.withAppendedId(
-                    android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, id);
-        }
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicService.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicService.java
deleted file mode 100644
index 5c3ccf4..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/MusicService.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/*   
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.app.Service;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.media.AudioManager;
-import android.media.MediaMetadataRetriever;
-import android.media.MediaPlayer;
-import android.media.MediaPlayer.OnCompletionListener;
-import android.media.MediaPlayer.OnErrorListener;
-import android.media.MediaPlayer.OnPreparedListener;
-import android.media.RemoteControlClient;
-import android.net.Uri;
-import android.net.wifi.WifiManager;
-import android.net.wifi.WifiManager.WifiLock;
-import android.os.IBinder;
-import android.os.PowerManager;
-import android.util.Log;
-import android.widget.Toast;
-
-import java.io.IOException;
-
-/**
- * Service that handles media playback. This is the Service through which we perform all the media
- * handling in our application. Upon initialization, it starts a {@link MusicRetriever} to scan
- * the user's media. Then, it waits for Intents (which come from our main activity,
- * {@link MainActivity}, which signal the service to perform specific operations: Play, Pause,
- * Rewind, Skip, etc.
- */
-public class MusicService extends Service implements OnCompletionListener, OnPreparedListener,
-                OnErrorListener, MusicFocusable,
-                PrepareMusicRetrieverTask.MusicRetrieverPreparedListener {
-
-    // The tag we put on debug messages
-    final static String TAG = "RandomMusicPlayer";
-
-    // These are the Intent actions that we are prepared to handle. Notice that the fact these
-    // constants exist in our class is a mere convenience: what really defines the actions our
-    // service can handle are the <action> tags in the <intent-filters> tag for our service in
-    // AndroidManifest.xml.
-    public static final String ACTION_TOGGLE_PLAYBACK =
-            "com.example.android.musicplayer.action.TOGGLE_PLAYBACK";
-    public static final String ACTION_PLAY = "com.example.android.musicplayer.action.PLAY";
-    public static final String ACTION_PAUSE = "com.example.android.musicplayer.action.PAUSE";
-    public static final String ACTION_STOP = "com.example.android.musicplayer.action.STOP";
-    public static final String ACTION_SKIP = "com.example.android.musicplayer.action.SKIP";
-    public static final String ACTION_REWIND = "com.example.android.musicplayer.action.REWIND";
-    public static final String ACTION_URL = "com.example.android.musicplayer.action.URL";
-
-    // The volume we set the media player to when we lose audio focus, but are allowed to reduce
-    // the volume instead of stopping playback.
-    public static final float DUCK_VOLUME = 0.1f;
-
-    // our media player
-    MediaPlayer mPlayer = null;
-
-    // our AudioFocusHelper object, if it's available (it's available on SDK level >= 8)
-    // If not available, this will be null. Always check for null before using!
-    AudioFocusHelper mAudioFocusHelper = null;
-
-    // indicates the state our service:
-    enum State {
-        Retrieving, // the MediaRetriever is retrieving music
-        Stopped,    // media player is stopped and not prepared to play
-        Preparing,  // media player is preparing...
-        Playing,    // playback active (media player ready!). (but the media player may actually be
-                    // paused in this state if we don't have audio focus. But we stay in this state
-                    // so that we know we have to resume playback once we get focus back)
-        Paused      // playback paused (media player ready!)
-    };
-
-    State mState = State.Retrieving;
-
-    // if in Retrieving mode, this flag indicates whether we should start playing immediately
-    // when we are ready or not.
-    boolean mStartPlayingAfterRetrieve = false;
-
-    // if mStartPlayingAfterRetrieve is true, this variable indicates the URL that we should
-    // start playing when we are ready. If null, we should play a random song from the device
-    Uri mWhatToPlayAfterRetrieve = null;
-
-    enum PauseReason {
-        UserRequest,  // paused by user request
-        FocusLoss,    // paused because of audio focus loss
-    };
-
-    // why did we pause? (only relevant if mState == State.Paused)
-    PauseReason mPauseReason = PauseReason.UserRequest;
-
-    // do we have audio focus?
-    enum AudioFocus {
-        NoFocusNoDuck,    // we don't have audio focus, and can't duck
-        NoFocusCanDuck,   // we don't have focus, but can play at a low volume ("ducking")
-        Focused           // we have full audio focus
-    }
-    AudioFocus mAudioFocus = AudioFocus.NoFocusNoDuck;
-
-    // title of the song we are currently playing
-    String mSongTitle = "";
-
-    // whether the song we are playing is streaming from the network
-    boolean mIsStreaming = false;
-
-    // Wifi lock that we hold when streaming files from the internet, in order to prevent the
-    // device from shutting off the Wifi radio
-    WifiLock mWifiLock;
-
-    // The ID we use for the notification (the onscreen alert that appears at the notification
-    // area at the top of the screen as an icon -- and as text as well if the user expands the
-    // notification area).
-    final int NOTIFICATION_ID = 1;
-
-    // Our instance of our MusicRetriever, which handles scanning for media and
-    // providing titles and URIs as we need.
-    MusicRetriever mRetriever;
-
-    // our RemoteControlClient object, which will use remote control APIs available in
-    // SDK level >= 14, if they're available.
-    RemoteControlClientCompat mRemoteControlClientCompat;
-
-    // Dummy album art we will pass to the remote control (if the APIs are available).
-    Bitmap mDummyAlbumArt;
-
-    // The component name of MusicIntentReceiver, for use with media button and remote control
-    // APIs
-    ComponentName mMediaButtonReceiverComponent;
-
-    AudioManager mAudioManager;
-    NotificationManager mNotificationManager;
-
-    Notification.Builder mNotificationBuilder = null;
-
-    /**
-     * Makes sure the media player exists and has been reset. This will create the media player
-     * if needed, or reset the existing media player if one already exists.
-     */
-    void createMediaPlayerIfNeeded() {
-        if (mPlayer == null) {
-            mPlayer = new MediaPlayer();
-
-            // Make sure the media player will acquire a wake-lock while playing. If we don't do
-            // that, the CPU might go to sleep while the song is playing, causing playback to stop.
-            //
-            // Remember that to use this, we have to declare the android.permission.WAKE_LOCK
-            // permission in AndroidManifest.xml.
-            mPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
-
-            // we want the media player to notify us when it's ready preparing, and when it's done
-            // playing:
-            mPlayer.setOnPreparedListener(this);
-            mPlayer.setOnCompletionListener(this);
-            mPlayer.setOnErrorListener(this);
-        }
-        else
-            mPlayer.reset();
-    }
-
-    @Override
-    public void onCreate() {
-        Log.i(TAG, "debug: Creating service");
-
-        // Create the Wifi lock (this does not acquire the lock, this just creates it)
-        mWifiLock = ((WifiManager) getSystemService(Context.WIFI_SERVICE))
-                        .createWifiLock(WifiManager.WIFI_MODE_FULL, "mylock");
-
-        mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
-        mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
-
-        // Create the retriever and start an asynchronous task that will prepare it.
-        mRetriever = new MusicRetriever(getContentResolver());
-        (new PrepareMusicRetrieverTask(mRetriever,this)).execute();
-
-        // create the Audio Focus Helper, if the Audio Focus feature is available (SDK 8 or above)
-        if (android.os.Build.VERSION.SDK_INT >= 8)
-            mAudioFocusHelper = new AudioFocusHelper(getApplicationContext(), this);
-        else
-            mAudioFocus = AudioFocus.Focused; // no focus feature, so we always "have" audio focus
-
-        mDummyAlbumArt = BitmapFactory.decodeResource(getResources(), R.drawable.dummy_album_art);
-
-        mMediaButtonReceiverComponent = new ComponentName(this, MusicIntentReceiver.class);
-    }
-
-    /**
-     * Called when we receive an Intent. When we receive an intent sent to us via startService(),
-     * this is the method that gets called. So here we react appropriately depending on the
-     * Intent's action, which specifies what is being requested of us.
-     */
-    @Override
-    public int onStartCommand(Intent intent, int flags, int startId) {
-        String action = intent.getAction();
-        if (action.equals(ACTION_TOGGLE_PLAYBACK)) processTogglePlaybackRequest();
-        else if (action.equals(ACTION_PLAY)) processPlayRequest();
-        else if (action.equals(ACTION_PAUSE)) processPauseRequest();
-        else if (action.equals(ACTION_SKIP)) processSkipRequest();
-        else if (action.equals(ACTION_STOP)) processStopRequest();
-        else if (action.equals(ACTION_REWIND)) processRewindRequest();
-        else if (action.equals(ACTION_URL)) processAddRequest(intent);
-
-        return START_NOT_STICKY; // Means we started the service, but don't want it to
-                                 // restart in case it's killed.
-    }
-
-    void processTogglePlaybackRequest() {
-        if (mState == State.Paused || mState == State.Stopped) {
-            processPlayRequest();
-        } else {
-            processPauseRequest();
-        }
-    }
-
-    void processPlayRequest() {
-        if (mState == State.Retrieving) {
-            // If we are still retrieving media, just set the flag to start playing when we're
-            // ready
-            mWhatToPlayAfterRetrieve = null; // play a random song
-            mStartPlayingAfterRetrieve = true;
-            return;
-        }
-
-        tryToGetAudioFocus();
-
-        // actually play the song
-
-        if (mState == State.Stopped) {
-            // If we're stopped, just go ahead to the next song and start playing
-            playNextSong(null);
-        }
-        else if (mState == State.Paused) {
-            // If we're paused, just continue playback and restore the 'foreground service' state.
-            mState = State.Playing;
-            setUpAsForeground(mSongTitle + " (playing)");
-            configAndStartMediaPlayer();
-        }
-
-        // Tell any remote controls that our playback state is 'playing'.
-        if (mRemoteControlClientCompat != null) {
-            mRemoteControlClientCompat
-                    .setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
-        }
-    }
-
-    void processPauseRequest() {
-        if (mState == State.Retrieving) {
-            // If we are still retrieving media, clear the flag that indicates we should start
-            // playing when we're ready
-            mStartPlayingAfterRetrieve = false;
-            return;
-        }
-
-        if (mState == State.Playing) {
-            // Pause media player and cancel the 'foreground service' state.
-            mState = State.Paused;
-            mPlayer.pause();
-            relaxResources(false); // while paused, we always retain the MediaPlayer
-            // do not give up audio focus
-        }
-
-        // Tell any remote controls that our playback state is 'paused'.
-        if (mRemoteControlClientCompat != null) {
-            mRemoteControlClientCompat
-                    .setPlaybackState(RemoteControlClient.PLAYSTATE_PAUSED);
-        }
-    }
-
-    void processRewindRequest() {
-        if (mState == State.Playing || mState == State.Paused)
-            mPlayer.seekTo(0);
-    }
-
-    void processSkipRequest() {
-        if (mState == State.Playing || mState == State.Paused) {
-            tryToGetAudioFocus();
-            playNextSong(null);
-        }
-    }
-
-    void processStopRequest() {
-        processStopRequest(false);
-    }
-
-    void processStopRequest(boolean force) {
-        if (mState == State.Playing || mState == State.Paused || force) {
-            mState = State.Stopped;
-
-            // let go of all resources...
-            relaxResources(true);
-            giveUpAudioFocus();
-
-            // Tell any remote controls that our playback state is 'paused'.
-            if (mRemoteControlClientCompat != null) {
-                mRemoteControlClientCompat
-                        .setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);
-            }
-
-            // service is no longer necessary. Will be started again if needed.
-            stopSelf();
-        }
-    }
-
-    /**
-     * Releases resources used by the service for playback. This includes the "foreground service"
-     * status and notification, the wake locks and possibly the MediaPlayer.
-     *
-     * @param releaseMediaPlayer Indicates whether the Media Player should also be released or not
-     */
-    void relaxResources(boolean releaseMediaPlayer) {
-        // stop being a foreground service
-        stopForeground(true);
-
-        // stop and release the Media Player, if it's available
-        if (releaseMediaPlayer && mPlayer != null) {
-            mPlayer.reset();
-            mPlayer.release();
-            mPlayer = null;
-        }
-
-        // we can also release the Wifi lock, if we're holding it
-        if (mWifiLock.isHeld()) mWifiLock.release();
-    }
-
-    void giveUpAudioFocus() {
-        if (mAudioFocus == AudioFocus.Focused && mAudioFocusHelper != null
-                                && mAudioFocusHelper.abandonFocus())
-            mAudioFocus = AudioFocus.NoFocusNoDuck;
-    }
-
-    /**
-     * Reconfigures MediaPlayer according to audio focus settings and starts/restarts it. This
-     * method starts/restarts the MediaPlayer respecting the current audio focus state. So if
-     * we have focus, it will play normally; if we don't have focus, it will either leave the
-     * MediaPlayer paused or set it to a low volume, depending on what is allowed by the
-     * current focus settings. This method assumes mPlayer != null, so if you are calling it,
-     * you have to do so from a context where you are sure this is the case.
-     */
-    void configAndStartMediaPlayer() {
-        if (mAudioFocus == AudioFocus.NoFocusNoDuck) {
-            // If we don't have audio focus and can't duck, we have to pause, even if mState
-            // is State.Playing. But we stay in the Playing state so that we know we have to resume
-            // playback once we get the focus back.
-            if (mPlayer.isPlaying()) mPlayer.pause();
-            return;
-        }
-        else if (mAudioFocus == AudioFocus.NoFocusCanDuck)
-            mPlayer.setVolume(DUCK_VOLUME, DUCK_VOLUME);  // we'll be relatively quiet
-        else
-            mPlayer.setVolume(1.0f, 1.0f); // we can be loud
-
-        if (!mPlayer.isPlaying()) mPlayer.start();
-    }
-
-    void processAddRequest(Intent intent) {
-        // user wants to play a song directly by URL or path. The URL or path comes in the "data"
-        // part of the Intent. This Intent is sent by {@link MainActivity} after the user
-        // specifies the URL/path via an alert box.
-        if (mState == State.Retrieving) {
-            // we'll play the requested URL right after we finish retrieving
-            mWhatToPlayAfterRetrieve = intent.getData();
-            mStartPlayingAfterRetrieve = true;
-        }
-        else if (mState == State.Playing || mState == State.Paused || mState == State.Stopped) {
-            Log.i(TAG, "Playing from URL/path: " + intent.getData().toString());
-            tryToGetAudioFocus();
-            playNextSong(intent.getData().toString());
-        }
-    }
-
-    void tryToGetAudioFocus() {
-        if (mAudioFocus != AudioFocus.Focused && mAudioFocusHelper != null
-                        && mAudioFocusHelper.requestFocus())
-            mAudioFocus = AudioFocus.Focused;
-    }
-
-    /**
-     * Starts playing the next song. If manualUrl is null, the next song will be randomly selected
-     * from our Media Retriever (that is, it will be a random song in the user's device). If
-     * manualUrl is non-null, then it specifies the URL or path to the song that will be played
-     * next.
-     */
-    void playNextSong(String manualUrl) {
-        mState = State.Stopped;
-        relaxResources(false); // release everything except MediaPlayer
-
-        try {
-            MusicRetriever.Item playingItem = null;
-            if (manualUrl != null) {
-                // set the source of the media player to a manual URL or path
-                createMediaPlayerIfNeeded();
-                mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
-                mPlayer.setDataSource(manualUrl);
-                mIsStreaming = manualUrl.startsWith("http:") || manualUrl.startsWith("https:");
-
-                playingItem = new MusicRetriever.Item(0, null, manualUrl, null, 0);
-            }
-            else {
-                mIsStreaming = false; // playing a locally available song
-
-                playingItem = mRetriever.getRandomItem();
-                if (playingItem == null) {
-                    Toast.makeText(this,
-                            "No available music to play. Place some music on your external storage "
-                            + "device (e.g. your SD card) and try again.",
-                            Toast.LENGTH_LONG).show();
-                    processStopRequest(true); // stop everything!
-                    return;
-                }
-
-                // set the source of the media player a a content URI
-                createMediaPlayerIfNeeded();
-                mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
-                mPlayer.setDataSource(getApplicationContext(), playingItem.getURI());
-            }
-
-            mSongTitle = playingItem.getTitle();
-
-            mState = State.Preparing;
-            setUpAsForeground(mSongTitle + " (loading)");
-
-            // Use the media button APIs (if available) to register ourselves for media button
-            // events
-
-            MediaButtonHelper.registerMediaButtonEventReceiverCompat(
-                    mAudioManager, mMediaButtonReceiverComponent);
-
-            // Use the remote control APIs (if available) to set the playback state
-
-            if (mRemoteControlClientCompat == null) {
-                Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
-                intent.setComponent(mMediaButtonReceiverComponent);
-                mRemoteControlClientCompat = new RemoteControlClientCompat(
-                        PendingIntent.getBroadcast(this /*context*/,
-                                0 /*requestCode, ignored*/, intent /*intent*/, 0 /*flags*/));
-                RemoteControlHelper.registerRemoteControlClient(mAudioManager,
-                        mRemoteControlClientCompat);
-            }
-
-            mRemoteControlClientCompat.setPlaybackState(
-                    RemoteControlClient.PLAYSTATE_PLAYING);
-
-            mRemoteControlClientCompat.setTransportControlFlags(
-                    RemoteControlClient.FLAG_KEY_MEDIA_PLAY |
-                    RemoteControlClient.FLAG_KEY_MEDIA_PAUSE |
-                    RemoteControlClient.FLAG_KEY_MEDIA_NEXT |
-                    RemoteControlClient.FLAG_KEY_MEDIA_STOP);
-
-            // Update the remote controls
-            mRemoteControlClientCompat.editMetadata(true)
-                    .putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, playingItem.getArtist())
-                    .putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, playingItem.getAlbum())
-                    .putString(MediaMetadataRetriever.METADATA_KEY_TITLE, playingItem.getTitle())
-                    .putLong(MediaMetadataRetriever.METADATA_KEY_DURATION,
-                            playingItem.getDuration())
-                    // TODO: fetch real item artwork
-                    .putBitmap(
-                            RemoteControlClientCompat.MetadataEditorCompat.METADATA_KEY_ARTWORK,
-                            mDummyAlbumArt)
-                    .apply();
-
-            // starts preparing the media player in the background. When it's done, it will call
-            // our OnPreparedListener (that is, the onPrepared() method on this class, since we set
-            // the listener to 'this').
-            //
-            // Until the media player is prepared, we *cannot* call start() on it!
-            mPlayer.prepareAsync();
-
-            // If we are streaming from the internet, we want to hold a Wifi lock, which prevents
-            // the Wifi radio from going to sleep while the song is playing. If, on the other hand,
-            // we are *not* streaming, we want to release the lock if we were holding it before.
-            if (mIsStreaming) mWifiLock.acquire();
-            else if (mWifiLock.isHeld()) mWifiLock.release();
-        }
-        catch (IOException ex) {
-            Log.e("MusicService", "IOException playing next song: " + ex.getMessage());
-            ex.printStackTrace();
-        }
-    }
-
-    /** Called when media player is done playing current song. */
-    public void onCompletion(MediaPlayer player) {
-        // The media player finished playing the current song, so we go ahead and start the next.
-        playNextSong(null);
-    }
-
-    /** Called when media player is done preparing. */
-    public void onPrepared(MediaPlayer player) {
-        // The media player is done preparing. That means we can start playing!
-        mState = State.Playing;
-        updateNotification(mSongTitle + " (playing)");
-        configAndStartMediaPlayer();
-    }
-
-    /** Updates the notification. */
-    void updateNotification(String text) {
-        PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0,
-                new Intent(getApplicationContext(), MainActivity.class),
-                PendingIntent.FLAG_UPDATE_CURRENT);
-        mNotificationBuilder.setContentText(text)
-                .setContentIntent(pi);
-        mNotificationManager.notify(NOTIFICATION_ID, mNotificationBuilder.build());
-    }
-
-    /**
-     * Configures service as a foreground service. A foreground service is a service that's doing
-     * something the user is actively aware of (such as playing music), and must appear to the
-     * user as a notification. That's why we create the notification here.
-     */
-    void setUpAsForeground(String text) {
-        PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0,
-                new Intent(getApplicationContext(), MainActivity.class),
-                PendingIntent.FLAG_UPDATE_CURRENT);
-
-        // Build the notification object.
-        mNotificationBuilder = new Notification.Builder(getApplicationContext())
-                .setSmallIcon(R.drawable.ic_stat_playing)
-                .setTicker(text)
-                .setWhen(System.currentTimeMillis())
-                .setContentTitle("RandomMusicPlayer")
-                .setContentText(text)
-                .setContentIntent(pi)
-                .setOngoing(true);
-
-        startForeground(NOTIFICATION_ID, mNotificationBuilder.build());
-    }
-
-    /**
-     * Called when there's an error playing media. When this happens, the media player goes to
-     * the Error state. We warn the user about the error and reset the media player.
-     */
-    public boolean onError(MediaPlayer mp, int what, int extra) {
-        Toast.makeText(getApplicationContext(), "Media player error! Resetting.",
-            Toast.LENGTH_SHORT).show();
-        Log.e(TAG, "Error: what=" + String.valueOf(what) + ", extra=" + String.valueOf(extra));
-
-        mState = State.Stopped;
-        relaxResources(true);
-        giveUpAudioFocus();
-        return true; // true indicates we handled the error
-    }
-
-    public void onGainedAudioFocus() {
-        Toast.makeText(getApplicationContext(), "gained audio focus.", Toast.LENGTH_SHORT).show();
-        mAudioFocus = AudioFocus.Focused;
-
-        // restart media player with new focus settings
-        if (mState == State.Playing)
-            configAndStartMediaPlayer();
-    }
-
-    public void onLostAudioFocus(boolean canDuck) {
-        Toast.makeText(getApplicationContext(), "lost audio focus." + (canDuck ? "can duck" :
-            "no duck"), Toast.LENGTH_SHORT).show();
-        mAudioFocus = canDuck ? AudioFocus.NoFocusCanDuck : AudioFocus.NoFocusNoDuck;
-
-        // start/restart/pause media player with new focus settings
-        if (mPlayer != null && mPlayer.isPlaying())
-            configAndStartMediaPlayer();
-    }
-
-    public void onMusicRetrieverPrepared() {
-        // Done retrieving!
-        mState = State.Stopped;
-
-        // If the flag indicates we should start playing after retrieving, let's do that now.
-        if (mStartPlayingAfterRetrieve) {
-            tryToGetAudioFocus();
-            playNextSong(mWhatToPlayAfterRetrieve == null ?
-                    null : mWhatToPlayAfterRetrieve.toString());
-        }
-    }
-
-
-    @Override
-    public void onDestroy() {
-        // Service is being killed, so make sure we release our resources
-        mState = State.Stopped;
-        relaxResources(true);
-        giveUpAudioFocus();
-    }
-
-    @Override
-    public IBinder onBind(Intent arg0) {
-        return null;
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/PrepareMusicRetrieverTask.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/PrepareMusicRetrieverTask.java
deleted file mode 100644
index fd114c8..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/PrepareMusicRetrieverTask.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*   
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.os.AsyncTask;
-
-/**
- * Asynchronous task that prepares a MusicRetriever. This asynchronous task essentially calls
- * {@link MusicRetriever#prepare()} on a {@link MusicRetriever}, which may take some time to
- * run. Upon finishing, it notifies the indicated {@MusicRetrieverPreparedListener}.
- */
-public class PrepareMusicRetrieverTask extends AsyncTask<Void, Void, Void> {
-    MusicRetriever mRetriever;
-    MusicRetrieverPreparedListener mListener;
-
-    public PrepareMusicRetrieverTask(MusicRetriever retriever,
-            MusicRetrieverPreparedListener listener) {
-        mRetriever = retriever;
-        mListener = listener;
-    }
-
-    @Override
-    protected Void doInBackground(Void... arg0) {
-        mRetriever.prepare();
-        return null;
-    }
-
-    @Override
-    protected void onPostExecute(Void result) {
-        mListener.onMusicRetrieverPrepared();
-    }
-
-    public interface MusicRetrieverPreparedListener {
-        public void onMusicRetrieverPrepared();
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/RemoteControlClientCompat.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/RemoteControlClientCompat.java
deleted file mode 100644
index 9541a91..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/RemoteControlClientCompat.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.app.PendingIntent;
-import android.graphics.Bitmap;
-import android.os.Looper;
-import android.util.Log;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-/**
- * RemoteControlClient enables exposing information meant to be consumed by remote controls capable
- * of displaying metadata, artwork and media transport control buttons. A remote control client
- * object is associated with a media button event receiver. This event receiver must have been
- * previously registered with
- * {@link android.media.AudioManager#registerMediaButtonEventReceiver(android.content.ComponentName)}
- * before the RemoteControlClient can be registered through
- * {@link android.media.AudioManager#registerRemoteControlClient(android.media.RemoteControlClient)}.
- */
-@SuppressWarnings({"rawtypes", "unchecked"})
-public class RemoteControlClientCompat {
-
-    private static final String TAG = "RemoteControlCompat";
-
-    private static Class sRemoteControlClientClass;
-
-    // RCC short for RemoteControlClient
-    private static Method sRCCEditMetadataMethod;
-    private static Method sRCCSetPlayStateMethod;
-    private static Method sRCCSetTransportControlFlags;
-
-    private static boolean sHasRemoteControlAPIs = false;
-
-    static {
-        try {
-            ClassLoader classLoader = RemoteControlClientCompat.class.getClassLoader();
-            sRemoteControlClientClass = getActualRemoteControlClientClass(classLoader);
-            // dynamically populate the playstate and flag values in case they change
-            // in future versions.
-            for (Field field : RemoteControlClientCompat.class.getFields()) {
-                try {
-                    Field realField = sRemoteControlClientClass.getField(field.getName());
-                    Object realValue = realField.get(null);
-                    field.set(null, realValue);
-                } catch (NoSuchFieldException e) {
-                    Log.w(TAG, "Could not get real field: " + field.getName());
-                } catch (IllegalArgumentException e) {
-                    Log.w(TAG, "Error trying to pull field value for: " + field.getName()
-                            + " " + e.getMessage());
-                } catch (IllegalAccessException e) {
-                    Log.w(TAG, "Error trying to pull field value for: " + field.getName()
-                            + " " + e.getMessage());
-                }
-            }
-
-            // get the required public methods on RemoteControlClient
-            sRCCEditMetadataMethod = sRemoteControlClientClass.getMethod("editMetadata",
-                    boolean.class);
-            sRCCSetPlayStateMethod = sRemoteControlClientClass.getMethod("setPlaybackState",
-                    int.class);
-            sRCCSetTransportControlFlags = sRemoteControlClientClass.getMethod(
-                    "setTransportControlFlags", int.class);
-
-            sHasRemoteControlAPIs = true;
-        } catch (ClassNotFoundException e) {
-            // Silently fail when running on an OS before ICS.
-        } catch (NoSuchMethodException e) {
-            // Silently fail when running on an OS before ICS.
-        } catch (IllegalArgumentException e) {
-            // Silently fail when running on an OS before ICS.
-        } catch (SecurityException e) {
-            // Silently fail when running on an OS before ICS.
-        }
-    }
-
-    public static Class getActualRemoteControlClientClass(ClassLoader classLoader)
-            throws ClassNotFoundException {
-        return classLoader.loadClass("android.media.RemoteControlClient");
-    }
-
-    private Object mActualRemoteControlClient;
-
-    public RemoteControlClientCompat(PendingIntent pendingIntent) {
-        if (!sHasRemoteControlAPIs) {
-            return;
-        }
-        try {
-            mActualRemoteControlClient =
-                    sRemoteControlClientClass.getConstructor(PendingIntent.class)
-                            .newInstance(pendingIntent);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public RemoteControlClientCompat(PendingIntent pendingIntent, Looper looper) {
-        if (!sHasRemoteControlAPIs) {
-            return;
-        }
-
-        try {
-            mActualRemoteControlClient =
-                    sRemoteControlClientClass.getConstructor(PendingIntent.class, Looper.class)
-                            .newInstance(pendingIntent, looper);
-        } catch (Exception e) {
-            Log.e(TAG, "Error creating new instance of " + sRemoteControlClientClass.getName(), e);
-        }
-    }
-
-    /**
-     * Class used to modify metadata in a {@link android.media.RemoteControlClient} object. Use
-     * {@link android.media.RemoteControlClient#editMetadata(boolean)} to create an instance of an
-     * editor, on which you set the metadata for the RemoteControlClient instance. Once all the
-     * information has been set, use {@link #apply()} to make it the new metadata that should be
-     * displayed for the associated client. Once the metadata has been "applied", you cannot reuse
-     * this instance of the MetadataEditor.
-     */
-    public class MetadataEditorCompat {
-
-        private Method mPutStringMethod;
-        private Method mPutBitmapMethod;
-        private Method mPutLongMethod;
-        private Method mClearMethod;
-        private Method mApplyMethod;
-
-        private Object mActualMetadataEditor;
-
-        /**
-         * The metadata key for the content artwork / album art.
-         */
-        public final static int METADATA_KEY_ARTWORK = 100;
-
-        private MetadataEditorCompat(Object actualMetadataEditor) {
-            if (sHasRemoteControlAPIs && actualMetadataEditor == null) {
-                throw new IllegalArgumentException("Remote Control API's exist, " +
-                        "should not be given a null MetadataEditor");
-            }
-            if (sHasRemoteControlAPIs) {
-                Class metadataEditorClass = actualMetadataEditor.getClass();
-
-                try {
-                    mPutStringMethod = metadataEditorClass.getMethod("putString",
-                            int.class, String.class);
-                    mPutBitmapMethod = metadataEditorClass.getMethod("putBitmap",
-                            int.class, Bitmap.class);
-                    mPutLongMethod = metadataEditorClass.getMethod("putLong",
-                            int.class, long.class);
-                    mClearMethod = metadataEditorClass.getMethod("clear", new Class[]{});
-                    mApplyMethod = metadataEditorClass.getMethod("apply", new Class[]{});
-                } catch (Exception e) {
-                    throw new RuntimeException(e.getMessage(), e);
-                }
-            }
-            mActualMetadataEditor = actualMetadataEditor;
-        }
-
-        /**
-         * Adds textual information to be displayed.
-         * Note that none of the information added after {@link #apply()} has been called,
-         * will be displayed.
-         * @param key The identifier of a the metadata field to set. Valid values are
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_ALBUM},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_ALBUMARTIST},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_TITLE},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_ARTIST},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_AUTHOR},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_COMPILATION},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_COMPOSER},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_DATE},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_GENRE},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_TITLE},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_WRITER}.
-         * @param value The text for the given key, or {@code null} to signify there is no valid
-         *      information for the field.
-         * @return Returns a reference to the same MetadataEditor object, so you can chain put
-         *      calls together.
-         */
-        public MetadataEditorCompat putString(int key, String value) {
-            if (sHasRemoteControlAPIs) {
-                try {
-                    mPutStringMethod.invoke(mActualMetadataEditor, key, value);
-                } catch (Exception e) {
-                    throw new RuntimeException(e.getMessage(), e);
-                }
-            }
-            return this;
-        }
-
-        /**
-         * Sets the album / artwork picture to be displayed on the remote control.
-         * @param key the identifier of the bitmap to set. The only valid value is
-         *      {@link #METADATA_KEY_ARTWORK}
-         * @param bitmap The bitmap for the artwork, or null if there isn't any.
-         * @return Returns a reference to the same MetadataEditor object, so you can chain put
-         *      calls together.
-         * @throws IllegalArgumentException
-         * @see android.graphics.Bitmap
-         */
-        public MetadataEditorCompat putBitmap(int key, Bitmap bitmap) {
-            if (sHasRemoteControlAPIs) {
-                try {
-                    mPutBitmapMethod.invoke(mActualMetadataEditor, key, bitmap);
-                } catch (Exception e) {
-                    throw new RuntimeException(e.getMessage(), e);
-                }
-            }
-            return this;
-        }
-
-        /**
-         * Adds numerical information to be displayed.
-         * Note that none of the information added after {@link #apply()} has been called,
-         * will be displayed.
-         * @param key the identifier of a the metadata field to set. Valid values are
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_CD_TRACK_NUMBER},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_DISC_NUMBER},
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_DURATION} (with a value
-         *      expressed in milliseconds),
-         *      {@link android.media.MediaMetadataRetriever#METADATA_KEY_YEAR}.
-         * @param value The long value for the given key
-         * @return Returns a reference to the same MetadataEditor object, so you can chain put
-         *      calls together.
-         * @throws IllegalArgumentException
-         */
-        public MetadataEditorCompat putLong(int key, long value) {
-            if (sHasRemoteControlAPIs) {
-                try {
-                    mPutLongMethod.invoke(mActualMetadataEditor, key, value);
-                } catch (Exception e) {
-                    throw new RuntimeException(e.getMessage(), e);
-                }
-            }
-            return this;
-        }
-
-        /**
-         * Clears all the metadata that has been set since the MetadataEditor instance was
-         * created with {@link android.media.RemoteControlClient#editMetadata(boolean)}.
-         */
-        public void clear() {
-            if (sHasRemoteControlAPIs) {
-                try {
-                    mClearMethod.invoke(mActualMetadataEditor, (Object[]) null);
-                } catch (Exception e) {
-                    throw new RuntimeException(e.getMessage(), e);
-                }
-            }
-        }
-
-        /**
-         * Associates all the metadata that has been set since the MetadataEditor instance was
-         * created with {@link android.media.RemoteControlClient#editMetadata(boolean)}, or since
-         * {@link #clear()} was called, with the RemoteControlClient. Once "applied", this
-         * MetadataEditor cannot be reused to edit the RemoteControlClient's metadata.
-         */
-        public void apply() {
-            if (sHasRemoteControlAPIs) {
-                try {
-                    mApplyMethod.invoke(mActualMetadataEditor, (Object[]) null);
-                } catch (Exception e) {
-                    throw new RuntimeException(e.getMessage(), e);
-                }
-            }
-        }
-    }
-
-    /**
-     * Creates a {@link android.media.RemoteControlClient.MetadataEditor}.
-     * @param startEmpty Set to false if you want the MetadataEditor to contain the metadata that
-     *     was previously applied to the RemoteControlClient, or true if it is to be created empty.
-     * @return a new MetadataEditor instance.
-     */
-    public MetadataEditorCompat editMetadata(boolean startEmpty) {
-        Object metadataEditor;
-        if (sHasRemoteControlAPIs) {
-            try {
-                metadataEditor = sRCCEditMetadataMethod.invoke(mActualRemoteControlClient,
-                        startEmpty);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        } else {
-            metadataEditor = null;
-        }
-        return new MetadataEditorCompat(metadataEditor);
-    }
-
-    /**
-     * Sets the current playback state.
-     * @param state The current playback state, one of the following values:
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_STOPPED},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_PAUSED},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_PLAYING},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_FAST_FORWARDING},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_REWINDING},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_SKIPPING_FORWARDS},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_SKIPPING_BACKWARDS},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_BUFFERING},
-     *       {@link android.media.RemoteControlClient#PLAYSTATE_ERROR}.
-     */
-    public void setPlaybackState(int state) {
-        if (sHasRemoteControlAPIs) {
-            try {
-                sRCCSetPlayStateMethod.invoke(mActualRemoteControlClient, state);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    /**
-     * Sets the flags for the media transport control buttons that this client supports.
-     * @param transportControlFlags A combination of the following flags:
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PREVIOUS},
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_REWIND},
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PLAY},
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PLAY_PAUSE},
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_PAUSE},
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_STOP},
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_FAST_FORWARD},
-     *      {@link android.media.RemoteControlClient#FLAG_KEY_MEDIA_NEXT}
-     */
-    public void setTransportControlFlags(int transportControlFlags) {
-        if (sHasRemoteControlAPIs) {
-            try {
-                sRCCSetTransportControlFlags.invoke(mActualRemoteControlClient,
-                        transportControlFlags);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    public final Object getActualRemoteControlClientObject() {
-        return mActualRemoteControlClient;
-    }
-}
diff --git a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/RemoteControlHelper.java b/samples/RandomMusicPlayer/src/com/example/android/musicplayer/RemoteControlHelper.java
deleted file mode 100644
index 714d3c5..0000000
--- a/samples/RandomMusicPlayer/src/com/example/android/musicplayer/RemoteControlHelper.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.musicplayer;
-
-import android.media.AudioManager;
-import android.util.Log;
-
-import java.lang.reflect.Method;
-
-/**
- * Contains methods to handle registering/unregistering remote control clients.  These methods only
- * run on ICS devices.  On previous devices, all methods are no-ops.
- */
-@SuppressWarnings({"unchecked", "rawtypes"})
-public class RemoteControlHelper {
-    private static final String TAG = "RemoteControlHelper";
-
-    private static boolean sHasRemoteControlAPIs = false;
-
-    private static Method sRegisterRemoteControlClientMethod;
-    private static Method sUnregisterRemoteControlClientMethod;
-
-    static {
-        try {
-            ClassLoader classLoader = RemoteControlHelper.class.getClassLoader();
-            Class sRemoteControlClientClass =
-                    RemoteControlClientCompat.getActualRemoteControlClientClass(classLoader);
-            sRegisterRemoteControlClientMethod = AudioManager.class.getMethod(
-                    "registerRemoteControlClient", new Class[]{sRemoteControlClientClass});
-            sUnregisterRemoteControlClientMethod = AudioManager.class.getMethod(
-                    "unregisterRemoteControlClient", new Class[]{sRemoteControlClientClass});
-            sHasRemoteControlAPIs = true;
-        } catch (ClassNotFoundException e) {
-            // Silently fail when running on an OS before ICS.
-        } catch (NoSuchMethodException e) {
-            // Silently fail when running on an OS before ICS.
-        } catch (IllegalArgumentException e) {
-            // Silently fail when running on an OS before ICS.
-        } catch (SecurityException e) {
-            // Silently fail when running on an OS before ICS.
-        }
-    }
-
-    public static void registerRemoteControlClient(AudioManager audioManager,
-            RemoteControlClientCompat remoteControlClient) {
-        if (!sHasRemoteControlAPIs) {
-            return;
-        }
-
-        try {
-            sRegisterRemoteControlClientMethod.invoke(audioManager,
-                    remoteControlClient.getActualRemoteControlClientObject());
-        } catch (Exception e) {
-            Log.e(TAG, e.getMessage(), e);
-        }
-    }
-
-
-    public static void unregisterRemoteControlClient(AudioManager audioManager,
-            RemoteControlClientCompat remoteControlClient) {
-        if (!sHasRemoteControlAPIs) {
-            return;
-        }
-
-        try {
-            sUnregisterRemoteControlClientMethod.invoke(audioManager,
-                    remoteControlClient.getActualRemoteControlClientObject());
-        } catch (Exception e) {
-            Log.e(TAG, e.getMessage(), e);
-        }
-    }
-}
-
diff --git a/samples/ToyVpn/res/layout/form.xml b/samples/ToyVpn/res/layout/form.xml
index 0f62e17..00cd55b 100644
--- a/samples/ToyVpn/res/layout/form.xml
+++ b/samples/ToyVpn/res/layout/form.xml
@@ -31,6 +31,30 @@
         <TextView style="@style/item" android:text="@string/secret"/>
         <EditText style="@style/item" android:id="@+id/secret" android:password="true"/>
 
+        <TextView style="@style/item" android:text="@string/proxyhost"/>
+        <EditText style="@style/item" android:id="@+id/proxyhost"/>
+
+        <TextView style="@style/item" android:text="@string/proxyport"/>
+        <EditText style="@style/item" android:id="@+id/proxyport" android:inputType="number"/>
+
+        <TextView style="@style/item" android:text="@string/packages"/>
+        <RadioGroup
+            style="@style/item"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+            <RadioButton
+                android:id="@+id/allowed"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/allowed"/>
+            <RadioButton
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/disallowed"/>
+        </RadioGroup>
+        <EditText style="@style/item" android:id="@+id/packages"/>
+
         <Button style="@style/item" android:id="@+id/connect" android:text="@string/connect"/>
         <Button style="@style/item" android:id="@+id/disconnect" android:text="@string/disconnect"/>
 
diff --git a/samples/ToyVpn/res/values/strings.xml b/samples/ToyVpn/res/values/strings.xml
index d5e06ba..c084fa5 100644
--- a/samples/ToyVpn/res/values/strings.xml
+++ b/samples/ToyVpn/res/values/strings.xml
@@ -23,8 +23,20 @@
     <string name="secret">Shared Secret:</string>
     <string name="connect">Connect!</string>
     <string name="disconnect">Disconnect!</string>
+    <string name="proxyhost">HTTP proxy hostname</string>
+    <string name="proxyport">HTTP proxy port</string>
+
+    <string name="packages">Packages (comma separated):</string>
+    <string name="allowed">Allow</string>
+    <string name="disallowed">Disallow</string>
 
     <string name="connecting">ToyVPN is connecting...</string>
     <string name="connected">ToyVPN is connected!</string>
     <string name="disconnected">ToyVPN is disconnected!</string>
+    <string name="incomplete_proxy_settings">
+        Incomplete proxy settings. For HTTP proxy we require both hostname and port settings.
+    </string>
+    <string name="unknown_package_names">
+        Some of the specified package names do not correspond to any installed packages.
+    </string>
 </resources>
diff --git a/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnClient.java b/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnClient.java
index c6a72e9..6a4c161 100644
--- a/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnClient.java
+++ b/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnClient.java
@@ -21,7 +21,14 @@
 import android.content.SharedPreferences;
 import android.net.VpnService;
 import android.os.Bundle;
+import android.widget.RadioButton;
 import android.widget.TextView;
+import android.widget.Toast;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 public class ToyVpnClient extends Activity {
     public interface Prefs {
@@ -29,6 +36,10 @@
         String SERVER_ADDRESS = "server.address";
         String SERVER_PORT = "server.port";
         String SHARED_SECRET = "shared.secret";
+        String PROXY_HOSTNAME = "proxyhost";
+        String PROXY_PORT = "proxyport";
+        String ALLOW = "allow";
+        String PACKAGES = "packages";
     }
 
     @Override
@@ -36,22 +47,64 @@
         super.onCreate(savedInstanceState);
         setContentView(R.layout.form);
 
-        final TextView serverAddress = (TextView) findViewById(R.id.address);
-        final TextView serverPort = (TextView) findViewById(R.id.port);
-        final TextView sharedSecret = (TextView) findViewById(R.id.secret);
+        final TextView serverAddress = findViewById(R.id.address);
+        final TextView serverPort = findViewById(R.id.port);
+        final TextView sharedSecret = findViewById(R.id.secret);
+        final TextView proxyHost = findViewById(R.id.proxyhost);
+        final TextView proxyPort = findViewById(R.id.proxyport);
+
+        final RadioButton allowed = findViewById(R.id.allowed);
+        final TextView packages = findViewById(R.id.packages);
 
         final SharedPreferences prefs = getSharedPreferences(Prefs.NAME, MODE_PRIVATE);
         serverAddress.setText(prefs.getString(Prefs.SERVER_ADDRESS, ""));
-        serverPort.setText(prefs.getString(Prefs.SERVER_PORT, ""));
+        int serverPortPrefValue = prefs.getInt(Prefs.SERVER_PORT, 0);
+        serverPort.setText(String.valueOf(serverPortPrefValue == 0 ? "" : serverPortPrefValue));
         sharedSecret.setText(prefs.getString(Prefs.SHARED_SECRET, ""));
+        proxyHost.setText(prefs.getString(Prefs.PROXY_HOSTNAME, ""));
+        int proxyPortPrefValue = prefs.getInt(Prefs.PROXY_PORT, 0);
+        proxyPort.setText(proxyPortPrefValue == 0 ? "" : String.valueOf(proxyPortPrefValue));
+
+        allowed.setChecked(prefs.getBoolean(Prefs.ALLOW, true));
+        packages.setText(String.join(", ", prefs.getStringSet(
+                Prefs.PACKAGES, Collections.emptySet())));
 
         findViewById(R.id.connect).setOnClickListener(v -> {
+            if (!checkProxyConfigs(proxyHost.getText().toString(),
+                    proxyPort.getText().toString())) {
+                return;
+            }
+
+            final Set<String> packageSet =
+                    Arrays.stream(packages.getText().toString().split(","))
+                            .map(String::trim)
+                            .filter(s -> !s.isEmpty())
+                            .collect(Collectors.toSet());
+            if (!checkPackages(packageSet)) {
+                return;
+            }
+
+            int serverPortNum;
+            try {
+                serverPortNum = Integer.parseInt(serverPort.getText().toString());
+            } catch (NumberFormatException e) {
+                serverPortNum = 0;
+            }
+            int proxyPortNum;
+            try {
+                proxyPortNum = Integer.parseInt(proxyPort.getText().toString());
+            } catch (NumberFormatException e) {
+                proxyPortNum = 0;
+            }
             prefs.edit()
                     .putString(Prefs.SERVER_ADDRESS, serverAddress.getText().toString())
-                    .putString(Prefs.SERVER_PORT, serverPort.getText().toString())
+                    .putInt(Prefs.SERVER_PORT, serverPortNum)
                     .putString(Prefs.SHARED_SECRET, sharedSecret.getText().toString())
+                    .putString(Prefs.PROXY_HOSTNAME, proxyHost.getText().toString())
+                    .putInt(Prefs.PROXY_PORT, proxyPortNum)
+                    .putBoolean(Prefs.ALLOW, allowed.isChecked())
+                    .putStringSet(Prefs.PACKAGES, packageSet)
                     .commit();
-
             Intent intent = VpnService.prepare(ToyVpnClient.this);
             if (intent != null) {
                 startActivityForResult(intent, 0);
@@ -64,6 +117,26 @@
         });
     }
 
+    private boolean checkProxyConfigs(String proxyHost, String proxyPort) {
+        final boolean hasIncompleteProxyConfigs = proxyHost.isEmpty() != proxyPort.isEmpty();
+        if (hasIncompleteProxyConfigs) {
+            Toast.makeText(this, R.string.incomplete_proxy_settings, Toast.LENGTH_SHORT).show();
+        }
+        return !hasIncompleteProxyConfigs;
+    }
+
+    private boolean checkPackages(Set<String> packageNames) {
+        final boolean hasCorrectPackageNames = packageNames.isEmpty() ||
+                getPackageManager().getInstalledPackages(0).stream()
+                        .map(pi -> pi.packageName)
+                        .collect(Collectors.toSet())
+                        .containsAll(packageNames);
+        if (!hasCorrectPackageNames) {
+            Toast.makeText(this, R.string.unknown_package_names, Toast.LENGTH_SHORT).show();
+        }
+        return hasCorrectPackageNames;
+    }
+
     @Override
     protected void onActivityResult(int request, int result, Intent data) {
         if (result == RESULT_OK) {
diff --git a/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnConnection.java b/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnConnection.java
index 6644ecd..46897d9 100644
--- a/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnConnection.java
+++ b/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnConnection.java
@@ -19,8 +19,11 @@
 import static java.nio.charset.StandardCharsets.US_ASCII;
 
 import android.app.PendingIntent;
+import android.content.pm.PackageManager;
+import android.net.ProxyInfo;
 import android.net.VpnService;
 import android.os.ParcelFileDescriptor;
+import android.text.TextUtils;
 import android.util.Log;
 
 import java.io.FileInputStream;
@@ -31,6 +34,7 @@
 import java.net.SocketException;
 import java.nio.ByteBuffer;
 import java.nio.channels.DatagramChannel;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 public class ToyVpnConnection implements Runnable {
@@ -83,14 +87,34 @@
     private PendingIntent mConfigureIntent;
     private OnEstablishListener mOnEstablishListener;
 
+    // Proxy settings
+    private String mProxyHostName;
+    private int mProxyHostPort;
+
+    // Allowed/Disallowed packages for VPN usage
+    private final boolean mAllow;
+    private final Set<String> mPackages;
+
     public ToyVpnConnection(final VpnService service, final int connectionId,
-            final String serverName, final int serverPort, final byte[] sharedSecret) {
+            final String serverName, final int serverPort, final byte[] sharedSecret,
+            final String proxyHostName, final int proxyHostPort, boolean allow,
+            final Set<String> packages) {
         mService = service;
         mConnectionId = connectionId;
 
         mServerName = serverName;
         mServerPort= serverPort;
         mSharedSecret = sharedSecret;
+
+        if (!TextUtils.isEmpty(proxyHostName)) {
+            mProxyHostName = proxyHostName;
+        }
+        if (proxyHostPort > 0) {
+            // The port value is always an integer due to the configured inputType.
+            mProxyHostPort = proxyHostPort;
+        }
+        mAllow = allow;
+        mPackages = packages;
     }
 
     /**
@@ -117,7 +141,7 @@
 
             // We try to create the tunnel several times.
             // TODO: The better way is to work with ConnectivityManager, trying only when the
-            //       network is available.
+            // network is available.
             // Here we just use a counter to keep things simple.
             for (int attempt = 0; attempt < 10; ++attempt) {
                 // Reset the counter if we were connected.
@@ -309,11 +333,23 @@
 
         // Create a new interface using the builder and save the parameters.
         final ParcelFileDescriptor vpnInterface;
+        for (String packageName : mPackages) {
+            try {
+                if (mAllow) {
+                    builder.addAllowedApplication(packageName);
+                } else {
+                    builder.addDisallowedApplication(packageName);
+                }
+            } catch (PackageManager.NameNotFoundException e){
+                Log.w(getTag(), "Package not available: " + packageName, e);
+            }
+        }
+        builder.setSession(mServerName).setConfigureIntent(mConfigureIntent);
+        if (!TextUtils.isEmpty(mProxyHostName)) {
+            builder.setHttpProxy(ProxyInfo.buildDirectProxy(mProxyHostName, mProxyHostPort));
+        }
         synchronized (mService) {
-            vpnInterface = builder
-                    .setSession(mServerName)
-                    .setConfigureIntent(mConfigureIntent)
-                    .establish();
+            vpnInterface = builder.establish();
             if (mOnEstablishListener != null) {
                 mOnEstablishListener.onEstablish(vpnInterface);
             }
diff --git a/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnService.java b/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnService.java
index 5e42d9d..8b28f34 100644
--- a/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnService.java
+++ b/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnService.java
@@ -17,8 +17,9 @@
 package com.example.android.toyvpn;
 
 import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
 import android.app.PendingIntent;
-import android.app.Service;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.net.VpnService;
@@ -30,6 +31,8 @@
 import android.widget.Toast;
 
 import java.io.IOException;
+import java.util.Collections;
+import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -101,17 +104,15 @@
         final SharedPreferences prefs = getSharedPreferences(ToyVpnClient.Prefs.NAME, MODE_PRIVATE);
         final String server = prefs.getString(ToyVpnClient.Prefs.SERVER_ADDRESS, "");
         final byte[] secret = prefs.getString(ToyVpnClient.Prefs.SHARED_SECRET, "").getBytes();
-        final int port;
-        try {
-            port = Integer.parseInt(prefs.getString(ToyVpnClient.Prefs.SERVER_PORT, ""));
-        } catch (NumberFormatException e) {
-            Log.e(TAG, "Bad port: " + prefs.getString(ToyVpnClient.Prefs.SERVER_PORT, null), e);
-            return;
-        }
-
-        // Kick off a connection.
+        final boolean allow = prefs.getBoolean(ToyVpnClient.Prefs.ALLOW, true);
+        final Set<String> packages =
+                prefs.getStringSet(ToyVpnClient.Prefs.PACKAGES, Collections.emptySet());
+        final int port = prefs.getInt(ToyVpnClient.Prefs.SERVER_PORT, 0);
+        final String proxyHost = prefs.getString(ToyVpnClient.Prefs.PROXY_HOSTNAME, "");
+        final int proxyPort = prefs.getInt(ToyVpnClient.Prefs.PROXY_PORT, 0);
         startConnection(new ToyVpnConnection(
-                this, mNextConnectionId.getAndIncrement(), server, port, secret));
+                this, mNextConnectionId.getAndIncrement(), server, port, secret,
+                proxyHost, proxyPort, allow, packages));
     }
 
     private void startConnection(final ToyVpnConnection connection) {
@@ -121,13 +122,11 @@
 
         // Handler to mark as connected once onEstablish is called.
         connection.setConfigureIntent(mConfigureIntent);
-        connection.setOnEstablishListener(new ToyVpnConnection.OnEstablishListener() {
-            public void onEstablish(ParcelFileDescriptor tunInterface) {
-                mHandler.sendEmptyMessage(R.string.connected);
+        connection.setOnEstablishListener(tunInterface -> {
+            mHandler.sendEmptyMessage(R.string.connected);
 
-                mConnectingThread.compareAndSet(thread, null);
-                setConnection(new Connection(thread, tunInterface));
-            }
+            mConnectingThread.compareAndSet(thread, null);
+            setConnection(new Connection(thread, tunInterface));
         });
         thread.start();
     }
@@ -159,7 +158,13 @@
     }
 
     private void updateForegroundNotification(final int message) {
-        startForeground(1, new Notification.Builder(this)
+        final String NOTIFICATION_CHANNEL_ID = "ToyVpn";
+        NotificationManager mNotificationManager = (NotificationManager) getSystemService(
+                NOTIFICATION_SERVICE);
+        mNotificationManager.createNotificationChannel(new NotificationChannel(
+                NOTIFICATION_CHANNEL_ID, NOTIFICATION_CHANNEL_ID,
+                NotificationManager.IMPORTANCE_DEFAULT));
+        startForeground(1, new Notification.Builder(this, NOTIFICATION_CHANNEL_ID)
                 .setSmallIcon(R.drawable.ic_vpn)
                 .setContentText(getString(message))
                 .setContentIntent(mConfigureIntent)
diff --git a/samples/WiFiDirectDemo/Android.mk b/samples/WiFiDirectDemo/Android.mk
index 36c5d45..5a76260 100644
--- a/samples/WiFiDirectDemo/Android.mk
+++ b/samples/WiFiDirectDemo/Android.mk
@@ -6,6 +6,9 @@
 # Only compile source java files in this apk.
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
+LOCAL_STATIC_ANDROID_LIBRARIES += \
+        android-support-v4
+
 LOCAL_PACKAGE_NAME := WiFiDirectDemo
 
 LOCAL_SDK_VERSION := current
diff --git a/samples/WiFiDirectDemo/AndroidManifest.xml b/samples/WiFiDirectDemo/AndroidManifest.xml
index d25fdc0..44985e8 100644
--- a/samples/WiFiDirectDemo/AndroidManifest.xml
+++ b/samples/WiFiDirectDemo/AndroidManifest.xml
@@ -2,7 +2,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.wifidirect"
     android:versionCode="1" android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="14" />
+    <!-- runtime permission check API is on Android 6.0 or higher -->
+    <uses-sdk android:minSdkVersion="23" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
@@ -10,6 +11,7 @@
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
 
     <!-- Google Play filtering --> 
     <uses-feature android:name="android.hardware.wifi.direct" android:required="true"/>
@@ -29,6 +31,16 @@
             </intent-filter>
         </activity>
 
+        <provider
+            android:name="android.support.v4.content.FileProvider"
+            android:authorities="com.example.android.wifidirect.fileprovider"
+            android:exported="false"
+            android:grantUriPermissions="true">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/provider_paths" />
+        </provider>
+
         <!-- Used for transferring files  after a successful connection -->
         <service android:enabled="true" android:name=".FileTransferService" />
 
diff --git a/samples/WiFiDirectDemo/res/xml/provider_paths.xml b/samples/WiFiDirectDemo/res/xml/provider_paths.xml
new file mode 100644
index 0000000..28fb406
--- /dev/null
+++ b/samples/WiFiDirectDemo/res/xml/provider_paths.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<paths xmlns:android="http://schemas.android.com/apk/res/android">
+    <external-files-path name="received" path="received"/>
+</paths>
diff --git a/samples/WiFiDirectDemo/src/com/example/android/wifidirect/DeviceDetailFragment.java b/samples/WiFiDirectDemo/src/com/example/android/wifidirect/DeviceDetailFragment.java
index f74afae..c999ece 100644
--- a/samples/WiFiDirectDemo/src/com/example/android/wifidirect/DeviceDetailFragment.java
+++ b/samples/WiFiDirectDemo/src/com/example/android/wifidirect/DeviceDetailFragment.java
@@ -19,7 +19,6 @@
 import android.app.Fragment;
 import android.app.ProgressDialog;
 import android.content.Context;
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.net.Uri;
 import android.net.wifi.WpsInfo;
@@ -29,7 +28,7 @@
 import android.net.wifi.p2p.WifiP2pManager.ConnectionInfoListener;
 import android.os.AsyncTask;
 import android.os.Bundle;
-import android.os.Environment;
+import android.support.v4.content.FileProvider;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -228,8 +227,8 @@
                 Log.d(WiFiDirectActivity.TAG, "Server: Socket opened");
                 Socket client = serverSocket.accept();
                 Log.d(WiFiDirectActivity.TAG, "Server: connection done");
-                final File f = new File(Environment.getExternalStorageDirectory() + "/"
-                        + context.getPackageName() + "/wifip2pshared-" + System.currentTimeMillis()
+                final File f = new File(context.getExternalFilesDir("received"),
+                        "wifip2pshared-" + System.currentTimeMillis()
                         + ".jpg");
 
                 File dirs = new File(f.getParent());
@@ -256,9 +255,16 @@
         protected void onPostExecute(String result) {
             if (result != null) {
                 statusText.setText("File copied - " + result);
+
+                File recvFile = new File(result);
+                Uri fileUri = FileProvider.getUriForFile(
+                                context,
+                                "com.example.android.wifidirect.fileprovider",
+                                recvFile);
                 Intent intent = new Intent();
                 intent.setAction(android.content.Intent.ACTION_VIEW);
-                intent.setDataAndType(Uri.parse("file://" + result), "image/*");
+                intent.setDataAndType(fileUri, "image/*");
+                intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
                 context.startActivity(intent);
             }
 
diff --git a/samples/WiFiDirectDemo/src/com/example/android/wifidirect/WiFiDirectActivity.java b/samples/WiFiDirectDemo/src/com/example/android/wifidirect/WiFiDirectActivity.java
index 2e51c3d..aaec708 100644
--- a/samples/WiFiDirectDemo/src/com/example/android/wifidirect/WiFiDirectActivity.java
+++ b/samples/WiFiDirectDemo/src/com/example/android/wifidirect/WiFiDirectActivity.java
@@ -16,17 +16,20 @@
 
 package com.example.android.wifidirect;
 
+import android.Manifest;
 import android.app.Activity;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.PackageManager;
 import android.net.wifi.p2p.WifiP2pConfig;
 import android.net.wifi.p2p.WifiP2pDevice;
 import android.net.wifi.p2p.WifiP2pManager;
 import android.net.wifi.p2p.WifiP2pManager.ActionListener;
 import android.net.wifi.p2p.WifiP2pManager.Channel;
 import android.net.wifi.p2p.WifiP2pManager.ChannelListener;
+import android.os.Build;
 import android.os.Bundle;
 import android.provider.Settings;
 import android.util.Log;
@@ -48,6 +51,9 @@
 public class WiFiDirectActivity extends Activity implements ChannelListener, DeviceActionListener {
 
     public static final String TAG = "wifidirectdemo";
+
+    private static final int PERMISSIONS_REQUEST_CODE_ACCESS_COARSE_LOCATION = 1001;
+
     private WifiP2pManager manager;
     private boolean isWifiP2pEnabled = false;
     private boolean retryChannel = false;
@@ -64,6 +70,19 @@
     }
 
     @Override
+    public void onRequestPermissionsResult(int requestCode, String[] permissions,
+            int[] grantResults) {
+        switch (requestCode) {
+        case PERMISSIONS_REQUEST_CODE_ACCESS_COARSE_LOCATION:
+            if  (grantResults[0] != PackageManager.PERMISSION_GRANTED) {
+                Log.e(TAG, "Coarse location permission is not granted!");
+                finish();
+            }
+            break;
+        }
+    }
+
+    @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
@@ -77,6 +96,15 @@
 
         manager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE);
         channel = manager.initialize(this, getMainLooper(), null);
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
+                    && checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
+                    != PackageManager.PERMISSION_GRANTED) {
+            requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},
+                    WiFiDirectActivity.PERMISSIONS_REQUEST_CODE_ACCESS_COARSE_LOCATION);
+            // After this point you wait for callback in
+            // onRequestPermissionsResult(int, String[], int[]) overridden method
+        }
     }
 
     /** register the BroadcastReceiver with the intent values to be matched */
diff --git a/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/ChatManager.java b/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/ChatManager.java
index d537f10..52fb7a0 100644
--- a/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/ChatManager.java
+++ b/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/ChatManager.java
@@ -65,12 +65,18 @@
         }
     }
 
-    public void write(byte[] buffer) {
-        try {
-            oStream.write(buffer);
-        } catch (IOException e) {
-            Log.e(TAG, "Exception during write", e);
-        }
+    public void write(String msg) {
+        byte[] buffer = msg.getBytes();
+        Thread thread = new Thread() {
+            public void run() {
+                try {
+                    oStream.write(buffer);
+                } catch (IOException e) {
+                    Log.e(TAG, "Exception during write", e);
+                }
+            }
+        };
+        thread.start();
     }
 
 }
diff --git a/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/WiFiChatFragment.java b/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/WiFiChatFragment.java
index e4a1858..1c9dcab 100644
--- a/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/WiFiChatFragment.java
+++ b/samples/WiFiDirectServiceDiscovery/src/com/example/android/wifidirect/discovery/WiFiChatFragment.java
@@ -43,8 +43,7 @@
                     @Override
                     public void onClick(View arg0) {
                         if (chatManager != null) {
-                            chatManager.write(chatLine.getText().toString()
-                                    .getBytes());
+                            chatManager.write(chatLine.getText().toString());
                             pushMessage("Me: " + chatLine.getText().toString());
                             chatLine.setText("");
                             chatLine.clearFocus();
diff --git a/scripts/Android.bp b/scripts/Android.bp
new file mode 100644
index 0000000..c0f6201
--- /dev/null
+++ b/scripts/Android.bp
@@ -0,0 +1,49 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+python_library_host {
+    name: "python-symbol",
+    srcs: [
+        "symbol.py",
+    ],
+    version: {
+        py2: {
+            enabled: true,
+        },
+        py3: {
+            enabled: true,
+        },
+    },
+}
+
+python_test_host {
+    name: "python-native_heapdump_viewer_test",
+    main: "native_heapdump_viewer_tests.py",
+    srcs: [
+        "native_heapdump_viewer.py",
+        "native_heapdump_viewer_tests.py",
+    ],
+    test_config: "native_heapdump_viewer-tests.xml",
+    test_suites: ["general-tests"],
+}
+
+python_test_host {
+    name: "python-symbol_test",
+    main: "symbol.py",
+    // Would be nice to use the library above, but as it's single-source
+    // this doesn't work.
+    srcs: ["symbol.py"],
+    test_config: "symbol-tests.xml",
+    test_suites: ["general-tests"],
+}
diff --git a/scripts/TEST_MAPPING b/scripts/TEST_MAPPING
new file mode 100644
index 0000000..1d2b9d0
--- /dev/null
+++ b/scripts/TEST_MAPPING
@@ -0,0 +1,10 @@
+{
+  "presubmit": [
+    {
+      "name": "python-native_heapdump_viewer_test"
+    },
+    {
+      "name": "python-symbol_test"
+    }
+  ]
+}
diff --git a/scripts/disassemble_test_input.py b/scripts/disassemble_test_input.py
index e852ce7..107a999 100644
--- a/scripts/disassemble_test_input.py
+++ b/scripts/disassemble_test_input.py
@@ -1187,13 +1187,13 @@
          0000007f6e605170  000000000000001a  
          0000007f6e605178  0000000000000001  
          0000007f6e605180  0000007f834c7000  [anon:libc_malloc]
-         0000007f6e605188  0000000012d70700  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e605190  0000000012d60450  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e605188  0000000012d70700  [anon:dalvik-main space]
+         0000007f6e605190  0000000012d60450  [anon:dalvik-main space]
          0000007f6e605198  0000000000000000  
          0000007f6e6051a0  00000000704e2bc8  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f6e6051a8  0000000012d60450  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e6051b0  0000000012d60470  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e6051b8  0000000012d70700  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e6051a8  0000000012d60450  [anon:dalvik-main space]
+         0000007f6e6051b0  0000000012d60470  [anon:dalvik-main space]
+         0000007f6e6051b8  0000000012d70700  [anon:dalvik-main space]
          0000007f6e6051c0  00000000704e2f88  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e6051c8  0000000073defb94  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f6e6051d0  0000007f6e605860  [stack:9188]
@@ -1201,42 +1201,42 @@
          0000007f6e6051e0  0000000000000014  
          0000007f6e6051e8  0000007f830232a8  /system/lib64/libart.so (art::JniMethodStart(art::Thread*))
          0000007f6e6051f0  0000007f834c7000  [anon:libc_malloc]
-         0000007f6e6051f8  00000000771bd190  /dev/ashmem/dalvik-zygote space (deleted)
-         0000007f6e605200  0000000012d60330  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e6051f8  00000000771bd190  [anon:dalvik-zygote space]
+         0000007f6e605200  0000000012d60330  [anon:dalvik-main space]
          0000007f6e605208  0000000000000000  
-         0000007f6e605210  0000000012d61200  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e605218  0000000012d59280  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e605220  0000000012d59280  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e605210  0000000012d61200  [anon:dalvik-main space]
+         0000007f6e605218  0000000012d59280  [anon:dalvik-main space]
+         0000007f6e605220  0000000012d59280  [anon:dalvik-main space]
          0000007f6e605228  0000000073df5ffc  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f6e605230  00000000704e4fc8  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e605238  0000000070ffa818  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e605240  0000000000430000  
          0000007f6e605248  0000000000550000  
          0000007f6e605250  0000000100430000  
-         0000007f6e605258  0000000012d60450  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e605258  0000000012d60450  [anon:dalvik-main space]
     #00  0000007f6e605260  0000000070faec98  /data/dalvik-cache/arm64/system@framework@boot.art
          ........  ........
     #01  0000007f6e605260  0000000070faec98  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e605268  0000000100000000  
          0000007f6e605270  0000000070e66cb8  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f6e605278  0000000012d70680  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e605280  0000000012d64330  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e605278  0000000012d70680  [anon:dalvik-main space]
+         0000007f6e605280  0000000012d64330  [anon:dalvik-main space]
          0000007f6e605288  0000000070ffa218  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e605290  00000000705099c8  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f6e605298  00000000771bd190  /dev/ashmem/dalvik-zygote space (deleted)
-         0000007f6e6052a0  0000000012d60330  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e605298  00000000771bd190  [anon:dalvik-zygote space]
+         0000007f6e6052a0  0000000012d60330  [anon:dalvik-main space]
          0000007f6e6052a8  0000000000000000  
-         0000007f6e6052b0  0000000012d61200  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e6052b8  0000000012d59280  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e6052c0  0000000012d59280  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e6052b0  0000000012d61200  [anon:dalvik-main space]
+         0000007f6e6052b8  0000000012d59280  [anon:dalvik-main space]
+         0000007f6e6052c0  0000000012d59280  [anon:dalvik-main space]
          0000007f6e6052c8  0000000000000000  
          0000007f6e6052d0  0000007f6e605860  [stack:9188]
          0000007f6e6052d8  0000000073f54c54  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f6e6052e0  00000000705099c8  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f6e6052e8  00000000771bd190  /dev/ashmem/dalvik-zygote space (deleted)
-         0000007f6e6052f0  0000000012d60330  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e6052e8  00000000771bd190  [anon:dalvik-zygote space]
+         0000007f6e6052f0  0000000012d60330  [anon:dalvik-main space]
          0000007f6e6052f8  0000000070ffa218  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f6e605300  0000000012d64330  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e605300  0000000012d64330  [anon:dalvik-main space]
          0000007f6e605308  00000000740ce098  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f6e605310  0000007f70ffa218  
          0000007f6e605318  00000000703a9900  /data/dalvik-cache/arm64/system@framework@boot.art
@@ -1244,8 +1244,8 @@
          0000007f6e605328  000000000000001c  
          0000007f6e605330  0000000070ffa298  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e605338  0000000070535ac8  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f6e605340  0000000012d60330  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e605348  0000000012d60330  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e605340  0000000012d60330  [anon:dalvik-main space]
+         0000007f6e605348  0000000012d60330  [anon:dalvik-main space]
          0000007f6e605350  0000000000000000  
          0000007f6e605358  00000000740ce1dc  /data/dalvik-cache/arm64/system@framework@boot.oat
 
@@ -1628,20 +1628,20 @@
     0000007f6e605330 0000000070ffa298 0000000070535ac8  
 
 memory map: (fault address prefixed with --->)
-    0000000012c00000-0000000012e00fff rw-  2101248  /dev/ashmem/dalvik-main space (deleted)
-    0000000012e01000-0000000032bfffff ---  534769664  /dev/ashmem/dalvik-main space (deleted)
-    0000000032c00000-0000000032c00fff rw-     4096  /dev/ashmem/dalvik-main space (deleted)
-    0000000032c01000-0000000052bfffff ---  536866816  /dev/ashmem/dalvik-main space (deleted)
+    0000000012c00000-0000000012e00fff rw-  2101248  [anon:dalvik-main space]
+    0000000012e01000-0000000032bfffff ---  534769664  [anon:dalvik-main space]
+    0000000032c00000-0000000032c00fff rw-     4096  [anon:dalvik-main space]
+    0000000032c01000-0000000052bfffff ---  536866816  [anon:dalvik-main space]
     0000000070329000-0000000071098fff rw-  14090240  /data/dalvik-cache/arm64/system@framework@boot.art
     0000000071099000-0000000073bd2fff r--  45326336  /data/dalvik-cache/arm64/system@framework@boot.oat
     0000000073bd3000-00000000771bafff r-x  56524800  /data/dalvik-cache/arm64/system@framework@boot.oat
     00000000771bb000-00000000771bbfff rw-     4096  /data/dalvik-cache/arm64/system@framework@boot.oat
-    00000000771bc000-0000000078fe8fff rw-  31641600  /dev/ashmem/dalvik-zygote space (deleted)
-    0000000078fe9000-0000000078fe9fff rw-     4096  /dev/ashmem/dalvik-non moving space (deleted)
-    0000000078fea000-000000007900bfff rw-   139264  /dev/ashmem/dalvik-non moving space (deleted)
-    000000007900c000-000000007a9bcfff ---  26939392  /dev/ashmem/dalvik-non moving space (deleted)
-    000000007a9bd000-000000007b1bbfff rw-  8384512  /dev/ashmem/dalvik-non moving space (deleted)
-    000000007b1bc000-000000009b1bbfff rw-  536870912  /dev/ashmem/dalvik-large object space (deleted)
+    00000000771bc000-0000000078fe8fff rw-  31641600  [anon:dalvik-zygote space]
+    0000000078fe9000-0000000078fe9fff rw-     4096  [anon:dalvik-non moving space]
+    0000000078fea000-000000007900bfff rw-   139264  [anon:dalvik-non moving space]
+    000000007900c000-000000007a9bcfff ---  26939392  [anon:dalvik-non moving space]
+    000000007a9bd000-000000007b1bbfff rw-  8384512  [anon:dalvik-non moving space]
+    000000007b1bc000-000000009b1bbfff rw-  536870912  [anon:dalvik-large object space]
     0000005593b77000-0000005593b85fff r-x    61440  /system/bin/app_process64_xposed
     0000005593b95000-0000005593b96fff r--     8192  /system/bin/app_process64_xposed
     0000005593b97000-0000005593b97fff rw-     4096  /system/bin/app_process64_xposed
@@ -1658,8 +1658,8 @@
     0000007f6f3bb000-0000007f6f492fff r--   884736  /data/dalvik-cache/arm64/system@priv-app@SecMediaProvider@SecMediaProvider.apk@classes.dex
     0000007f6f493000-0000007f6f5b4fff r-x  1187840  /data/dalvik-cache/arm64/system@priv-app@SecMediaProvider@SecMediaProvider.apk@classes.dex
     0000007f6f5b5000-0000007f6f5b5fff rw-     4096  /data/dalvik-cache/arm64/system@priv-app@SecMediaProvider@SecMediaProvider.apk@classes.dex
-    0000007f6f5b6000-0000007f6fdb5fff rw-  8388608  /dev/ashmem/dalvik-allocspace main rosalloc space mark-bitmap 3 (deleted)
-    0000007f6fdb6000-0000007f705b5fff rw-  8388608  /dev/ashmem/dalvik-allocspace main rosalloc space live-bitmap 3 (deleted)
+    0000007f6f5b6000-0000007f6fdb5fff rw-  8388608  [anon:dalvik-allocspace main rosalloc space mark-bitmap 3]
+    0000007f6fdb6000-0000007f705b5fff rw-  8388608  [anon:dalvik-allocspace main rosalloc space live-bitmap 3]
     0000007f705b6000-0000007f769b5fff ---  104857600  
     0000007f769b6000-0000007f769c2fff r-x    53248  /system/lib64/librs_jni.so
     0000007f769c3000-0000007f769d1fff ---    61440  
@@ -1920,7 +1920,7 @@
     0000007f7c8e6000-0000007f7c8e6fff ---     4096  
     0000007f7c8e7000-0000007f7c8e7fff ---     4096  
     0000007f7c8e8000-0000007f7c9e3fff rw-  1032192  [stack:9181]
-    0000007f7c9e4000-0000007f7ca03fff rw-   131072  /dev/ashmem/dalvik-rosalloc page map (deleted)
+    0000007f7c9e4000-0000007f7ca03fff rw-   131072  [anon:dalvik-rosalloc page map]
     0000007f7ca04000-0000007f7ca60fff r--   380928  /data/dalvik-cache/arm64/system@framework@XposedBridge.jar@classes.dex (deleted)
     0000007f7ca61000-0000007f7cacafff r-x   434176  /data/dalvik-cache/arm64/system@framework@XposedBridge.jar@classes.dex (deleted)
     0000007f7cacb000-0000007f7cacbfff rw-     4096  /data/dalvik-cache/arm64/system@framework@XposedBridge.jar@classes.dex (deleted)
@@ -1930,31 +1930,31 @@
     0000007f7dd2a000-0000007f7dd2cfff r--    12288  /system/lib64/libjavacore.so
     0000007f7dd2d000-0000007f7dd2ffff rw-    12288  /system/lib64/libjavacore.so
     0000007f7dd30000-0000007f7dd30fff rw-     4096  
-    0000007f7dd31000-0000007f7de8efff rw-  1433600  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f7de8f000-0000007f7dfecfff rw-  1433600  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f7dfed000-0000007f7efeefff rw-  16785408  /dev/ashmem/dalvik-live stack (deleted)
-    0000007f7efef000-0000007f7fff0fff rw-  16785408  /dev/ashmem/dalvik-allocation stack (deleted)
-    0000007f7fff1000-0000007f80070fff rw-   524288  /dev/ashmem/dalvik-mark stack (deleted)
-    0000007f80071000-0000007f80d7cfff rw-  13680640  /dev/ashmem/dalvik-card table (deleted)
-    0000007f80d7d000-0000007f80e7cfff rw-  1048576  /dev/ashmem/dalvik-large object free list space allocation info map (deleted)
-    0000007f80e7d000-0000007f8167cfff rw-  8388608  /dev/ashmem/dalvik-allocspace main rosalloc space 1 mark-bitmap 2 (deleted)
-    0000007f8167d000-0000007f81e7cfff rw-  8388608  /dev/ashmem/dalvik-allocspace main rosalloc space 1 live-bitmap 2 (deleted)
+    0000007f7dd31000-0000007f7de8efff rw-  1433600  [anon:dalvik-indirect ref table]
+    0000007f7de8f000-0000007f7dfecfff rw-  1433600  [anon:dalvik-indirect ref table]
+    0000007f7dfed000-0000007f7efeefff rw-  16785408  [anon:dalvik-live stack]
+    0000007f7efef000-0000007f7fff0fff rw-  16785408  [anon:dalvik-allocation stack]
+    0000007f7fff1000-0000007f80070fff rw-   524288  [anon:dalvik-mark stack]
+    0000007f80071000-0000007f80d7cfff rw-  13680640  [anon:dalvik-card table]
+    0000007f80d7d000-0000007f80e7cfff rw-  1048576  [anon:dalvik-large object free list space allocation info map]
+    0000007f80e7d000-0000007f8167cfff rw-  8388608  [anon:dalvik-allocspace main rosalloc space 1 mark-bitmap 2]
+    0000007f8167d000-0000007f81e7cfff rw-  8388608  [anon:dalvik-allocspace main rosalloc space 1 live-bitmap 2]
     0000007f81f43000-0000007f81f44fff rw-     8192  
-    0000007f81f45000-0000007f81f48fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f81f45000-0000007f81f48fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f81f49000-0000007f81f4cfff rw-    16384  
-    0000007f81f4d000-0000007f81f50fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f81f51000-0000007f81f54fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f81f4d000-0000007f81f50fff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f81f51000-0000007f81f54fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f81f55000-0000007f81f58fff rw-    16384  
     0000007f81f59000-0000007f81f59fff ---     4096  
     0000007f81f5a000-0000007f81f5afff ---     4096  
     0000007f81f5b000-0000007f8205cfff rw-  1056768  [stack:9180]
-    0000007f8205d000-0000007f82060fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f8205d000-0000007f82060fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f82061000-0000007f8215efff r--  1040384  /dev/binder
     0000007f8215f000-0000007f82160fff rw-     8192  
     0000007f82161000-0000007f82161fff ---     4096  
     0000007f82162000-0000007f82162fff ---     4096  
     0000007f82163000-0000007f82264fff rw-  1056768  [stack:9179]
-    0000007f82265000-0000007f82268fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f82265000-0000007f82268fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f82269000-0000007f82269fff ---     4096  
     0000007f8226a000-0000007f8226afff ---     4096  
     0000007f8226b000-0000007f8236cfff rw-  1056768  [stack:9178]
@@ -1962,50 +1962,50 @@
     0000007f823d5000-0000007f823e3fff ---    61440  
     0000007f823e4000-0000007f823e4fff r--     4096  /system/lib64/libknoxvpnfdsender.so
     0000007f823e5000-0000007f823e5fff rw-     4096  /system/lib64/libknoxvpnfdsender.so
-    0000007f823e7000-0000007f823eafff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f823e7000-0000007f823eafff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f823eb000-0000007f823ecfff rw-     8192  
-    0000007f823ed000-0000007f823f0fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f823ed000-0000007f823f0fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f823f1000-0000007f823f2fff rw-     8192  
-    0000007f823f3000-0000007f823f6fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f823f3000-0000007f823f6fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f823f7000-0000007f823f8fff rw-     8192  
-    0000007f823f9000-0000007f823fcfff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f823f9000-0000007f823fcfff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f823fd000-0000007f823fefff rw-     8192  
     0000007f823ff000-0000007f82406fff rw-    32768  /data/data/com.android.providers.media/databases/external.db-shm
     0000007f82407000-0000007f82419fff r--    77824  /system/priv-app/SecMediaProvider/SecMediaProvider.apk
     0000007f8241a000-0000007f8241afff r--     4096  /data/dalvik-cache/arm64/system@priv-app@SecMediaProvider@SecMediaProvider.apk@classes.dex
     0000007f8241b000-0000007f8241bfff r--     4096  /system/priv-app/SecMediaProvider/SecMediaProvider.apk
     0000007f8241c000-0000007f8246cfff r--   331776  /system/priv-app/SecDownloadProvider/SecDownloadProvider.apk
-    0000007f8246d000-0000007f82470fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f8246d000-0000007f82470fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f82471000-0000007f82471fff ---     4096  
     0000007f82472000-0000007f82472fff ---     4096  
     0000007f82473000-0000007f8256efff rw-  1032192  [stack:9176]
     0000007f8256f000-0000007f8256ffff ---     4096  
     0000007f82570000-0000007f82570fff ---     4096  
     0000007f82571000-0000007f8266cfff rw-  1032192  [stack:9175]
-    0000007f8266d000-0000007f8266dfff rw-     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
-    0000007f8266e000-0000007f8266efff ---     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
-    0000007f8266f000-0000007f8276cfff rw-  1040384  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
-    0000007f8276d000-0000007f8276dfff rw-     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
-    0000007f8276e000-0000007f8276efff ---     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
-    0000007f8276f000-0000007f8286cfff rw-  1040384  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
-    0000007f8286d000-0000007f8286dfff rw-     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
-    0000007f8286e000-0000007f8286efff ---     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
-    0000007f8286f000-0000007f8296cfff rw-  1040384  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
-    0000007f8296d000-0000007f8296dfff rw-     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
-    0000007f8296e000-0000007f8296efff ---     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
-    0000007f8296f000-0000007f82a6cfff rw-  1040384  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
-    0000007f82a6d000-0000007f82a6dfff rw-     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
-    0000007f82a6e000-0000007f82a6efff ---     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
-    0000007f82a6f000-0000007f82b6cfff rw-  1040384  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
-    0000007f82b6d000-0000007f82b6dfff rw-     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
-    0000007f82b6e000-0000007f82b6efff ---     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
-    0000007f82b6f000-0000007f82c6cfff rw-  1040384  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
-    0000007f82c6d000-0000007f82c6dfff rw-     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
-    0000007f82c6e000-0000007f82c6efff ---     4096  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
-    0000007f82c6f000-0000007f82d6cfff rw-  1040384  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
-    0000007f82d6d000-0000007f82df4fff rw-   557056  /dev/ashmem/dalvik-allocspace non moving space mark-bitmap 4 (deleted)
-    0000007f82df5000-0000007f82e7cfff rw-   557056  /dev/ashmem/dalvik-allocspace non moving space live-bitmap 4 (deleted)
-    0000007f82e7d000-0000007f82f7cfff rw-  1048576  /dev/ashmem/dalvik-allocspace zygote / non moving space mark-bitmap 0 (deleted)
+    0000007f8266d000-0000007f8266dfff rw-     4096  [anon:dalvik-Heap thread pool worker thread 6]
+    0000007f8266e000-0000007f8266efff ---     4096  [anon:dalvik-Heap thread pool worker thread 6]
+    0000007f8266f000-0000007f8276cfff rw-  1040384  [anon:dalvik-Heap thread pool worker thread 6]
+    0000007f8276d000-0000007f8276dfff rw-     4096  [anon:dalvik-Heap thread pool worker thread 5]
+    0000007f8276e000-0000007f8276efff ---     4096  [anon:dalvik-Heap thread pool worker thread 5]
+    0000007f8276f000-0000007f8286cfff rw-  1040384  [anon:dalvik-Heap thread pool worker thread 5]
+    0000007f8286d000-0000007f8286dfff rw-     4096  [anon:dalvik-Heap thread pool worker thread 4]
+    0000007f8286e000-0000007f8286efff ---     4096  [anon:dalvik-Heap thread pool worker thread 4]
+    0000007f8286f000-0000007f8296cfff rw-  1040384  [anon:dalvik-Heap thread pool worker thread 4]
+    0000007f8296d000-0000007f8296dfff rw-     4096  [anon:dalvik-Heap thread pool worker thread 3]
+    0000007f8296e000-0000007f8296efff ---     4096  [anon:dalvik-Heap thread pool worker thread 3]
+    0000007f8296f000-0000007f82a6cfff rw-  1040384  [anon:dalvik-Heap thread pool worker thread 3]
+    0000007f82a6d000-0000007f82a6dfff rw-     4096  [anon:dalvik-Heap thread pool worker thread 2]
+    0000007f82a6e000-0000007f82a6efff ---     4096  [anon:dalvik-Heap thread pool worker thread 2]
+    0000007f82a6f000-0000007f82b6cfff rw-  1040384  [anon:dalvik-Heap thread pool worker thread 2]
+    0000007f82b6d000-0000007f82b6dfff rw-     4096  [anon:dalvik-Heap thread pool worker thread 1]
+    0000007f82b6e000-0000007f82b6efff ---     4096  [anon:dalvik-Heap thread pool worker thread 1]
+    0000007f82b6f000-0000007f82c6cfff rw-  1040384  [anon:dalvik-Heap thread pool worker thread 1]
+    0000007f82c6d000-0000007f82c6dfff rw-     4096  [anon:dalvik-Heap thread pool worker thread 0]
+    0000007f82c6e000-0000007f82c6efff ---     4096  [anon:dalvik-Heap thread pool worker thread 0]
+    0000007f82c6f000-0000007f82d6cfff rw-  1040384  [anon:dalvik-Heap thread pool worker thread 0]
+    0000007f82d6d000-0000007f82df4fff rw-   557056  [anon:dalvik-allocspace non moving space mark-bitmap 4]
+    0000007f82df5000-0000007f82e7cfff rw-   557056  [anon:dalvik-allocspace non moving space live-bitmap 4]
+    0000007f82e7d000-0000007f82f7cfff rw-  1048576  [anon:dalvik-allocspace zygote / non moving space mark-bitmap 0]
     0000007f82f7d000-0000007f833defff r-x  4595712  /system/lib64/libart.so
     0000007f833df000-0000007f833edfff ---    61440  
     0000007f833ee000-0000007f833fbfff r--    57344  /system/lib64/libart.so
@@ -2018,34 +2018,34 @@
     0000007f83c0e000-0000007f83c1dfff ---    65536  
     0000007f83c1e000-0000007f83c1efff r--     4096  /system/lib64/libxposed_art.so
     0000007f83c1f000-0000007f83c1ffff rw-     4096  /system/lib64/libxposed_art.so
-    0000007f83c20000-0000007f83c23fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f83c20000-0000007f83c23fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f83c24000-0000007f83c24fff r--     4096  /data/dalvik-cache/arm64/system@priv-app@SecDownloadProvider@SecDownloadProvider.apk@classes.dex
     0000007f83c25000-0000007f83c25fff r--     4096  /system/priv-app/SecDownloadProvider/SecDownloadProvider.apk
-    0000007f83c26000-0000007f83c29fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f83c26000-0000007f83c29fff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f83c2a000-0000007f83c2bfff rw-     8192  
-    0000007f83c2c000-0000007f83c2ffff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f83c2c000-0000007f83c2ffff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f83c30000-0000007f83c31fff rw-     8192  
     0000007f83c32000-0000007f83c32fff r--     4096  /data/dalvik-cache/arm64/system@framework@XposedBridge.jar@classes.dex (deleted)
     0000007f83c33000-0000007f83c33fff r--     4096  [anon:linker_alloc]
-    0000007f83c34000-0000007f83c37fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f83c38000-0000007f83c39fff rw-     8192  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    0000007f83c3a000-0000007f83c3bfff rw-     8192  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    0000007f83c3c000-0000007f83c3dfff rw-     8192  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    0000007f83c3e000-0000007f83c3ffff rw-     8192  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    0000007f83c40000-0000007f83c41fff rw-     8192  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    0000007f83c42000-0000007f83c43fff rw-     8192  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    0000007f83c44000-0000007f83c63fff rw-   131072  /dev/ashmem/dalvik-large marked objects (deleted)
-    0000007f83c64000-0000007f83c83fff rw-   131072  /dev/ashmem/dalvik-large live objects (deleted)
-    0000007f83c84000-0000007f83ca3fff rw-   131072  /dev/ashmem/dalvik-rosalloc page map (deleted)
-    0000007f83ca4000-0000007f83ca7fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f83ca8000-0000007f83cabfff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f83cac000-0000007f83caffff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f83cb0000-0000007f83cb3fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f83cb4000-0000007f83cb7fff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f83cb8000-0000007f83cbbfff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
-    0000007f83cbc000-0000007f83cbffff rw-    16384  /dev/ashmem/dalvik-indirect ref table (deleted)
+    0000007f83c34000-0000007f83c37fff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f83c38000-0000007f83c39fff rw-     8192  [anon:dalvik-mark sweep sweep array free buffer]
+    0000007f83c3a000-0000007f83c3bfff rw-     8192  [anon:dalvik-mark sweep sweep array free buffer]
+    0000007f83c3c000-0000007f83c3dfff rw-     8192  [anon:dalvik-mark sweep sweep array free buffer]
+    0000007f83c3e000-0000007f83c3ffff rw-     8192  [anon:dalvik-mark sweep sweep array free buffer]
+    0000007f83c40000-0000007f83c41fff rw-     8192  [anon:dalvik-mark sweep sweep array free buffer]
+    0000007f83c42000-0000007f83c43fff rw-     8192  [anon:dalvik-mark sweep sweep array free buffer]
+    0000007f83c44000-0000007f83c63fff rw-   131072  [anon:dalvik-large marked objects]
+    0000007f83c64000-0000007f83c83fff rw-   131072  [anon:dalvik-large live objects]
+    0000007f83c84000-0000007f83ca3fff rw-   131072  [anon:dalvik-rosalloc page map]
+    0000007f83ca4000-0000007f83ca7fff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f83ca8000-0000007f83cabfff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f83cac000-0000007f83caffff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f83cb0000-0000007f83cb3fff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f83cb4000-0000007f83cb7fff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f83cb8000-0000007f83cbbfff rw-    16384  [anon:dalvik-indirect ref table]
+    0000007f83cbc000-0000007f83cbffff rw-    16384  [anon:dalvik-indirect ref table]
     0000007f83cc0000-0000007f83cc3fff rw-    16384  
-    0000007f83cc4000-0000007f83dc3fff rw-  1048576  /dev/ashmem/dalvik-allocspace zygote / non moving space live-bitmap 0 (deleted)
+    0000007f83cc4000-0000007f83dc3fff rw-  1048576  [anon:dalvik-allocspace zygote / non moving space live-bitmap 0]
     0000007f83dc4000-0000007f83dc4fff r--     4096  /data/dalvik-cache/arm64/system@framework@boot.oat
     0000007f83dc5000-0000007f83dfafff r--   221184  /data/dalvik-cache/arm64/system@framework@boot.art
     0000007f83dfb000-0000007f83e04fff r-x    40960  /system/lib64/libbacktrace_libc++.so
@@ -2552,8 +2552,8 @@
          0000007fdbe906a0  0000000000000000  
          0000007fdbe906a8  0000000000000000  
          0000007fdbe906b0  0000000000000000  
-         0000007fdbe906b8  0000000012c26d20  /dev/ashmem/dalvik-main space (deleted)
-         0000007fdbe906c0  0000000012c0e850  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe906b8  0000000012c26d20  [anon:dalvik-main space]
+         0000007fdbe906c0  0000000012c0e850  [anon:dalvik-main space]
          0000007fdbe906c8  0000000000000000  
          0000007fdbe906d0  00000000000026f7  
          0000007fdbe906d8  0000000000000000  
@@ -2565,11 +2565,11 @@
          0000007fdbe90708  0000000000550000  
          0000007fdbe90710  0000007f00550000  
          0000007fdbe90718  0000007f00430000  
-         0000007fdbe90720  0000000012c27370  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe90720  0000000012c27370  [anon:dalvik-main space]
          0000007fdbe90728  0000000075ac0b30  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007fdbe90730  000000000000005d  
          0000007fdbe90738  83912a6d48ea586e  
-         0000007fdbe90740  0000000012c27370  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe90740  0000000012c27370  [anon:dalvik-main space]
          0000007fdbe90748  0000000075ac0b44  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007fdbe90750  000000000000005d  
          0000007fdbe90758  0000000000550000  
@@ -2583,7 +2583,7 @@
          0000007fdbe90840  0000007f775141c0  [anon:libc_malloc]
          0000007fdbe90848  0000007f834953c0  [anon:libc_malloc]
          0000007fdbe90850  0000007f834ab000  [anon:libc_malloc]
-         0000007fdbe90858  0000000012d34580  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe90858  0000000012d34580  [anon:dalvik-main space]
          0000007fdbe90860  000000007061e908  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007fdbe90868  0000000073bdd2e8  /data/dalvik-cache/arm64/system@framework@boot.oat
     #04  0000007fdbe90870  00000000000606b6  
@@ -2594,11 +2594,11 @@
          0000007fdbe90898  000000010000007f  
          0000007fdbe908a0  0000000970ee4990  
          0000007fdbe908a8  0000000000000001  
-         0000007fdbe908b0  0000000012c0e850  /dev/ashmem/dalvik-main space (deleted)
-         0000007fdbe908b8  0000000012d34580  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe908b0  0000000012c0e850  [anon:dalvik-main space]
+         0000007fdbe908b8  0000000012d34580  [anon:dalvik-main space]
          0000007fdbe908c0  000000007061e908  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007fdbe908c8  0000000012c26d20  /dev/ashmem/dalvik-main space (deleted)
-         0000007fdbe908d0  0000000012c0e850  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe908c8  0000000012c26d20  [anon:dalvik-main space]
+         0000007fdbe908d0  0000000012c0e850  [anon:dalvik-main space]
          0000007fdbe908d8  0000000000000000  
          0000007fdbe908e0  00000000000026f7  
          0000007fdbe908e8  0000000000000000  
@@ -2618,10 +2618,10 @@
          0000007fdbe90958  7fffffff000023ca  
          0000007fdbe90960  0000000000000000  
          0000007fdbe90968  000000007061d4c8  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007fdbe90970  0000000012c8ab20  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe90970  0000000012c8ab20  [anon:dalvik-main space]
          0000007fdbe90978  0000000000000000  
          0000007fdbe90980  0000000000000000  
-         0000007fdbe90988  0000000012c26d20  /dev/ashmem/dalvik-main space (deleted)
+         0000007fdbe90988  0000000012c26d20  [anon:dalvik-main space]
 
 memory near x1:
     0000007fdbe90710 0000007f00550000 0000007f00430000  
@@ -3022,7 +3022,7 @@
 
 stack:
          0000007f82d6c900  0000007f834ce910  [anon:libc_malloc]
-         0000007f82d6c908  0000007f82d6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+         0000007f82d6c908  0000007f82d6cb60  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6c910  0000007f77511140  [anon:libc_malloc]
          0000007f82d6c918  0000007f83294134  /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*))
          0000007f82d6c920  0000007f8310265c  /system/lib64/libart.so (art::Task::Finalize())
@@ -3043,19 +3043,19 @@
          0000007f82d6c998  0000007f83455100  [anon:libc_malloc]
          0000007f82d6c9a0  0000000000430000  
          0000007f82d6c9a8  0043000000550000  
-         0000007f82d6c9b0  0000007f82d6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+         0000007f82d6c9b0  0000007f82d6ca60  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6c9b8  0000007f83045808  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+40)
          0000007f82d6c9c0  0000007f8348d6f0  [anon:libc_malloc]
          0000007f82d6c9c8  83912a6d48ea586e  
-         0000007f82d6c9d0  0000007f82d6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+         0000007f82d6c9d0  0000007f82d6ca60  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6c9d8  0000007f83045824  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+68)
-         0000007f82d6c9e0  0000007f82d6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+         0000007f82d6c9e0  0000007f82d6ca90  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6c9e8  0000007f83294338  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+128)
          0000007f82d6c9f0  0000007f8348d600  [anon:libc_malloc]
          0000007f82d6c9f8  83912a6d48ea586e  
-    #00  0000007f82d6ca00  0000007f82d6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+    #00  0000007f82d6ca00  0000007f82d6ca90  [anon:dalvik-Heap thread pool worker thread 0]
          ........  ........
-    #01  0000007f82d6ca00  0000007f82d6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+    #01  0000007f82d6ca00  0000007f82d6ca90  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6ca08  0000007f8329436c  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+180)
          0000007f82d6ca10  0000007f8348d600  [anon:libc_malloc]
          0000007f82d6ca18  0000007f7c05a800  [anon:libc_malloc]
@@ -3073,19 +3073,19 @@
          0000007f82d6ca78  0000000000000000  
          0000007f82d6ca80  0000007f834ce910  [anon:libc_malloc]
          0000007f82d6ca88  83912a6d48ea586e  
-    #02  0000007f82d6ca90  0000007f82d6caf0  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+    #02  0000007f82d6ca90  0000007f82d6caf0  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6ca98  0000007f83295120  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
          0000007f82d6caa0  0000007f77511140  [anon:libc_malloc]
          0000007f82d6caa8  0000007f83455100  [anon:libc_malloc]
          0000007f82d6cab0  0000007f834ce910  [anon:libc_malloc]
-         0000007f82d6cab8  0000007f82d6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+         0000007f82d6cab8  0000007f82d6cb60  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6cac0  0000007f77511140  [anon:libc_malloc]
          0000007f82d6cac8  0000007f77511170  [anon:libc_malloc]
          0000007f82d6cad0  0000007f832950c4  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*))
          0000007f82d6cad8  0000007f834ce980  [anon:libc_malloc]
          0000007f82d6cae0  0000007fdbe90368  [stack]
          0000007f82d6cae8  0000007f83373d40  /system/lib64/libart.so
-    #03  0000007f82d6caf0  0000007f82d6cb30  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+    #03  0000007f82d6caf0  0000007f82d6cb30  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6caf8  0000007f87073324  /system/lib64/libc.so (__pthread_start(void*)+56)
          0000007f82d6cb00  0000007f834ce900  [anon:libc_malloc]
          0000007f82d6cb08  0000007f834ce980  [anon:libc_malloc]
@@ -3093,13 +3093,13 @@
          0000007f82d6cb18  0000007f83e20000  
          0000007f82d6cb20  0000007f00000000  
          0000007f82d6cb28  0000000000002000  
-    #04  0000007f82d6cb30  0000007f82d6cb50  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+    #04  0000007f82d6cb30  0000007f82d6cb50  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6cb38  0000007f8706f708  /system/lib64/libc.so (__start_thread+20)
          0000007f82d6cb40  00000000000023ca  
          0000007f82d6cb48  0000007f87385e30  /system/bin/linker64
     #05  0000007f82d6cb50  0000000000000000  
          0000007f82d6cb58  0000000000000000  
-         0000007f82d6cb60  0000007f82d6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 0 (deleted)
+         0000007f82d6cb60  0000007f82d6cb60  [anon:dalvik-Heap thread pool worker thread 0]
          0000007f82d6cb68  0000007f834ce900  [anon:libc_malloc]
          0000007f82d6cb70  0000000000000000  
          0000007f82d6cb78  0000000000000000  
@@ -3493,7 +3493,7 @@
 
 stack:
          0000007f82c6c900  0000007f834cec10  [anon:libc_malloc]
-         0000007f82c6c908  0000007f82c6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+         0000007f82c6c908  0000007f82c6cb60  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6c910  0000007f775ba280  [anon:libc_malloc]
          0000007f82c6c918  0000007f83294134  /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*))
          0000007f82c6c920  0000007f8310265c  /system/lib64/libart.so (art::Task::Finalize())
@@ -3514,19 +3514,19 @@
          0000007f82c6c998  0000007f83455100  [anon:libc_malloc]
          0000007f82c6c9a0  0000000000430000  
          0000007f82c6c9a8  0043000000550000  
-         0000007f82c6c9b0  0000007f82c6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+         0000007f82c6c9b0  0000007f82c6ca60  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6c9b8  0000007f83045808  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+40)
          0000007f82c6c9c0  0000007f8348d6f0  [anon:libc_malloc]
          0000007f82c6c9c8  83912a6d48ea586e  
-         0000007f82c6c9d0  0000007f82c6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+         0000007f82c6c9d0  0000007f82c6ca60  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6c9d8  0000007f83045824  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+68)
-         0000007f82c6c9e0  0000007f82c6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+         0000007f82c6c9e0  0000007f82c6ca90  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6c9e8  0000007f83294338  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+128)
          0000007f82c6c9f0  0000007f8348d600  [anon:libc_malloc]
          0000007f82c6c9f8  83912a6d48ea586e  
-    #00  0000007f82c6ca00  0000007f82c6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+    #00  0000007f82c6ca00  0000007f82c6ca90  [anon:dalvik-Heap thread pool worker thread 1]
          ........  ........
-    #01  0000007f82c6ca00  0000007f82c6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+    #01  0000007f82c6ca00  0000007f82c6ca90  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6ca08  0000007f8329436c  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+180)
          0000007f82c6ca10  0000007f8348d600  [anon:libc_malloc]
          0000007f82c6ca18  0000007f834ab800  [anon:libc_malloc]
@@ -3544,19 +3544,19 @@
          0000007f82c6ca78  0000000000000000  
          0000007f82c6ca80  0000007f834cec10  [anon:libc_malloc]
          0000007f82c6ca88  83912a6d48ea586e  
-    #02  0000007f82c6ca90  0000007f82c6caf0  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+    #02  0000007f82c6ca90  0000007f82c6caf0  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6ca98  0000007f83295120  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
          0000007f82c6caa0  0000007f775ba280  [anon:libc_malloc]
          0000007f82c6caa8  0000007f83455100  [anon:libc_malloc]
          0000007f82c6cab0  0000007f834cec10  [anon:libc_malloc]
-         0000007f82c6cab8  0000007f82c6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+         0000007f82c6cab8  0000007f82c6cb60  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6cac0  0000007f775ba280  [anon:libc_malloc]
          0000007f82c6cac8  0000007f775ba2b0  [anon:libc_malloc]
          0000007f82c6cad0  0000007f832950c4  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*))
          0000007f82c6cad8  0000007f834cec80  [anon:libc_malloc]
          0000007f82c6cae0  0000007fdbe90368  [stack]
          0000007f82c6cae8  0000007f83373d40  /system/lib64/libart.so
-    #03  0000007f82c6caf0  0000007f82c6cb30  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+    #03  0000007f82c6caf0  0000007f82c6cb30  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6caf8  0000007f87073324  /system/lib64/libc.so (__pthread_start(void*)+56)
          0000007f82c6cb00  0000007f834cec00  [anon:libc_malloc]
          0000007f82c6cb08  0000007f834cec80  [anon:libc_malloc]
@@ -3564,13 +3564,13 @@
          0000007f82c6cb18  0000007f83e1e000  
          0000007f82c6cb20  0000007f00000000  
          0000007f82c6cb28  0000000000002000  
-    #04  0000007f82c6cb30  0000007f82c6cb50  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+    #04  0000007f82c6cb30  0000007f82c6cb50  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6cb38  0000007f8706f708  /system/lib64/libc.so (__start_thread+20)
          0000007f82c6cb40  00000000000023ca  
          0000007f82c6cb48  0000007f87385e30  /system/bin/linker64
     #05  0000007f82c6cb50  0000000000000000  
          0000007f82c6cb58  0000000000000000  
-         0000007f82c6cb60  0000007f82c6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 1 (deleted)
+         0000007f82c6cb60  0000007f82c6cb60  [anon:dalvik-Heap thread pool worker thread 1]
          0000007f82c6cb68  0000007f834cec00  [anon:libc_malloc]
          0000007f82c6cb70  0000000000000000  
          0000007f82c6cb78  0000000000000000  
@@ -3964,7 +3964,7 @@
 
 stack:
          0000007f82b6c900  0000007f834ce310  [anon:libc_malloc]
-         0000007f82b6c908  0000007f82b6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+         0000007f82b6c908  0000007f82b6cb60  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6c910  0000007f775ba300  [anon:libc_malloc]
          0000007f82b6c918  0000007f83294134  /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*))
          0000007f82b6c920  0000007f8310265c  /system/lib64/libart.so (art::Task::Finalize())
@@ -3985,19 +3985,19 @@
          0000007f82b6c998  0000007f83455100  [anon:libc_malloc]
          0000007f82b6c9a0  0000000000430000  
          0000007f82b6c9a8  0043000000550000  
-         0000007f82b6c9b0  0000007f82b6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+         0000007f82b6c9b0  0000007f82b6ca60  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6c9b8  0000007f83045808  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+40)
          0000007f82b6c9c0  0000007f8348d6f0  [anon:libc_malloc]
          0000007f82b6c9c8  83912a6d48ea586e  
-         0000007f82b6c9d0  0000007f82b6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+         0000007f82b6c9d0  0000007f82b6ca60  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6c9d8  0000007f83045824  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+68)
-         0000007f82b6c9e0  0000007f82b6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+         0000007f82b6c9e0  0000007f82b6ca90  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6c9e8  0000007f83294338  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+128)
          0000007f82b6c9f0  0000007f8348d600  [anon:libc_malloc]
          0000007f82b6c9f8  83912a6d48ea586e  
-    #00  0000007f82b6ca00  0000007f82b6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+    #00  0000007f82b6ca00  0000007f82b6ca90  [anon:dalvik-Heap thread pool worker thread 2]
          ........  ........
-    #01  0000007f82b6ca00  0000007f82b6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+    #01  0000007f82b6ca00  0000007f82b6ca90  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6ca08  0000007f8329436c  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+180)
          0000007f82b6ca10  0000007f8348d600  [anon:libc_malloc]
          0000007f82b6ca18  0000007f7c05e800  [anon:libc_malloc]
@@ -4015,19 +4015,19 @@
          0000007f82b6ca78  0000000000000000  
          0000007f82b6ca80  0000007f834ce310  [anon:libc_malloc]
          0000007f82b6ca88  83912a6d48ea586e  
-    #02  0000007f82b6ca90  0000007f82b6caf0  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+    #02  0000007f82b6ca90  0000007f82b6caf0  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6ca98  0000007f83295120  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
          0000007f82b6caa0  0000007f775ba300  [anon:libc_malloc]
          0000007f82b6caa8  0000007f83455100  [anon:libc_malloc]
          0000007f82b6cab0  0000007f834ce310  [anon:libc_malloc]
-         0000007f82b6cab8  0000007f82b6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+         0000007f82b6cab8  0000007f82b6cb60  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6cac0  0000007f775ba300  [anon:libc_malloc]
          0000007f82b6cac8  0000007f775ba330  [anon:libc_malloc]
          0000007f82b6cad0  0000007f832950c4  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*))
          0000007f82b6cad8  0000007f834ce380  [anon:libc_malloc]
          0000007f82b6cae0  0000007fdbe90368  [stack]
          0000007f82b6cae8  0000007f83373d40  /system/lib64/libart.so
-    #03  0000007f82b6caf0  0000007f82b6cb30  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+    #03  0000007f82b6caf0  0000007f82b6cb30  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6caf8  0000007f87073324  /system/lib64/libc.so (__pthread_start(void*)+56)
          0000007f82b6cb00  0000007f834ce300  [anon:libc_malloc]
          0000007f82b6cb08  0000007f834ce380  [anon:libc_malloc]
@@ -4035,13 +4035,13 @@
          0000007f82b6cb18  0000007f83e18000  
          0000007f82b6cb20  0000007f00000000  
          0000007f82b6cb28  0000000000002000  
-    #04  0000007f82b6cb30  0000007f82b6cb50  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+    #04  0000007f82b6cb30  0000007f82b6cb50  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6cb38  0000007f8706f708  /system/lib64/libc.so (__start_thread+20)
          0000007f82b6cb40  00000000000023ca  
          0000007f82b6cb48  0000007f87385e30  /system/bin/linker64
     #05  0000007f82b6cb50  0000000000000000  
          0000007f82b6cb58  0000000000000000  
-         0000007f82b6cb60  0000007f82b6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 2 (deleted)
+         0000007f82b6cb60  0000007f82b6cb60  [anon:dalvik-Heap thread pool worker thread 2]
          0000007f82b6cb68  0000007f834ce300  [anon:libc_malloc]
          0000007f82b6cb70  0000000000000000  
          0000007f82b6cb78  0000000000000000  
@@ -4435,7 +4435,7 @@
 
 stack:
          0000007f82a6c900  0000007f834ce610  [anon:libc_malloc]
-         0000007f82a6c908  0000007f82a6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+         0000007f82a6c908  0000007f82a6cb60  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6c910  0000007f775ba440  [anon:libc_malloc]
          0000007f82a6c918  0000007f83294134  /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*))
          0000007f82a6c920  0000007f8310265c  /system/lib64/libart.so (art::Task::Finalize())
@@ -4456,19 +4456,19 @@
          0000007f82a6c998  0000007f83455100  [anon:libc_malloc]
          0000007f82a6c9a0  0000000000430000  
          0000007f82a6c9a8  0043000000550000  
-         0000007f82a6c9b0  0000007f82a6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+         0000007f82a6c9b0  0000007f82a6ca60  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6c9b8  0000007f83045808  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+40)
          0000007f82a6c9c0  0000007f8348d6f0  [anon:libc_malloc]
          0000007f82a6c9c8  83912a6d48ea586e  
-         0000007f82a6c9d0  0000007f82a6ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+         0000007f82a6c9d0  0000007f82a6ca60  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6c9d8  0000007f83045824  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+68)
-         0000007f82a6c9e0  0000007f82a6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+         0000007f82a6c9e0  0000007f82a6ca90  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6c9e8  0000007f83294338  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+128)
          0000007f82a6c9f0  0000007f8348d600  [anon:libc_malloc]
          0000007f82a6c9f8  83912a6d48ea586e  
-    #00  0000007f82a6ca00  0000007f82a6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+    #00  0000007f82a6ca00  0000007f82a6ca90  [anon:dalvik-Heap thread pool worker thread 3]
          ........  ........
-    #01  0000007f82a6ca00  0000007f82a6ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+    #01  0000007f82a6ca00  0000007f82a6ca90  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6ca08  0000007f8329436c  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+180)
          0000007f82a6ca10  0000007f8348d600  [anon:libc_malloc]
          0000007f82a6ca18  0000007f7c05c800  [anon:libc_malloc]
@@ -4486,19 +4486,19 @@
          0000007f82a6ca78  0000000000000000  
          0000007f82a6ca80  0000007f834ce610  [anon:libc_malloc]
          0000007f82a6ca88  83912a6d48ea586e  
-    #02  0000007f82a6ca90  0000007f82a6caf0  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+    #02  0000007f82a6ca90  0000007f82a6caf0  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6ca98  0000007f83295120  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
          0000007f82a6caa0  0000007f775ba440  [anon:libc_malloc]
          0000007f82a6caa8  0000007f83455100  [anon:libc_malloc]
          0000007f82a6cab0  0000007f834ce610  [anon:libc_malloc]
-         0000007f82a6cab8  0000007f82a6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+         0000007f82a6cab8  0000007f82a6cb60  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6cac0  0000007f775ba440  [anon:libc_malloc]
          0000007f82a6cac8  0000007f775ba470  [anon:libc_malloc]
          0000007f82a6cad0  0000007f832950c4  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*))
          0000007f82a6cad8  0000007f834ce680  [anon:libc_malloc]
          0000007f82a6cae0  0000007fdbe90368  [stack]
          0000007f82a6cae8  0000007f83373d40  /system/lib64/libart.so
-    #03  0000007f82a6caf0  0000007f82a6cb30  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+    #03  0000007f82a6caf0  0000007f82a6cb30  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6caf8  0000007f87073324  /system/lib64/libc.so (__pthread_start(void*)+56)
          0000007f82a6cb00  0000007f834ce600  [anon:libc_malloc]
          0000007f82a6cb08  0000007f834ce680  [anon:libc_malloc]
@@ -4506,13 +4506,13 @@
          0000007f82a6cb18  0000007f83e1c000  
          0000007f82a6cb20  0000007f00000000  
          0000007f82a6cb28  0000000000002000  
-    #04  0000007f82a6cb30  0000007f82a6cb50  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+    #04  0000007f82a6cb30  0000007f82a6cb50  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6cb38  0000007f8706f708  /system/lib64/libc.so (__start_thread+20)
          0000007f82a6cb40  00000000000023ca  
          0000007f82a6cb48  0000007f87385e30  /system/bin/linker64
     #05  0000007f82a6cb50  0000000000000000  
          0000007f82a6cb58  0000000000000000  
-         0000007f82a6cb60  0000007f82a6cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 3 (deleted)
+         0000007f82a6cb60  0000007f82a6cb60  [anon:dalvik-Heap thread pool worker thread 3]
          0000007f82a6cb68  0000007f834ce600  [anon:libc_malloc]
          0000007f82a6cb70  0000000000000000  
          0000007f82a6cb78  0000000000000000  
@@ -4906,7 +4906,7 @@
 
 stack:
          0000007f8296c900  0000007f834cef10  [anon:libc_malloc]
-         0000007f8296c908  0000007f8296cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+         0000007f8296c908  0000007f8296cb60  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296c910  0000007f775ba4c0  [anon:libc_malloc]
          0000007f8296c918  0000007f83294134  /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*))
          0000007f8296c920  0000007f8310265c  /system/lib64/libart.so (art::Task::Finalize())
@@ -4927,19 +4927,19 @@
          0000007f8296c998  0000007f83455100  [anon:libc_malloc]
          0000007f8296c9a0  0000000000430000  
          0000007f8296c9a8  0043000000550000  
-         0000007f8296c9b0  0000007f8296ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+         0000007f8296c9b0  0000007f8296ca60  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296c9b8  0000007f83045808  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+40)
          0000007f8296c9c0  0000007f8348d6f0  [anon:libc_malloc]
          0000007f8296c9c8  83912a6d48ea586e  
-         0000007f8296c9d0  0000007f8296ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+         0000007f8296c9d0  0000007f8296ca60  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296c9d8  0000007f83045824  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+68)
-         0000007f8296c9e0  0000007f8296ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+         0000007f8296c9e0  0000007f8296ca90  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296c9e8  0000007f83294338  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+128)
          0000007f8296c9f0  0000007f8348d600  [anon:libc_malloc]
          0000007f8296c9f8  83912a6d48ea586e  
-    #00  0000007f8296ca00  0000007f8296ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+    #00  0000007f8296ca00  0000007f8296ca90  [anon:dalvik-Heap thread pool worker thread 4]
          ........  ........
-    #01  0000007f8296ca00  0000007f8296ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+    #01  0000007f8296ca00  0000007f8296ca90  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296ca08  0000007f8329436c  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+180)
          0000007f8296ca10  0000007f8348d600  [anon:libc_malloc]
          0000007f8296ca18  0000007f834af000  [anon:libc_malloc]
@@ -4957,19 +4957,19 @@
          0000007f8296ca78  0000000000000000  
          0000007f8296ca80  0000007f834cef10  [anon:libc_malloc]
          0000007f8296ca88  83912a6d48ea586e  
-    #02  0000007f8296ca90  0000007f8296caf0  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+    #02  0000007f8296ca90  0000007f8296caf0  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296ca98  0000007f83295120  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
          0000007f8296caa0  0000007f775ba4c0  [anon:libc_malloc]
          0000007f8296caa8  0000007f83455100  [anon:libc_malloc]
          0000007f8296cab0  0000007f834cef10  [anon:libc_malloc]
-         0000007f8296cab8  0000007f8296cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+         0000007f8296cab8  0000007f8296cb60  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296cac0  0000007f775ba4c0  [anon:libc_malloc]
          0000007f8296cac8  0000007f775ba4f0  [anon:libc_malloc]
          0000007f8296cad0  0000007f832950c4  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*))
          0000007f8296cad8  0000007f834cef80  [anon:libc_malloc]
          0000007f8296cae0  0000007fdbe90368  [stack]
          0000007f8296cae8  0000007f83373d40  /system/lib64/libart.so
-    #03  0000007f8296caf0  0000007f8296cb30  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+    #03  0000007f8296caf0  0000007f8296cb30  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296caf8  0000007f87073324  /system/lib64/libc.so (__pthread_start(void*)+56)
          0000007f8296cb00  0000007f834cef00  [anon:libc_malloc]
          0000007f8296cb08  0000007f834cef80  [anon:libc_malloc]
@@ -4977,13 +4977,13 @@
          0000007f8296cb18  0000007f83e1a000  
          0000007f8296cb20  0000007f00000000  
          0000007f8296cb28  0000000000002000  
-    #04  0000007f8296cb30  0000007f8296cb50  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+    #04  0000007f8296cb30  0000007f8296cb50  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296cb38  0000007f8706f708  /system/lib64/libc.so (__start_thread+20)
          0000007f8296cb40  00000000000023ca  
          0000007f8296cb48  0000007f87385e30  /system/bin/linker64
     #05  0000007f8296cb50  0000000000000000  
          0000007f8296cb58  0000000000000000  
-         0000007f8296cb60  0000007f8296cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 4 (deleted)
+         0000007f8296cb60  0000007f8296cb60  [anon:dalvik-Heap thread pool worker thread 4]
          0000007f8296cb68  0000007f834cef00  [anon:libc_malloc]
          0000007f8296cb70  0000000000000000  
          0000007f8296cb78  0000000000000000  
@@ -5377,7 +5377,7 @@
 
 stack:
          0000007f8286c900  0000007f834d0d10  [anon:libc_malloc]
-         0000007f8286c908  0000007f8286cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+         0000007f8286c908  0000007f8286cb60  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286c910  0000007f775ba5c0  [anon:libc_malloc]
          0000007f8286c918  0000007f83294134  /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*))
          0000007f8286c920  0000007f8310265c  /system/lib64/libart.so (art::Task::Finalize())
@@ -5398,19 +5398,19 @@
          0000007f8286c998  0000007f83455100  [anon:libc_malloc]
          0000007f8286c9a0  0000000000430000  
          0000007f8286c9a8  0043000000550000  
-         0000007f8286c9b0  0000007f8286ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+         0000007f8286c9b0  0000007f8286ca60  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286c9b8  0000007f83045808  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+40)
          0000007f8286c9c0  0000007f8348d6f0  [anon:libc_malloc]
          0000007f8286c9c8  83912a6d48ea586e  
-         0000007f8286c9d0  0000007f8286ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+         0000007f8286c9d0  0000007f8286ca60  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286c9d8  0000007f83045824  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+68)
-         0000007f8286c9e0  0000007f8286ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+         0000007f8286c9e0  0000007f8286ca90  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286c9e8  0000007f83294338  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+128)
          0000007f8286c9f0  0000007f8348d600  [anon:libc_malloc]
          0000007f8286c9f8  83912a6d48ea586e  
-    #00  0000007f8286ca00  0000007f8286ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+    #00  0000007f8286ca00  0000007f8286ca90  [anon:dalvik-Heap thread pool worker thread 5]
          ........  ........
-    #01  0000007f8286ca00  0000007f8286ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+    #01  0000007f8286ca00  0000007f8286ca90  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286ca08  0000007f8329436c  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+180)
          0000007f8286ca10  0000007f8348d600  [anon:libc_malloc]
          0000007f8286ca18  0000007f834b1800  [anon:libc_malloc]
@@ -5428,19 +5428,19 @@
          0000007f8286ca78  0000000000000000  
          0000007f8286ca80  0000007f834d0d10  [anon:libc_malloc]
          0000007f8286ca88  83912a6d48ea586e  
-    #02  0000007f8286ca90  0000007f8286caf0  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+    #02  0000007f8286ca90  0000007f8286caf0  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286ca98  0000007f83295120  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
          0000007f8286caa0  0000007f775ba5c0  [anon:libc_malloc]
          0000007f8286caa8  0000007f83455100  [anon:libc_malloc]
          0000007f8286cab0  0000007f834d0d10  [anon:libc_malloc]
-         0000007f8286cab8  0000007f8286cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+         0000007f8286cab8  0000007f8286cb60  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286cac0  0000007f775ba5c0  [anon:libc_malloc]
          0000007f8286cac8  0000007f775ba5f0  [anon:libc_malloc]
          0000007f8286cad0  0000007f832950c4  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*))
          0000007f8286cad8  0000007f834d0d80  [anon:libc_malloc]
          0000007f8286cae0  0000007fdbe90368  [stack]
          0000007f8286cae8  0000007f83373d40  /system/lib64/libart.so
-    #03  0000007f8286caf0  0000007f8286cb30  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+    #03  0000007f8286caf0  0000007f8286cb30  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286caf8  0000007f87073324  /system/lib64/libc.so (__pthread_start(void*)+56)
          0000007f8286cb00  0000007f834d0d00  [anon:libc_malloc]
          0000007f8286cb08  0000007f834d0d80  [anon:libc_malloc]
@@ -5448,13 +5448,13 @@
          0000007f8286cb18  0000007f83cc2000  
          0000007f8286cb20  0000007f00000000  
          0000007f8286cb28  0000000000002000  
-    #04  0000007f8286cb30  0000007f8286cb50  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+    #04  0000007f8286cb30  0000007f8286cb50  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286cb38  0000007f8706f708  /system/lib64/libc.so (__start_thread+20)
          0000007f8286cb40  00000000000023ca  
          0000007f8286cb48  0000007f87385e30  /system/bin/linker64
     #05  0000007f8286cb50  0000000000000000  
          0000007f8286cb58  0000000000000000  
-         0000007f8286cb60  0000007f8286cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 5 (deleted)
+         0000007f8286cb60  0000007f8286cb60  [anon:dalvik-Heap thread pool worker thread 5]
          0000007f8286cb68  0000007f834d0d00  [anon:libc_malloc]
          0000007f8286cb70  0000000000000000  
          0000007f8286cb78  0000000000000000  
@@ -5848,40 +5848,40 @@
 
 stack:
          0000007f8276c900  0000007f834d1010  [anon:libc_malloc]
-         0000007f8276c908  0000007f8276cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276c908  0000007f8276cb60  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276c910  0000007f775ba640  [anon:libc_malloc]
          0000007f8276c918  0000007f83294134  /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*))
          0000007f8276c920  0000007f8310265c  /system/lib64/libart.so (art::Task::Finalize())
          0000007f8276c928  0000007f775ba640  [anon:libc_malloc]
          0000007f8276c930  0000007fdbe90368  [stack]
-         0000007f8276c938  0000007f8276ca7c  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276c938  0000007f8276ca7c  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276c940  0000000100000000  
-         0000007f8276c948  0000007f8276ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
-         0000007f8276c950  0000007f8276cab0  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276c948  0000007f8276ca90  [anon:dalvik-Heap thread pool worker thread 6]
+         0000007f8276c950  0000007f8276cab0  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276c958  000000000000002e  
-         0000007f8276c960  0000007f8276ca80  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276c960  0000007f8276ca80  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276c968  0000007f83349b70  /system/lib64/libart.so
          0000007f8276c970  0000007f83348c10  /system/lib64/libart.so
          0000007f8276c978  0000007f83348af0  /system/lib64/libart.so
-         0000007f8276c980  0000007f8276c9e0  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276c980  0000007f8276c9e0  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276c988  0000007f8328c770  /system/lib64/libart.so (art::Thread::Attach(char const*, bool, _jobject*, bool)+252)
          0000007f8276c990  0000007f833fb000  /system/lib64/libart.so
          0000007f8276c998  0000007f83455100  [anon:libc_malloc]
          0000007f8276c9a0  0000007f00430000  
          0000007f8276c9a8  0043000000550000  
-         0000007f8276c9b0  0000007f8276ca60  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276c9b0  0000007f8276ca60  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276c9b8  0000007f83045808  /system/lib64/libart.so (art::Barrier::Wait(art::Thread*)+40)
          0000007f8276c9c0  0000007f8348d6f0  [anon:libc_malloc]
          0000007f8276c9c8  0000007f7c060800  [anon:libc_malloc]
          0000007f8276c9d0  0000007f8348d738  [anon:libc_malloc]
          0000007f8276c9d8  0000007f8348d700  [anon:libc_malloc]
-         0000007f8276c9e0  0000007f8276ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276c9e0  0000007f8276ca90  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276c9e8  0000007f83294338  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+128)
          0000007f8276c9f0  0000007f8348d600  [anon:libc_malloc]
          0000007f8276c9f8  83912a6d48ea586e  
-    #00  0000007f8276ca00  0000007f8276ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+    #00  0000007f8276ca00  0000007f8276ca90  [anon:dalvik-Heap thread pool worker thread 6]
          ........  ........
-    #01  0000007f8276ca00  0000007f8276ca90  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+    #01  0000007f8276ca00  0000007f8276ca90  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276ca08  0000007f8329436c  /system/lib64/libart.so (art::ThreadPoolWorker::Run()+180)
          0000007f8276ca10  0000007f8348d600  [anon:libc_malloc]
          0000007f8276ca18  0000007f7c060800  [anon:libc_malloc]
@@ -5899,19 +5899,19 @@
          0000007f8276ca78  0000000000000000  
          0000007f8276ca80  0000007f834d1010  [anon:libc_malloc]
          0000007f8276ca88  83912a6d48ea586e  
-    #02  0000007f8276ca90  0000007f8276caf0  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+    #02  0000007f8276ca90  0000007f8276caf0  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276ca98  0000007f83295120  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
          0000007f8276caa0  0000007f775ba640  [anon:libc_malloc]
          0000007f8276caa8  0000007f83455100  [anon:libc_malloc]
          0000007f8276cab0  0000007f834d1010  [anon:libc_malloc]
-         0000007f8276cab8  0000007f8276cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276cab8  0000007f8276cb60  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276cac0  0000007f775ba640  [anon:libc_malloc]
          0000007f8276cac8  0000007f775ba670  [anon:libc_malloc]
          0000007f8276cad0  0000007f832950c4  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*))
          0000007f8276cad8  0000007f834d1080  [anon:libc_malloc]
          0000007f8276cae0  0000007fdbe90368  [stack]
          0000007f8276cae8  0000007f83373d40  /system/lib64/libart.so
-    #03  0000007f8276caf0  0000007f8276cb30  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+    #03  0000007f8276caf0  0000007f8276cb30  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276caf8  0000007f87073324  /system/lib64/libc.so (__pthread_start(void*)+56)
          0000007f8276cb00  0000007f834d1000  [anon:libc_malloc]
          0000007f8276cb08  0000007f834d1080  [anon:libc_malloc]
@@ -5919,13 +5919,13 @@
          0000007f8276cb18  0000007f83cc0000  
          0000007f8276cb20  0000007f00000000  
          0000007f8276cb28  0000000000002000  
-    #04  0000007f8276cb30  0000007f8276cb50  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+    #04  0000007f8276cb30  0000007f8276cb50  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276cb38  0000007f8706f708  /system/lib64/libc.so (__start_thread+20)
          0000007f8276cb40  00000000000023ca  
          0000007f8276cb48  0000007f87385e30  /system/bin/linker64
     #05  0000007f8276cb50  0000000000000000  
          0000007f8276cb58  0000000000000000  
-         0000007f8276cb60  0000007f8276cb60  /dev/ashmem/dalvik-Heap thread pool worker thread 6 (deleted)
+         0000007f8276cb60  0000007f8276cb60  [anon:dalvik-Heap thread pool worker thread 6]
          0000007f8276cb68  0000007f834d1000  [anon:libc_malloc]
          0000007f8276cb70  0000000000000000  
          0000007f8276cb78  0000000000000000  
@@ -6848,7 +6848,7 @@
          0000007f8256e330  0000007f8256e4c0  [stack:9176]
          0000007f8256e338  ffffff80ffffffd8  
          0000007f8256e340  0000007f8256e574  [stack:9176]
-         0000007f8256e348  00000000833641d8  /dev/ashmem/dalvik-large object space (deleted)
+         0000007f8256e348  00000000833641d8  [anon:dalvik-large object space]
          0000007f8256e350  ffffffff00000208  
          0000007f8256e358  0000007f8256e570  [stack:9176]
          0000007f8256e360  0000000000000004  
@@ -7526,7 +7526,7 @@
          0000007f8236c710  0000007f834bb800  [anon:libc_malloc]
          0000007f8236c718  0000000070f40720  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f8236c720  0000000070e15998  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f8236c728  0000000012c02040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f8236c728  0000000012c02040  [anon:dalvik-main space]
          0000007f8236c730  0000000071159a6c  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f8236c738  0000007f833ff100  
          0000007f8236c740  0000007f8236c860  [stack:9178]
@@ -7540,7 +7540,7 @@
          0000007f8236c780  0000000070f40720  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f8236c788  0000000070f40720  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f8236c790  0000000070e15998  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f8236c798  0000000012c02040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f8236c798  0000000012c02040  [anon:dalvik-main space]
          0000007f8236c7a0  0000000071159a6c  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f8236c7a8  0000007f833ff100  
          0000007f8236c7b0  0000007f8236cac0  [stack:9178]
@@ -7552,7 +7552,7 @@
          0000007f8236c7e0  0000000000000000  
          0000007f8236c7e8  0000007f834bb800  [anon:libc_malloc]
          0000007f8236c7f0  0000000070e15998  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f8236c7f8  0000000012c280a0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f8236c7f8  0000000012c280a0  [anon:dalvik-main space]
          0000007f8236c800  00000000704b1448  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f8236c808  0000007f8236c998  [stack:9178]
          0000007f8236c810  0000007f8236cae0  [stack:9178]
@@ -7980,12 +7980,12 @@
          0000007f822646f8  0000007f00000000  
          0000007f82264700  0000000000000001  
          0000007f82264708  00000000706746c8  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f82264710  0000000012c5e040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f82264710  0000000012c5e040  [anon:dalvik-main space]
          0000007f82264718  0000000075d495dc  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f82264720  00000000706746c8  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f82264728  0000000070e160e0  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f82264730  0000000070e15958  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f82264738  0000000012c02040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f82264738  0000000012c02040  [anon:dalvik-main space]
 
 memory near x0:
     0000007f8341ab70 0000007f77510d60 0000000000000000  
@@ -8391,19 +8391,19 @@
          0000007f8205c778  0000000073c6f6cc  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f8205c780  70e15958704a7208  
          0000007f8205c788  0000000073c6e640  /data/dalvik-cache/arm64/system@framework@boot.oat
-         0000007f8205c790  0000007f704a6dc8  /dev/ashmem/dalvik-allocspace main rosalloc space live-bitmap 3 (deleted)
+         0000007f8205c790  0000007f704a6dc8  [anon:dalvik-allocspace main rosalloc space live-bitmap 3]
          0000007f8205c798  00000000704a7248  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f8205c7a0  0000000000000001  
          0000007f8205c7a8  0000000070e15958  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f8205c7b0  0000007f8205c998  [stack:9180]
          0000007f8205c7b8  0000000073c6f83c  /data/dalvik-cache/arm64/system@framework@boot.oat
-         0000007f8205c7c0  0000007f704a7248  /dev/ashmem/dalvik-allocspace main rosalloc space live-bitmap 3 (deleted)
+         0000007f8205c7c0  0000007f704a7248  [anon:dalvik-allocspace main rosalloc space live-bitmap 3]
          0000007f8205c7c8  0000007f83348af0  /system/lib64/libart.so
          0000007f8205c7d0  0000007f8205c7f0  [stack:9180]
          0000007f8205c7d8  0000007f850e32a4  /system/lib64/libc++.so (operator new(unsigned long)+40)
          0000007f8205c7e0  0000000000000000  
          0000007f8205c7e8  0000000070e15958  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f8205c7f0  0000000012c28160  /dev/ashmem/dalvik-main space (deleted)
+         0000007f8205c7f0  0000000012c28160  [anon:dalvik-main space]
          0000007f8205c7f8  00000000704b1448  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f8205c800  0000007f8205c998  [stack:9180]
          0000007f8205c808  0000007f8205cae0  [stack:9180]
@@ -9340,7 +9340,7 @@
          0000007f7c8e55a8  0000000000004000  
          0000007f7c8e55b0  0000007f83420d00  [anon:libc_malloc]
          0000007f7c8e55b8  000000000000000f  
-         0000007f7c8e55c0  0000007f81f45000  /dev/ashmem/dalvik-indirect ref table (deleted)
+         0000007f7c8e55c0  0000007f81f45000  [anon:dalvik-indirect ref table]
          0000007f7c8e55c8  0000007f8341a1e0  [anon:libc_malloc]
          0000007f7c8e55d0  0000007f7c8e5680  [stack:9182]
          0000007f7c8e55d8  0000007f8312d564  /system/lib64/libart.so (art::gc::Heap::DoPendingTransitionOrTrim()+132)
@@ -9358,14 +9358,14 @@
          0000007f7c8e5638  0000007f834bd000  [anon:libc_malloc]
          0000007f7c8e5640  0000000000000008  
          0000007f7c8e5648  0000007f83227c20  /system/lib64/libart.so (art::Monitor::MonitorExit(art::Thread*, art::mirror::Object*)+372)
-         0000007f7c8e5650  00000000834bd000  /dev/ashmem/dalvik-large object space (deleted)
+         0000007f7c8e5650  00000000834bd000  [anon:dalvik-large object space]
          0000007f7c8e5658  0000007f8348c000  [anon:libc_malloc]
     #00  0000007f7c8e5660  0000007f7c8e5680  [stack:9182]
          ........  ........
     #01  0000007f7c8e5660  0000007f7c8e5680  [stack:9182]
          0000007f7c8e5668  0000007f8312d650  /system/lib64/libart.so (art::gc::Heap::DoPendingTransitionOrTrim()+368)
          0000007f7c8e5670  0000000000000004  
-         0000007f7c8e5678  000000003b99faf8  /dev/ashmem/dalvik-main space (deleted)
+         0000007f7c8e5678  000000003b99faf8  [anon:dalvik-main space]
     #02  0000007f7c8e5680  0000007f7c8e5860  [stack:9182]
          0000007f7c8e5688  0000000073bd364c  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f7c8e5690  000000000000005e  
@@ -9415,7 +9415,7 @@
          0000007f7c8e57f0  70e0d618704a7488  
          0000007f7c8e57f8  83912a6d48ea586e  
          0000007f7c8e5800  0000000070e15988  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f7c8e5808  0000000012c281c0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f7c8e5808  0000000012c281c0  [anon:dalvik-main space]
          0000007f7c8e5810  00000000704b1448  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f7c8e5818  0000000073c84600  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f7c8e5820  00000000704b1448  /data/dalvik-cache/arm64/system@framework@boot.art
@@ -10630,7 +10630,7 @@
          0000007f7c6e37f0  70e15968704a7348  
          0000007f7c6e37f8  83912a6d48ea586e  
          0000007f7c6e3800  0000000070e15968  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f7c6e3808  0000000012c28220  /dev/ashmem/dalvik-main space (deleted)
+         0000007f7c6e3808  0000000012c28220  [anon:dalvik-main space]
          0000007f7c6e3810  00000000704b1448  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f7c6e3818  0000000073c84600  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f7c6e3820  00000000704b1448  /data/dalvik-cache/arm64/system@framework@boot.art
@@ -10939,13 +10939,13 @@
          0000007f79a4c310  00000000704b3208  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79a4c318  0000000000000030  
          0000007f79a4c320  0000000000000030  
-         0000007f79a4c328  0000000012d3f1f0  /dev/ashmem/dalvik-main space (deleted)
-         0000007f79a4c330  0000000012d3f1c0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79a4c328  0000000012d3f1f0  [anon:dalvik-main space]
+         0000007f79a4c330  0000000012d3f1c0  [anon:dalvik-main space]
          0000007f79a4c338  0000000070e09968  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79a4c340  00000000704b3048  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79a4c348  0000000073c86b2c  /data/dalvik-cache/arm64/system@framework@boot.oat
-         0000007f79a4c350  0000007f704b3048  /dev/ashmem/dalvik-allocspace main rosalloc space live-bitmap 3 (deleted)
-         0000007f79a4c358  0000000012d3f1c0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79a4c350  0000007f704b3048  [anon:dalvik-allocspace main rosalloc space live-bitmap 3]
+         0000007f79a4c358  0000000012d3f1c0  [anon:dalvik-main space]
          0000007f79a4c360  0000007f79a4c3a0  [stack:9186]
          0000007f79a4c368  0000007f870baa4c  /system/lib64/libc.so (arena_run_split_remove+96)
          0000007f79a4c370  0000000000000007  
@@ -10982,7 +10982,7 @@
          0000007f79a4c458  0000000000000000  
          0000007f79a4c460  0000000000000000  
          0000007f79a4c468  00000000ffffffff  
-         0000007f79a4c470  0000000012d3f1c0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79a4c470  0000000012d3f1c0  [anon:dalvik-main space]
          0000007f79a4c478  0000000000000000  
          0000007f79a4c480  00000000ffffffff  
          0000007f79a4c488  0000000000000000  
@@ -11023,11 +11023,11 @@
          0000007f79a4c648  0000000100000000  
          0000007f79a4c650  0000000070ee4990  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79a4c658  0000000000000001  
-         0000007f79a4c660  0000000012d3f1c0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79a4c660  0000000012d3f1c0  [anon:dalvik-main space]
          0000007f79a4c668  0000000000000000  
          0000007f79a4c670  000000007061e908  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79a4c678  00000000ffffffff  
-         0000007f79a4c680  0000000012d3f1c0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79a4c680  0000000012d3f1c0  [anon:dalvik-main space]
          0000007f79a4c688  0000000000000000  
          0000007f79a4c690  00000000ffffffff  
          0000007f79a4c698  0000000000000000  
@@ -11461,15 +11461,15 @@
          0000007f79846350  0000000000000004  
          0000007f79846358  0000007f83044ddc  /system/lib64/libart.so (art_quick_resolution_trampoline+92)
          0000007f79846360  000000000000005c  
-         0000007f79846368  0000000012d31c40  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846368  0000000012d31c40  [anon:dalvik-main space]
          0000007f79846370  0000007f834c4800  [anon:libc_malloc]
-         0000007f79846378  0000000012d49880  /dev/ashmem/dalvik-main space (deleted)
-         0000007f79846380  0000000012c6d180  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846378  0000000012d49880  [anon:dalvik-main space]
+         0000007f79846380  0000000012c6d180  [anon:dalvik-main space]
          0000007f79846388  00000000000493e0  
-         0000007f79846390  0000000012d4a060  /dev/ashmem/dalvik-main space (deleted)
-         0000007f79846398  0000000012d2f7c0  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846390  0000000012d4a060  [anon:dalvik-main space]
+         0000007f79846398  0000000012d2f7c0  [anon:dalvik-main space]
          0000007f798463a0  0000000000000001  
-         0000007f798463a8  0000000012c6d100  /dev/ashmem/dalvik-main space (deleted)
+         0000007f798463a8  0000000012c6d100  [anon:dalvik-main space]
          0000007f798463b0  0000007f79846ab0  [stack:9187]
          0000007f798463b8  0000007f83349b70  /system/lib64/libart.so
          0000007f798463c0  0000007f83348c10  /system/lib64/libart.so
@@ -11495,19 +11495,19 @@
          0000007f79846450  0000000000000000  
          0000007f79846458  0000000000000000  
          0000007f79846460  0000000000000000  
-         0000007f79846468  0000000012d49880  /dev/ashmem/dalvik-main space (deleted)
-         0000007f79846470  0000000012d4b040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846468  0000000012d49880  [anon:dalvik-main space]
+         0000007f79846470  0000000012d4b040  [anon:dalvik-main space]
          0000007f79846478  0000000000000000  
          0000007f79846480  00000000000493e0  
          0000007f79846488  0000000000000000  
          0000007f79846490  0000007f79846ab0  [stack:9187]
          0000007f79846498  0000007f83349b70  /system/lib64/libart.so
          0000007f798464a0  0000007f83348c10  /system/lib64/libart.so
-         0000007f798464a8  0000000012d4b040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f798464a8  0000000012d4b040  [anon:dalvik-main space]
          0000007f798464b0  00000000000a9aac  
-         0000007f798464b8  0000000012c6d180  /dev/ashmem/dalvik-main space (deleted)
+         0000007f798464b8  0000000012c6d180  [anon:dalvik-main space]
          0000007f798464c0  00000000000a9aac  
-         0000007f798464c8  0000000012c6d100  /dev/ashmem/dalvik-main space (deleted)
+         0000007f798464c8  0000000012c6d100  [anon:dalvik-main space]
          0000007f798464d0  0000000000000004  
          0000007f798464d8  000000007460f414  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f798464e0  000000007058fd08  /data/dalvik-cache/arm64/system@framework@boot.art
@@ -11526,7 +11526,7 @@
          0000007f798465f0  0000007f835c78e0  [anon:libc_malloc]
          0000007f798465f8  0000007f83496440  [anon:libc_malloc]
          0000007f79846600  0000007f834c4800  [anon:libc_malloc]
-         0000007f79846608  0000000012c6d180  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846608  0000000012c6d180  [anon:dalvik-main space]
          0000007f79846610  000000007061e908  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79846618  0000000073bdd2e8  /data/dalvik-cache/arm64/system@framework@boot.oat
     #04  0000007f79846620  00000000000606cc  
@@ -11537,11 +11537,11 @@
          0000007f79846648  0000000100000000  
          0000007f79846650  0000000070ee4990  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79846658  0000000000000001  
-         0000007f79846660  0000000012d4b040  /dev/ashmem/dalvik-main space (deleted)
-         0000007f79846668  0000000012c6d180  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846660  0000000012d4b040  [anon:dalvik-main space]
+         0000007f79846668  0000000012c6d180  [anon:dalvik-main space]
          0000007f79846670  000000007061e908  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f79846678  0000000012d49880  /dev/ashmem/dalvik-main space (deleted)
-         0000007f79846680  0000000012d4b040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846678  0000000012d49880  [anon:dalvik-main space]
+         0000007f79846680  0000000012d4b040  [anon:dalvik-main space]
          0000007f79846688  0000000000000000  
          0000007f79846690  00000000000493e0  
          0000007f79846698  0000000000000000  
@@ -11564,7 +11564,7 @@
          0000007f79846720  00000000706169c8  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f79846728  0000000000000000  
          0000007f79846730  0000000000000000  
-         0000007f79846738  0000000012d49880  /dev/ashmem/dalvik-main space (deleted)
+         0000007f79846738  0000000012d49880  [anon:dalvik-main space]
 
 memory near x1:
     0000007f798464c0 00000000000a9aac 0000000012c6d100  
@@ -11967,16 +11967,16 @@
          0000007f6e805310  00000000704b3208  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e805318  0000000000000030  
          0000007f6e805320  0000000000000030  
-         0000007f6e805328  0000000012d6f070  /dev/ashmem/dalvik-main space (deleted)
-         0000007f6e805330  0000000012d6f040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e805328  0000000012d6f070  [anon:dalvik-main space]
+         0000007f6e805330  0000000012d6f040  [anon:dalvik-main space]
          0000007f6e805338  0000000070e09968  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e805340  00000000704b3048  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e805348  0000000073c86b2c  /data/dalvik-cache/arm64/system@framework@boot.oat
-         0000007f6e805350  0000007f704b3048  /dev/ashmem/dalvik-allocspace main rosalloc space live-bitmap 3 (deleted)
-         0000007f6e805358  0000000012d6f040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e805350  0000007f704b3048  [anon:dalvik-allocspace main rosalloc space live-bitmap 3]
+         0000007f6e805358  0000000012d6f040  [anon:dalvik-main space]
          0000007f6e805360  0000000071159fac  /data/dalvik-cache/arm64/system@framework@boot.oat
          0000007f6e805368  00000000704b3088  /data/dalvik-cache/arm64/system@framework@boot.art
-         0000007f6e805370  0000000012d6f070  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e805370  0000000012d6f070  [anon:dalvik-main space]
          0000007f6e805378  0000000070e09968  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e805380  0000007f6e805528  [stack:9189]
          0000007f6e805388  0000000073cb4550  /data/dalvik-cache/arm64/system@framework@boot.oat
@@ -11985,7 +11985,7 @@
          0000007f6e8053a0  0000007f6e805480  [stack:9189]
          0000007f6e8053a8  0000007f831df4fc  /system/lib64/libart.so (art::JNI::DeleteLocalRef(_JNIEnv*, _jobject*)+608)
          0000007f6e8053b0  0000007f77664540  [anon:libc_malloc]
-         0000007f6e8053b8  0000000012d6f040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e8053b8  0000000012d6f040  [anon:dalvik-main space]
          0000007f6e8053c0  0000007f7c065000  [anon:libc_malloc]
          0000007f6e8053c8  0000000000000001  
          0000007f6e8053d0  0000007f6e805430  [stack:9189]
@@ -12010,7 +12010,7 @@
          0000007f6e805458  0000000000000000  
          0000007f6e805460  0000000000000000  
          0000007f6e805468  00000000ffffffff  
-         0000007f6e805470  0000000012d6f040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e805470  0000000012d6f040  [anon:dalvik-main space]
          0000007f6e805478  0000000000000000  
          0000007f6e805480  00000000ffffffff  
          0000007f6e805488  0000000000000000  
@@ -12051,11 +12051,11 @@
          0000007f6e805648  0000000100000000  
          0000007f6e805650  0000000070ee4990  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e805658  0000000000000001  
-         0000007f6e805660  0000000012d6f040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e805660  0000000012d6f040  [anon:dalvik-main space]
          0000007f6e805668  0000000000000000  
          0000007f6e805670  000000007061e908  /data/dalvik-cache/arm64/system@framework@boot.art
          0000007f6e805678  00000000ffffffff  
-         0000007f6e805680  0000000012d6f040  /dev/ashmem/dalvik-main space (deleted)
+         0000007f6e805680  0000000012d6f040  [anon:dalvik-main space]
          0000007f6e805688  0000000000000000  
          0000007f6e805690  00000000ffffffff  
          0000007f6e805698  0000000000000000  
@@ -12538,7 +12538,7 @@
          df4a09a8  df4a0a58  [stack:4066]
          df4a09ac  00000002
          df4a09b0  df4a09c4  [stack:4066]
-         df4a09b4  ef5a8548  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         df4a09b4  ef5a8548  [anon:dalvik-LinearAlloc]
          df4a09b8  ffffffff
          df4a09bc  e02c8900  /data/app/com.rovio.ABstellapop-1/oat/x86/base.odex
          df4a09c0  eba35c00  [anon:libc_malloc]
@@ -12656,7 +12656,7 @@
          df4a0f34  000023a1
          df4a0f38  df4a0f60  [stack:4066]
          df4a0f3c  df4a0f5c  [stack:4066]
-         df4a0f40  ef5a55d8  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         df4a0f40  ef5a55d8  [anon:dalvik-LinearAlloc]
          df4a0f44  ea136c80  [anon:libc_malloc]
          df4a0f48  f3f494b4  /system/lib/libart.so (artQuickResolutionTrampoline+1508)
          df4a0f4c  df4a0fe0  [stack:4066]
@@ -12670,12 +12670,12 @@
          ........  ........
     #09  df4a0f8c  f40ea140  [anon:libc_malloc]
          df4a0f90  000023a1
-         df4a0f94  ef5a55d8  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         df4a0f94  ef5a55d8  [anon:dalvik-LinearAlloc]
          df4a0f98  00000001
          df4a0f9c  df4a0fe0  [stack:4066]
          df4a0fa0  f4039ab8  /system/lib/libart.so
          df4a0fa4  00000001
-         df4a0fa8  12d79040  /dev/ashmem/dalvik-main space (deleted)
+         df4a0fa8  12d79040  [anon:dalvik-main space]
          df4a0fac  f6a43ee8  /system/lib/libEGL.so
          df4a0fb0  eba35c00  [anon:libc_malloc]
          df4a0fb4  00000001
@@ -12687,25 +12687,25 @@
          ........  ........
     #10  df4a103c  000023a1
          df4a1040  0000000b
-         df4a1044  ef5a55d8  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         df4a1044  ef5a55d8  [anon:dalvik-LinearAlloc]
          df4a1048  eba35c00  [anon:libc_malloc]
          df4a104c  70b86250  /data/dalvik-cache/x86/system@framework@boot.art
          df4a1050  743790c0  /data/dalvik-cache/x86/system@framework@boot.oat
          df4a1054  00430000
          df4a1058  960b50d7
-         df4a105c  12d79040  /dev/ashmem/dalvik-main space (deleted)
+         df4a105c  12d79040  [anon:dalvik-main space]
          df4a1060  708e53c8  /data/dalvik-cache/x86/system@framework@boot.art
-         df4a1064  12c04a80  /dev/ashmem/dalvik-main space (deleted)
+         df4a1064  12c04a80  [anon:dalvik-main space]
          df4a1068  e0bf8651  /data/app/com.rovio.ABstellapop-1/oat/x86/base.odex
-    #11  df4a106c  ef5a55d8  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    #11  df4a106c  ef5a55d8  [anon:dalvik-LinearAlloc]
          df4a1070  df4a108c  [stack:4066]
-         df4a1074  12d79040  /dev/ashmem/dalvik-main space (deleted)
+         df4a1074  12d79040  [anon:dalvik-main space]
          df4a1078  f3a1c7de  /system/lib/libart.so (art_quick_resolution_trampoline+78)
          df4a107c  70b861b0  /data/dalvik-cache/x86/system@framework@boot.art
-         df4a1080  12d79040  /dev/ashmem/dalvik-main space (deleted)
+         df4a1080  12d79040  [anon:dalvik-main space]
          df4a1084  eba35c00  [anon:libc_malloc]
          df4a1088  df4a108c  [stack:4066]
-         df4a108c  ef5a55d8  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         df4a108c  ef5a55d8  [anon:dalvik-LinearAlloc]
          df4a1090  0000ff00
          df4a1094  00000000
          df4a1098  65640030
@@ -12842,18 +12842,18 @@
 
 memory map: (fault address prefixed with --->)
 --->Fault address falls at 00000000 before any mapped regions
-    12c00000-12e06fff rw-         0    207000  /dev/ashmem/dalvik-main space (deleted)
-    12e07000-1ebfffff ---    207000   bdf9000  /dev/ashmem/dalvik-main space (deleted)
-    32c00000-32c00fff rw-         0      1000  /dev/ashmem/dalvik-main space 1 (deleted)
-    32c01000-3ebfffff ---      1000   bfff000  /dev/ashmem/dalvik-main space 1 (deleted)
+    12c00000-12e06fff rw-         0    207000  [anon:dalvik-main space]
+    12e07000-1ebfffff ---    207000   bdf9000  [anon:dalvik-main space]
+    32c00000-32c00fff rw-         0      1000  [anon:dalvik-main space 1]
+    32c01000-3ebfffff ---      1000   bfff000  [anon:dalvik-main space 1]
     701e5000-70bc1fff rw-         0    9dd000  /data/dalvik-cache/x86/system@framework@boot.art
     70bc2000-72a8cfff r--         0   1ecb000  /data/dalvik-cache/x86/system@framework@boot.oat
     72a8d000-7479efff r-x   1ecb000   1d12000  /data/dalvik-cache/x86/system@framework@boot.oat (load base 0x72a8d000)
     7479f000-7479ffff rw-   3bdd000      1000  /data/dalvik-cache/x86/system@framework@boot.oat
-    747a0000-74a6afff rw-         0    2cb000  /dev/ashmem/dalvik-zygote space (deleted)
-    74a6b000-74a6bfff rw-         0      1000  /dev/ashmem/dalvik-non moving space (deleted)
-    74a6c000-77fa0fff ---      1000   3535000  /dev/ashmem/dalvik-non moving space (deleted)
-    77fa1000-7879ffff rw-   3536000    7ff000  /dev/ashmem/dalvik-non moving space (deleted)
+    747a0000-74a6afff rw-         0    2cb000  [anon:dalvik-zygote space]
+    74a6b000-74a6bfff rw-         0      1000  [anon:dalvik-non moving space]
+    74a6c000-77fa0fff ---      1000   3535000  [anon:dalvik-non moving space]
+    77fa1000-7879ffff rw-   3536000    7ff000  [anon:dalvik-non moving space]
     db1d6000-db5befff rw-         0    3e9000  /dev/ashmem/gralloc-1232.40 (deleted)
     db5bf000-db5bffff ---    3e9000      1000  /dev/ashmem/gralloc-1232.40 (deleted)
     db5c0000-db5c0fff ---         0      1000  [anon:libc_malloc]
@@ -12876,11 +12876,11 @@
     de7a4000-de7ddfff r-x         0     3a000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eSkynest.so
     de7de000-de7defff r--     39000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eSkynest.so
     de7df000-de7dffff rw-     3a000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eSkynest.so
-    de7e1000-de9d5fff rw-         0    1f5000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    de7e1000-de9d5fff rw-         0    1f5000  [anon:dalvik-large object space allocation]
     de9d6000-dedbefff rw-         0    3e9000  /dev/ashmem/gralloc-1232.35 (deleted)
     dedbf000-dedbffff ---    3e9000      1000  /dev/ashmem/gralloc-1232.35 (deleted)
-    dedc0000-df1a8fff rw-         0    3e9000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    df1a9000-df39dfff rw-         0    1f5000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    dedc0000-df1a8fff rw-         0    3e9000  [anon:dalvik-large object space allocation]
+    df1a9000-df39dfff rw-         0    1f5000  [anon:dalvik-large object space allocation]
     df39e000-df39efff ---         0      1000
     df39f000-df39ffff ---         0      1000
     df3a0000-df4a2fff rw-         0    103000  [stack:4066]
@@ -12892,8 +12892,8 @@
     dfb6b000-e0554fff r--         0    9ea000  /data/app/com.rovio.ABstellapop-1/oat/x86/base.odex
     e0555000-e0f06fff r-x    9ea000    9b2000  /data/app/com.rovio.ABstellapop-1/oat/x86/base.odex (load base 0x9ea000)
     e0f07000-e0f07fff rw-   139c000      1000  /data/app/com.rovio.ABstellapop-1/oat/x86/base.odex
-    e0f08000-e1707fff rw-         0    800000  /dev/ashmem/dalvik-allocspace main rosalloc space mark-bitmap 3 (deleted)
-    e1708000-e1f07fff rw-         0    800000  /dev/ashmem/dalvik-allocspace main rosalloc space live-bitmap 3 (deleted)
+    e0f08000-e1707fff rw-         0    800000  [anon:dalvik-allocspace main rosalloc space mark-bitmap 3]
+    e1708000-e1f07fff rw-         0    800000  [anon:dalvik-allocspace main rosalloc space live-bitmap 3]
     e1f08000-e8307fff ---         0   6400000
     e8308000-e832bfff r--         0     24000  /system/usr/hyphen-data/hyph-nn.hyb
     e832c000-e834ffff r--         0     24000  /system/usr/hyphen-data/hyph-nb.hyb
@@ -12959,9 +12959,9 @@
     ea0f3000-ea0f5fff r--     79000      3000  /system/lib/libmedia_jni.so
     ea0f6000-ea0f6fff rw-     7c000      1000  /system/lib/libmedia_jni.so
     ea0f7000-ea0f7fff rw-         0      1000
-    ea0f8000-ea0fbfff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    ea0f8000-ea0fbfff rw-         0      4000  [anon:dalvik-large object space allocation]
     ea100000-ea13ffff rw-         0     40000  [anon:libc_malloc]
-    ea157000-ea15bfff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    ea157000-ea15bfff rw-         0      5000  [anon:dalvik-large object space allocation]
     ea161000-ea162fff r-x         0      2000  /system/lib/libwebviewchromium_loader.so (BuildId: 7ac66444f1de2d1fb5c6c78daa75261b)
     ea163000-ea163fff r--      1000      1000  /system/lib/libwebviewchromium_loader.so
     ea164000-ea164fff rw-      2000      1000  /system/lib/libwebviewchromium_loader.so
@@ -12969,48 +12969,48 @@
     ea16d000-ea180fff r-x         0     14000  /system/lib/libandroid.so (BuildId: 4d02959a3d6b4d99b08e798dd9f6874c)
     ea181000-ea182fff r--     13000      2000  /system/lib/libandroid.so
     ea183000-ea183fff rw-     15000      1000  /system/lib/libandroid.so
-    ea184000-ea188fff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea189000-ea199fff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea19a000-ea1aafff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea1ab000-ea1bbfff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea1bc000-ea1ccfff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea1cd000-ea1ddfff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea1de000-ea1eefff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea1ef000-ea1fffff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    ea184000-ea188fff rw-         0      5000  [anon:dalvik-large object space allocation]
+    ea189000-ea199fff rw-         0     11000  [anon:dalvik-large object space allocation]
+    ea19a000-ea1aafff rw-         0     11000  [anon:dalvik-large object space allocation]
+    ea1ab000-ea1bbfff rw-         0     11000  [anon:dalvik-large object space allocation]
+    ea1bc000-ea1ccfff rw-         0     11000  [anon:dalvik-large object space allocation]
+    ea1cd000-ea1ddfff rw-         0     11000  [anon:dalvik-large object space allocation]
+    ea1de000-ea1eefff rw-         0     11000  [anon:dalvik-large object space allocation]
+    ea1ef000-ea1fffff rw-         0     11000  [anon:dalvik-large object space allocation]
     ea200000-ea27ffff rw-         0     80000  [anon:libc_malloc]
-    ea280000-ea284fff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    ea280000-ea284fff rw-         0      5000  [anon:dalvik-large object space allocation]
     ea285000-ea2bffff r--    f01000     3b000  /system/framework/framework-res.apk
     ea2c0000-ea2fffff rw-         0     40000  [anon:libc_malloc]
     ea300000-ea300fff r-x         0      1000  /system/lib/libjnigraphics.so (BuildId: 6b7923ce8a8738a5d195ec34cd35bbcb)
     ea301000-ea301fff r--         0      1000  /system/lib/libjnigraphics.so (BuildId: 6b7923ce8a8738a5d195ec34cd35bbcb)
     ea302000-ea302fff rw-      1000      1000  /system/lib/libjnigraphics.so
-    ea303000-ea307fff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea308000-ea30bfff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea30c000-ea30ffff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea310000-ea320fff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea321000-ea32afff rw-         0      a000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea32b000-ea334fff rw-         0      a000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea335000-ea33dfff rw-         0      9000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea33f000-ea342fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea343000-ea346fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea347000-ea34afff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea34b000-ea350fff rw-         0      6000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea351000-ea35dfff rw-         0      d000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea35e000-ea367fff rw-         0      a000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea368000-ea371fff rw-         0      a000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    ea303000-ea307fff rw-         0      5000  [anon:dalvik-large object space allocation]
+    ea308000-ea30bfff rw-         0      4000  [anon:dalvik-large object space allocation]
+    ea30c000-ea30ffff rw-         0      4000  [anon:dalvik-large object space allocation]
+    ea310000-ea320fff rw-         0     11000  [anon:dalvik-large object space allocation]
+    ea321000-ea32afff rw-         0      a000  [anon:dalvik-large object space allocation]
+    ea32b000-ea334fff rw-         0      a000  [anon:dalvik-large object space allocation]
+    ea335000-ea33dfff rw-         0      9000  [anon:dalvik-large object space allocation]
+    ea33f000-ea342fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    ea343000-ea346fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    ea347000-ea34afff rw-         0      4000  [anon:dalvik-large object space allocation]
+    ea34b000-ea350fff rw-         0      6000  [anon:dalvik-large object space allocation]
+    ea351000-ea35dfff rw-         0      d000  [anon:dalvik-large object space allocation]
+    ea35e000-ea367fff rw-         0      a000  [anon:dalvik-large object space allocation]
+    ea368000-ea371fff rw-         0      a000  [anon:dalvik-large object space allocation]
     ea373000-ea373fff r--         0      1000  /system/usr/hyphen-data/hyph-und-ethi.hyb
-    ea374000-ea378fff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea379000-ea37dfff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea37e000-ea381fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ea382000-ea385fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    ea374000-ea378fff rw-         0      5000  [anon:dalvik-large object space allocation]
+    ea379000-ea37dfff rw-         0      5000  [anon:dalvik-large object space allocation]
+    ea37e000-ea381fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    ea382000-ea385fff rw-         0      4000  [anon:dalvik-large object space allocation]
     ea386000-ea3fefff r--         0     79000  /system/usr/share/zoneinfo/tzdata
     ea3ff000-eb9fffff r--         0   1601000  /system/usr/icu/icudt55l.dat
     eba00000-eba3ffff rw-         0     40000  [anon:libc_malloc]
-    eba40000-eba43fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    eba44000-eba47fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    eba48000-eba4cfff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    eba4d000-eba51fff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    eba52000-eba56fff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    eba40000-eba43fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    eba44000-eba47fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    eba48000-eba4cfff rw-         0      5000  [anon:dalvik-large object space allocation]
+    eba4d000-eba51fff rw-         0      5000  [anon:dalvik-large object space allocation]
+    eba52000-eba56fff rw-         0      5000  [anon:dalvik-large object space allocation]
     eba57000-eba60fff r--         0      a000  /system/fonts/CarroisGothicSC-Regular.ttf
     eba61000-eba7dfff r--         0     1d000  /system/fonts/DancingScript-Bold.ttf
     eba7e000-eba9afff r--         0     1d000  /system/fonts/DancingScript-Regular.ttf
@@ -13154,11 +13154,11 @@
     eda40000-eda40fff r--         0      1000  [anon:linker_alloc]
     eda41000-eda42fff r--         0      2000  /system/fonts/NotoSansBuginese-Regular.ttf
     eda43000-eda5ffff r--         0     1d000  /system/fonts/NotoNaskhArabic-Regular.ttf
-    eda60000-eda7ffff rw-         0     20000  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    eda60000-eda7ffff rw-         0     20000  [anon:dalvik-LinearAlloc]
     eda80000-edabffff rw-         0     40000  [anon:libc_malloc]
     edac0000-edac0fff r--         0      1000  [anon:linker_alloc]
     edac1000-edac5fff r--         0      5000  /system/fonts/NotoSansHebrew-Regular.ttf
-    edac6000-edac9fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    edac6000-edac9fff rw-         0      4000  [anon:dalvik-large object space allocation]
     edaca000-edacafff r--         0      1000
     edb00000-edb8bfff rw-         0     8c000  [anon:libc_malloc]
     edb8c000-edb8cfff ---         0      1000  [anon:libc_malloc]
@@ -13174,7 +13174,7 @@
     edeb8000-edeb8fff r--     29000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eFacebookV4.so
     edeb9000-edeb9fff rw-     2a000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eFacebookV4.so
     edeba000-edebefff rw-         0      5000
-    edebf000-ededefff rw-         0     20000  /dev/ashmem/dalvik-rosalloc page map (deleted)
+    edebf000-ededefff rw-         0     20000  [anon:dalvik-rosalloc page map]
     ededf000-ef4dffff r--         0   1601000  /system/usr/icu/icudt55l.dat
     ef4e0000-ef53bfff r-x         0     5c000  /system/lib/libjavacore.so (BuildId: f8848f951f1a39306c7708ce0d094bc1) (load base 0x2000)
     ef53c000-ef53cfff ---         0      1000
@@ -13191,7 +13191,7 @@
     ef595000-ef595fff ---         0      1000
     ef596000-ef596fff r--      1000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eSplashScreen.so
     ef597000-ef597fff rw-      2000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eSplashScreen.so
-    ef598000-ef5b7fff rw-         0     20000  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    ef598000-ef5b7fff rw-         0     20000  [anon:dalvik-LinearAlloc]
     ef5ba000-ef5d0fff r-x         0     17000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eGooglePlayGames.so
     ef5d1000-ef5d1fff ---         0      1000
     ef5d2000-ef5d2fff r--     17000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eGooglePlayGames.so
@@ -13207,23 +13207,23 @@
     ef5e2000-ef618fff r-x         0     37000  /system/lib/libgceframebufferconfig.so (BuildId: 0054245384b5889c62b4493f5d0bdf5e)
     ef619000-ef619fff r--     36000      1000  /system/lib/libgceframebufferconfig.so
     ef61a000-ef61afff rw-     37000      1000  /system/lib/libgceframebufferconfig.so
-    ef61b000-ef77dfff rw-         0    163000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    ef77e000-ef77ffff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    ef61b000-ef77dfff rw-         0    163000  [anon:dalvik-large object space allocation]
+    ef77e000-ef77ffff rw-         0      2000  [anon:dalvik-indirect ref table]
     ef780000-ef7bffff rw-         0     40000  [anon:libc_malloc]
-    ef7c0000-ef887fff rw-         0     c8000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    ef888000-ef94ffff rw-         0     c8000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    ef950000-ef950fff rw-         0      1000  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    ef951000-ef951fff rw-         0      1000  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    ef952000-f0152fff rw-         0    801000  /dev/ashmem/dalvik-live stack (deleted)
-    f0153000-f0953fff rw-         0    801000  /dev/ashmem/dalvik-allocation stack (deleted)
-    f0954000-f0993fff rw-         0     40000  /dev/ashmem/dalvik-mark stack (deleted)
-    f0994000-f164bfff rw-         0    cb8000  /dev/ashmem/dalvik-card table (deleted)
-    f164c000-f166bfff rw-         0     20000  /dev/ashmem/dalvik-large marked objects (deleted)
-    f166c000-f168bfff rw-         0     20000  /dev/ashmem/dalvik-large live objects (deleted)
-    f168c000-f1e8bfff rw-         0    800000  /dev/ashmem/dalvik-allocspace main rosalloc space 1 mark-bitmap 2 (deleted)
-    f1e8c000-f268bfff rw-         0    800000  /dev/ashmem/dalvik-allocspace main rosalloc space 1 live-bitmap 2 (deleted)
-    f268c000-f26abfff rw-         0     20000  /dev/ashmem/dalvik-rosalloc page map (deleted)
-    f26ac000-f26adfff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    ef7c0000-ef887fff rw-         0     c8000  [anon:dalvik-indirect ref table]
+    ef888000-ef94ffff rw-         0     c8000  [anon:dalvik-indirect ref table]
+    ef950000-ef950fff rw-         0      1000  [anon:dalvik-mark sweep sweep array free buffer]
+    ef951000-ef951fff rw-         0      1000  [anon:dalvik-mark sweep sweep array free buffer]
+    ef952000-f0152fff rw-         0    801000  [anon:dalvik-live stack]
+    f0153000-f0953fff rw-         0    801000  [anon:dalvik-allocation stack]
+    f0954000-f0993fff rw-         0     40000  [anon:dalvik-mark stack]
+    f0994000-f164bfff rw-         0    cb8000  [anon:dalvik-card table]
+    f164c000-f166bfff rw-         0     20000  [anon:dalvik-large marked objects]
+    f166c000-f168bfff rw-         0     20000  [anon:dalvik-large live objects]
+    f168c000-f1e8bfff rw-         0    800000  [anon:dalvik-allocspace main rosalloc space 1 mark-bitmap 2]
+    f1e8c000-f268bfff rw-         0    800000  [anon:dalvik-allocspace main rosalloc space 1 live-bitmap 2]
+    f268c000-f26abfff rw-         0     20000  [anon:dalvik-rosalloc page map]
+    f26ac000-f26adfff rw-         0      2000  [anon:dalvik-indirect ref table]
     f26ae000-f26aefff r--         0      1000  [anon:linker_alloc]
     f26af000-f26b1fff r-x         0      3000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eAppsFlyer.so
     f26b2000-f26b2fff r--      2000      1000  /data/app/com.rovio.ABstellapop-1/lib/x86/libs3eAppsFlyer.so
@@ -13263,11 +13263,11 @@
     f29d9000-f29d9fff rw-         0      1000  [anon:linker_alloc_128]
     f29da000-f29dafff ---         0      1000
     f29db000-f29dcfff rw-         0      2000  [anon:thread signal stack]
-    f29dd000-f29defff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f29dd000-f29defff rw-         0      2000  [anon:dalvik-indirect ref table]
     f29df000-f29dffff r--         0      1000
-    f29e0000-f29e1fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    f29e2000-f29fafff rw-         0     19000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    f29fb000-f2a31fff rw-         0     37000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    f29e0000-f29e1fff rw-         0      2000  [anon:dalvik-indirect ref table]
+    f29e2000-f29fafff rw-         0     19000  [anon:dalvik-large object space allocation]
+    f29fb000-f2a31fff rw-         0     37000  [anon:dalvik-large object space allocation]
     f2a32000-f2a32fff ---         0      1000
     f2a33000-f2a33fff ---         0      1000
     f2a34000-f2b30fff rw-         0     fd000  [stack:4063]
@@ -13278,11 +13278,11 @@
     f2baa000-f2baafff r--         0      1000
     f2bab000-f2babfff ---         0      1000
     f2bac000-f2badfff rw-         0      2000  [anon:thread signal stack]
-    f2bae000-f2baffff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f2bae000-f2baffff rw-         0      2000  [anon:dalvik-indirect ref table]
     f2bb0000-f2bb0fff ---         0      1000
     f2bb1000-f2bb1fff ---         0      1000
     f2bb2000-f2caefff rw-         0     fd000  [stack:4062]
-    f2caf000-f2cb0fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f2caf000-f2cb0fff rw-         0      2000  [anon:dalvik-indirect ref table]
     f2cb1000-f2cb1fff ---         0      1000
     f2cb2000-f2cb3fff rw-         0      2000  [anon:thread signal stack]
     f2cb4000-f2cb4fff ---         0      1000
@@ -13300,36 +13300,36 @@
     f2ebd000-f2ebdfff ---         0      1000
     f2ebe000-f2ebefff ---         0      1000
     f2ebf000-f2fc1fff rw-         0    103000  [stack:4053]
-    f2fc2000-f2fc3fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f2fc2000-f2fc3fff rw-         0      2000  [anon:dalvik-indirect ref table]
     f2fc4000-f2fc4fff ---         0      1000
     f2fc5000-f2fc5fff ---         0      1000
     f2fc6000-f30c8fff rw-         0    103000  [stack:4052]
-    f30c9000-f30cafff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f30c9000-f30cafff rw-         0      2000  [anon:dalvik-indirect ref table]
     f30cb000-f30cbfff ---         0      1000
     f30cc000-f30ccfff ---         0      1000
     f30cd000-f31cffff rw-         0    103000  [stack:4051]
-    f31d0000-f31d1fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f31d0000-f31d1fff rw-         0      2000  [anon:dalvik-indirect ref table]
     f31d2000-f31d2fff ---         0      1000
     f31d3000-f31d3fff ---         0      1000
     f31d4000-f32d6fff rw-         0    103000  [stack:4050]
-    f32d7000-f32d8fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    f32d9000-f32dafff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f32d7000-f32d8fff rw-         0      2000  [anon:dalvik-indirect ref table]
+    f32d9000-f32dafff rw-         0      2000  [anon:dalvik-indirect ref table]
     f32db000-f32dbfff ---         0      1000
     f32dc000-f32ddfff rw-         0      2000  [anon:thread signal stack]
     f32de000-f32defff ---         0      1000
     f32df000-f32dffff ---         0      1000
     f32e0000-f33dcfff rw-         0     fd000  [stack:4049]
-    f33dd000-f33defff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    f33dd000-f33defff rw-         0      2000  [anon:dalvik-indirect ref table]
     f33df000-f33dffff ---         0      1000
     f33e0000-f33e1fff rw-         0      2000  [anon:thread signal stack]
     f33e2000-f33e2fff ---         0      1000
     f33e3000-f33e3fff ---         0      1000
     f33e4000-f34e0fff rw-         0     fd000  [stack:4048]
-    f34e1000-f34e1fff rw-         0      1000  /dev/ashmem/dalvik-mod union bitmap (deleted)
-    f34e2000-f35d6fff rw-         0     f5000  /dev/ashmem/dalvik-allocspace non moving space mark-bitmap 4 (deleted)
-    f35d7000-f36cbfff rw-         0     f5000  /dev/ashmem/dalvik-allocspace non moving space live-bitmap 4 (deleted)
-    f36cc000-f37cbfff rw-         0    100000  /dev/ashmem/dalvik-allocspace zygote / non moving space mark-bitmap 0 (deleted)
-    f37cc000-f38cbfff rw-         0    100000  /dev/ashmem/dalvik-allocspace zygote / non moving space live-bitmap 0 (deleted)
+    f34e1000-f34e1fff rw-         0      1000  [anon:dalvik-mod union bitmap]
+    f34e2000-f35d6fff rw-         0     f5000  [anon:dalvik-allocspace non moving space mark-bitmap 4]
+    f35d7000-f36cbfff rw-         0     f5000  [anon:dalvik-allocspace non moving space live-bitmap 4]
+    f36cc000-f37cbfff rw-         0    100000  [anon:dalvik-allocspace zygote / non moving space mark-bitmap 0]
+    f37cc000-f38cbfff rw-         0    100000  [anon:dalvik-allocspace zygote / non moving space live-bitmap 0]
     f38cc000-f38e8fff r--    9dd000     1d000  /data/dalvik-cache/x86/system@framework@boot.art
     f38e9000-f38e9fff r-x         0      1000  /system/lib/libsigchain.so (BuildId: c68fe06104678512830047a4a9a11070)
     f38ea000-f38eafff r--         0      1000  /system/lib/libsigchain.so (BuildId: c68fe06104678512830047a4a9a11070)
@@ -13340,7 +13340,7 @@
     f403d000-f403dfff rw-    750000      1000  /system/lib/libart.so
     f403e000-f403ffff rw-         0      2000
     f4040000-f413ffff rw-         0    100000  [anon:libc_malloc]
-    f4140000-f4140fff rw-         0      1000  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
+    f4140000-f4140fff rw-         0      1000  [anon:dalvik-mark sweep sweep array free buffer]
     f4141000-f4142fff r--         0      2000
     f4143000-f4162fff r--         0     20000  /dev/__properties__
     f4163000-f4163fff rw-         0      1000  [anon:linker_alloc_vector]
@@ -13713,8 +13713,8 @@
     #02  fff2a9d0  00000008
          fff2a9d4  c0186201
          fff2a9d8  fff2a9f8  [stack]
-         fff2a9dc  12c5d130  /dev/ashmem/dalvik-main space (deleted)
-         fff2a9e0  12cba300  /dev/ashmem/dalvik-main space (deleted)
+         fff2a9dc  12c5d130  [anon:dalvik-main space]
+         fff2a9e0  12cba300  [anon:dalvik-main space]
          fff2a9e4  00016269
          fff2a9e8  00000000
          fff2a9ec  f4043324  [anon:libc_malloc]
@@ -13782,10 +13782,10 @@
          fff2ab88  00430000
          fff2ab8c  00000002
          fff2ab90  f40f4500  [anon:libc_malloc]
-         fff2ab94  12ce4280  /dev/ashmem/dalvik-main space (deleted)
+         fff2ab94  12ce4280  [anon:dalvik-main space]
          fff2ab98  eba05080  [anon:libc_malloc]
-         fff2ab9c  12ce4280  /dev/ashmem/dalvik-main space (deleted)
-         fff2aba0  12c04f00  /dev/ashmem/dalvik-main space (deleted)
+         fff2ab9c  12ce4280  [anon:dalvik-main space]
+         fff2aba0  12c04f00  [anon:dalvik-main space]
          fff2aba4  00000008
          fff2aba8  705557c8  /data/dalvik-cache/x86/system@framework@boot.art
          fff2abac  73ba49c5  /data/dalvik-cache/x86/system@framework@boot.oat
@@ -13795,14 +13795,14 @@
          fff2abbc  fff2abe0  [stack]
          fff2abc0  fff2abe4  [stack]
          fff2abc4  00000000
-         fff2abc8  12ce4280  /dev/ashmem/dalvik-main space (deleted)
+         fff2abc8  12ce4280  [anon:dalvik-main space]
          fff2abcc  73be10f3  /data/dalvik-cache/x86/system@framework@boot.oat
          fff2abd0  70b84ab8  /data/dalvik-cache/x86/system@framework@boot.art
          fff2abd4  fff2b0b4  [stack]
          fff2abd8  00000003
-         fff2abdc  12c04f00  /dev/ashmem/dalvik-main space (deleted)
-         fff2abe0  12ce4280  /dev/ashmem/dalvik-main space (deleted)
-         fff2abe4  12ce42a0  /dev/ashmem/dalvik-main space (deleted)
+         fff2abdc  12c04f00  [anon:dalvik-main space]
+         fff2abe0  12ce4280  [anon:dalvik-main space]
+         fff2abe4  12ce42a0  [anon:dalvik-main space]
          fff2abe8  00000006
          fff2abec  ffffffff
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -14168,7 +14168,7 @@
          72da6ec6  06858b00
          72da6eca  8bfd43f8
          72da6ece  0001c8b0
-         72da6ed2  75f68500  /dev/ashmem/dalvik-non moving space (deleted)
+         72da6ed2  75f68500  [anon:dalvik-non moving space]
          72da6ed6  06b58b6d
          72da6eda  8bfd43f8
          72da6ede  5578b8ce
@@ -14307,7 +14307,7 @@
          706f1280  7077a010  /data/dalvik-cache/x86/system@framework@boot.art
          706f1284  00000000
          706f1288  00000216
-         706f128c  12ca3ce0  /dev/ashmem/dalvik-main space (deleted)
+         706f128c  12ca3ce0  [anon:dalvik-main space]
          706f1290  00000006
          706f1294  00000000
          706f1298  7073deb0  /data/dalvik-cache/x86/system@framework@boot.art
@@ -14448,15 +14448,15 @@
          f30c864c  72da6977  /data/dalvik-cache/x86/system@framework@boot.oat
          ........  ........
     #06  70725388  70408380  /data/dalvik-cache/x86/system@framework@boot.art
-         7072538c  12ca7e20  /dev/ashmem/dalvik-main space (deleted)
+         7072538c  12ca7e20  [anon:dalvik-main space]
          70725390  7075f3d8  /data/dalvik-cache/x86/system@framework@boot.art
          70725394  00000000
          70725398  704097e8  /data/dalvik-cache/x86/system@framework@boot.art
-         7072539c  12ca7e80  /dev/ashmem/dalvik-main space (deleted)
+         7072539c  12ca7e80  [anon:dalvik-main space]
          707253a0  7075f5b0  /data/dalvik-cache/x86/system@framework@boot.art
          707253a4  4f40d9f6
          707253a8  70417d68  /data/dalvik-cache/x86/system@framework@boot.art
-         707253ac  12ca7d60  /dev/ashmem/dalvik-main space (deleted)
+         707253ac  12ca7d60  [anon:dalvik-main space]
          707253b0  70760d20  /data/dalvik-cache/x86/system@framework@boot.art
          707253b4  00000000
          707253b8  70725128  /data/dalvik-cache/x86/system@framework@boot.art
@@ -15410,52 +15410,52 @@
     00007f2bf9faba60 fffa64c8e8c789d8 00000000801f0fc3  .....d..........
 
 memory map:
-    00000000'12c00000-00000000'12e06fff rw-         0    207000  /dev/ashmem/dalvik-main space (deleted)
-    00000000'12e07000-00000000'13006fff rw-    207000    200000  /dev/ashmem/dalvik-main space (deleted)
-    00000000'13007000-00000000'16bfffff ---    407000   3bf9000  /dev/ashmem/dalvik-main space (deleted)
-    00000000'16c00000-00000000'16c00fff rw-         0      1000  /dev/ashmem/dalvik-main space 1 (deleted)
-    00000000'16c01000-00000000'1abfffff ---      1000   3fff000  /dev/ashmem/dalvik-main space 1 (deleted)
-    00000000'400cc000-00000000'400e4fff rw-         0     19000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40211000-00000000'40217fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'4033e000-00000000'40344fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40585000-00000000'40588fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'405fa000-00000000'405fefff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'4060c000-00000000'40612fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40626000-00000000'4062cfff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40699000-00000000'4069ffff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'407a2000-00000000'407a8fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'407a9000-00000000'407affff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40983000-00000000'4098bfff rw-         0      9000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'4098c000-00000000'40992fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40adc000-00000000'40ae4fff rw-         0      9000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40ae5000-00000000'40af5fff rw-         0     11000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40af6000-00000000'40b6bfff rw-         0     76000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40b79000-00000000'40b7dfff rw-         0      5000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40b8f000-00000000'40b94fff rw-         0      6000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40b99000-00000000'40ba2fff rw-         0      a000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40fa0000-00000000'40fa6fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'40ff0000-00000000'40ff3fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'4108f000-00000000'410a2fff rw-         0     14000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'4112a000-00000000'41137fff rw-         0      e000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'41439000-00000000'41442fff rw-         0      a000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'41465000-00000000'4146bfff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'414fe000-00000000'41504fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'41505000-00000000'41856fff rw-         0    352000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'418db000-00000000'418e1fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'4198f000-00000000'41992fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'419e9000-00000000'419f5fff rw-         0      d000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'41ba4000-00000000'41ba7fff rw-         0      4000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'41d72000-00000000'41d78fff rw-         0      7000  /dev/ashmem/dalvik-large object space allocation (deleted)
-    00000000'41d79000-00000000'4241bfff rw-         0    6a3000  /dev/ashmem/dalvik-large object space allocation (deleted)
+    00000000'12c00000-00000000'12e06fff rw-         0    207000  [anon:dalvik-main space]
+    00000000'12e07000-00000000'13006fff rw-    207000    200000  [anon:dalvik-main space]
+    00000000'13007000-00000000'16bfffff ---    407000   3bf9000  [anon:dalvik-main space]
+    00000000'16c00000-00000000'16c00fff rw-         0      1000  [anon:dalvik-main space 1]
+    00000000'16c01000-00000000'1abfffff ---      1000   3fff000  [anon:dalvik-main space 1]
+    00000000'400cc000-00000000'400e4fff rw-         0     19000  [anon:dalvik-large object space allocation]
+    00000000'40211000-00000000'40217fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'4033e000-00000000'40344fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'40585000-00000000'40588fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    00000000'405fa000-00000000'405fefff rw-         0      5000  [anon:dalvik-large object space allocation]
+    00000000'4060c000-00000000'40612fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'40626000-00000000'4062cfff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'40699000-00000000'4069ffff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'407a2000-00000000'407a8fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'407a9000-00000000'407affff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'40983000-00000000'4098bfff rw-         0      9000  [anon:dalvik-large object space allocation]
+    00000000'4098c000-00000000'40992fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'40adc000-00000000'40ae4fff rw-         0      9000  [anon:dalvik-large object space allocation]
+    00000000'40ae5000-00000000'40af5fff rw-         0     11000  [anon:dalvik-large object space allocation]
+    00000000'40af6000-00000000'40b6bfff rw-         0     76000  [anon:dalvik-large object space allocation]
+    00000000'40b79000-00000000'40b7dfff rw-         0      5000  [anon:dalvik-large object space allocation]
+    00000000'40b8f000-00000000'40b94fff rw-         0      6000  [anon:dalvik-large object space allocation]
+    00000000'40b99000-00000000'40ba2fff rw-         0      a000  [anon:dalvik-large object space allocation]
+    00000000'40fa0000-00000000'40fa6fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'40ff0000-00000000'40ff3fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    00000000'4108f000-00000000'410a2fff rw-         0     14000  [anon:dalvik-large object space allocation]
+    00000000'4112a000-00000000'41137fff rw-         0      e000  [anon:dalvik-large object space allocation]
+    00000000'41439000-00000000'41442fff rw-         0      a000  [anon:dalvik-large object space allocation]
+    00000000'41465000-00000000'4146bfff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'414fe000-00000000'41504fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'41505000-00000000'41856fff rw-         0    352000  [anon:dalvik-large object space allocation]
+    00000000'418db000-00000000'418e1fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'4198f000-00000000'41992fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    00000000'419e9000-00000000'419f5fff rw-         0      d000  [anon:dalvik-large object space allocation]
+    00000000'41ba4000-00000000'41ba7fff rw-         0      4000  [anon:dalvik-large object space allocation]
+    00000000'41d72000-00000000'41d78fff rw-         0      7000  [anon:dalvik-large object space allocation]
+    00000000'41d79000-00000000'4241bfff rw-         0    6a3000  [anon:dalvik-large object space allocation]
     00000000'708a8000-00000000'71592fff rw-         0    ceb000  /data/dalvik-cache/x86_64/system@framework@boot.art
     00000000'71593000-00000000'73466fff r--         0   1ed4000  /data/dalvik-cache/x86_64/system@framework@boot.oat
     00000000'73467000-00000000'753c0fff r-x   1ed4000   1f5a000  /data/dalvik-cache/x86_64/system@framework@boot.oat (load base 0x73467000)
     00000000'753c1000-00000000'753c1fff rw-   3e2e000      1000  /data/dalvik-cache/x86_64/system@framework@boot.oat
-    00000000'753c2000-00000000'754a5fff rw-         0     e4000  /dev/ashmem/dalvik-zygote space (deleted)
-    00000000'754a6000-00000000'754a6fff rw-         0      1000  /dev/ashmem/dalvik-non moving space (deleted)
-    00000000'754a7000-00000000'754affff rw-      1000      9000  /dev/ashmem/dalvik-non moving space (deleted)
-    00000000'754b0000-00000000'78fc2fff ---      a000   3b13000  /dev/ashmem/dalvik-non moving space (deleted)
-    00000000'78fc3000-00000000'793c1fff rw-   3b1d000    3ff000  /dev/ashmem/dalvik-non moving space (deleted)
+    00000000'753c2000-00000000'754a5fff rw-         0     e4000  [anon:dalvik-zygote space]
+    00000000'754a6000-00000000'754a6fff rw-         0      1000  [anon:dalvik-non moving space]
+    00000000'754a7000-00000000'754affff rw-      1000      9000  [anon:dalvik-non moving space]
+    00000000'754b0000-00000000'78fc2fff ---      a000   3b13000  [anon:dalvik-non moving space]
+    00000000'78fc3000-00000000'793c1fff rw-   3b1d000    3ff000  [anon:dalvik-non moving space]
     00000335'5962f000-00000335'5963ffff ---         0     11000
     00000335'59640000-00000335'5965ffff rw-         0     20000
     00000335'59660000-00000335'5968efff ---         0     2f000
@@ -15548,7 +15548,7 @@
     00007f2b'e3ec2000-00007f2b'e3ec2fff ---         0      1000
     00007f2b'e3ec3000-00007f2b'e3fbffff rw-         0     fd000  [stack:2291]
     00007f2b'e3fc0000-00007f2b'e40bffff rw-         0    100000  [anon:libc_malloc]
-    00007f2b'e40db000-00007f2b'e40fafff rw-         0     20000  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    00007f2b'e40db000-00007f2b'e40fafff rw-         0     20000  [anon:dalvik-LinearAlloc]
     00007f2b'e40fb000-00007f2b'e40fbfff ---         0      1000
     00007f2b'e40fc000-00007f2b'e40fcfff ---         0      1000
     00007f2b'e40fd000-00007f2b'e41fffff rw-         0    103000  [stack:2290]
@@ -15557,7 +15557,7 @@
     00007f2b'e4257000-00007f2b'e4258fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e4259000-00007f2b'e4259fff ---         0      1000
     00007f2b'e425a000-00007f2b'e425bfff rw-         0      2000  [stack:2298]
-    00007f2b'e425c000-00007f2b'e427bfff rw-         0     20000  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    00007f2b'e425c000-00007f2b'e427bfff rw-         0     20000  [anon:dalvik-LinearAlloc]
     00007f2b'e427c000-00007f2b'e427cfff ---         0      1000
     00007f2b'e427d000-00007f2b'e427dfff ---         0      1000
     00007f2b'e427e000-00007f2b'e4380fff rw-         0    103000  [stack:2289]
@@ -15568,40 +15568,40 @@
     00007f2b'e44c1000-00007f2b'e44c1fff ---         0      1000
     00007f2b'e44c2000-00007f2b'e45bffff rw-         0     fe000  [stack:2287]
     00007f2b'e45c0000-00007f2b'e46bffff rw-         0    100000  [anon:libc_malloc]
-    00007f2b'e46c0000-00007f2b'e46c1fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e46c0000-00007f2b'e46c1fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e46c2000-00007f2b'e46c2fff ---         0      1000
     00007f2b'e46c3000-00007f2b'e46c4fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e46c5000-00007f2b'e46c5fff ---         0      1000
     00007f2b'e46c6000-00007f2b'e46c7fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e46c8000-00007f2b'e46c9fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'e46ca000-00007f2b'e46cbfff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e46c8000-00007f2b'e46c9fff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'e46ca000-00007f2b'e46cbfff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e46cc000-00007f2b'e46ccfff ---         0      1000
     00007f2b'e46cd000-00007f2b'e46cefff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e46cf000-00007f2b'e46cffff ---         0      1000
     00007f2b'e46d0000-00007f2b'e46d1fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e46d2000-00007f2b'e46d2fff ---         0      1000
     00007f2b'e46d3000-00007f2b'e46d4fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e46d5000-00007f2b'e46d6fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'e46d7000-00007f2b'e46d8fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e46d5000-00007f2b'e46d6fff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'e46d7000-00007f2b'e46d8fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e46d9000-00007f2b'e46d9fff ---         0      1000
     00007f2b'e46da000-00007f2b'e46dbfff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e46dc000-00007f2b'e46dcfff ---         0      1000
     00007f2b'e46dd000-00007f2b'e46defff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e46df000-00007f2b'e46e0fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e46df000-00007f2b'e46e0fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e46e1000-00007f2b'e46e1fff ---         0      1000
     00007f2b'e46e2000-00007f2b'e46e2fff ---         0      1000
     00007f2b'e46e3000-00007f2b'e47dffff rw-         0     fd000  [stack:2286]
-    00007f2b'e47e0000-00007f2b'e47fffff rw-         0     20000  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    00007f2b'e47e0000-00007f2b'e47fffff rw-         0     20000  [anon:dalvik-LinearAlloc]
     00007f2b'e4800000-00007f2b'e483ffff rw-         0     40000  [anon:libc_malloc]
     00007f2b'e4840000-00007f2b'e4840fff ---         0      1000
     00007f2b'e4841000-00007f2b'e4842fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e4843000-00007f2b'e4843fff ---         0      1000
     00007f2b'e4844000-00007f2b'e4845fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e4846000-00007f2b'e484dfff rw-         0      8000  /data/data/com.android.browser/databases/browser2.db-shm
-    00007f2b'e484e000-00007f2b'e484ffff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e484e000-00007f2b'e484ffff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4850000-00007f2b'e4850fff ---         0      1000
     00007f2b'e4851000-00007f2b'e4852fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e4853000-00007f2b'e4854fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e4853000-00007f2b'e4854fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4855000-00007f2b'e4857fff r-x         0      3000  /system/lib64/hw/gralloc.default.so
     00007f2b'e4858000-00007f2b'e4858fff r--      2000      1000  /system/lib64/hw/gralloc.default.so
     00007f2b'e4859000-00007f2b'e4859fff rw-      3000      1000  /system/lib64/hw/gralloc.default.so
@@ -15617,7 +15617,7 @@
     00007f2b'e486f000-00007f2b'e486ffff rw-      5000      1000  /system/lib64/hw/gralloc.goldfish.so
     00007f2b'e4870000-00007f2b'e4870fff ---         0      1000
     00007f2b'e4871000-00007f2b'e4872fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e4873000-00007f2b'e4874fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e4873000-00007f2b'e4874fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4875000-00007f2b'e4875fff ---         0      1000
     00007f2b'e4876000-00007f2b'e4877fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e4878000-00007f2b'e4878fff ---         0      1000
@@ -15627,7 +15627,7 @@
     00007f2b'e4978000-00007f2b'e4979fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e497a000-00007f2b'e497afff ---         0      1000
     00007f2b'e497b000-00007f2b'e4a78fff rw-         0     fe000  [stack:2284]
-    00007f2b'e4a79000-00007f2b'e4a7afff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e4a79000-00007f2b'e4a7afff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4a7b000-00007f2b'e4a7bfff ---         0      1000
     00007f2b'e4a7c000-00007f2b'e4a7dfff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e4a7e000-00007f2b'e4a7efff ---         0      1000
@@ -15636,7 +15636,7 @@
     00007f2b'e4b7d000-00007f2b'e4b7dfff ---         0      1000
     00007f2b'e4b7e000-00007f2b'e4b7ffff rw-         0      2000  [anon:thread signal stack]
     00007f2b'e4b80000-00007f2b'e4bbffff rw-         0     40000  [anon:libc_malloc]
-    00007f2b'e4bc1000-00007f2b'e4bc2fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e4bc1000-00007f2b'e4bc2fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4bc3000-00007f2b'e4bc3fff ---         0      1000
     00007f2b'e4bc4000-00007f2b'e4cc1fff rw-         0     fe000  [stack:2282]
     00007f2b'e4cc2000-00007f2b'e4cc2fff ---         0      1000
@@ -15648,25 +15648,25 @@
     00007f2b'e4ec0000-00007f2b'e4efffff rw-         0     40000  [anon:libc_malloc]
     00007f2b'e4f00000-00007f2b'e4f00fff ---         0      1000
     00007f2b'e4f01000-00007f2b'e4f02fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e4f03000-00007f2b'e4f04fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e4f03000-00007f2b'e4f04fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4f05000-00007f2b'e4f05fff ---         0      1000
     00007f2b'e4f06000-00007f2b'e4f07fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e4f08000-00007f2b'e4f09fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e4f08000-00007f2b'e4f09fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4f0a000-00007f2b'e4f0afff ---         0      1000
     00007f2b'e4f0b000-00007f2b'e4f0cfff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e4f0d000-00007f2b'e4f0efff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e4f0d000-00007f2b'e4f0efff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e4f0f000-00007f2b'e4f0ffff ---         0      1000
     00007f2b'e4f10000-00007f2b'e4f10fff ---         0      1000
     00007f2b'e4f11000-00007f2b'e500dfff rw-         0     fd000  [stack:2279]
     00007f2b'e500e000-00007f2b'e500efff ---         0      1000
     00007f2b'e500f000-00007f2b'e5010fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e5011000-00007f2b'e5012fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e5011000-00007f2b'e5012fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e5013000-00007f2b'e5013fff ---         0      1000
     00007f2b'e5014000-00007f2b'e5014fff ---         0      1000
     00007f2b'e5015000-00007f2b'e5111fff rw-         0     fd000  [stack:2278]
     00007f2b'e5112000-00007f2b'e5112fff ---         0      1000
     00007f2b'e5113000-00007f2b'e5114fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'e5115000-00007f2b'e5116fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e5115000-00007f2b'e5116fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e5117000-00007f2b'e5117fff ---         0      1000
     00007f2b'e5118000-00007f2b'e5118fff ---         0      1000
     00007f2b'e5119000-00007f2b'e5215fff rw-         0     fd000  [stack:2277]
@@ -15705,7 +15705,7 @@
     00007f2b'e5f36000-00007f2b'e5f36fff ---         0      1000
     00007f2b'e5f37000-00007f2b'e5f37fff ---         0      1000
     00007f2b'e5f38000-00007f2b'e603afff rw-         0    103000  [stack:2270]
-    00007f2b'e603b000-00007f2b'e603cfff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'e603b000-00007f2b'e603cfff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'e603d000-00007f2b'e61fefff r--         0    1c2000  /system/app/webview/oat/x86_64/webview.odex
     00007f2b'e61ff000-00007f2b'e6358fff r-x    1c2000    15a000  /system/app/webview/oat/x86_64/webview.odex (load base 0x1c2000)
     00007f2b'e6359000-00007f2b'e6359fff rw-    31c000      1000  /system/app/webview/oat/x86_64/webview.odex
@@ -15748,8 +15748,8 @@
     00007f2b'e7208000-00007f2b'e7208fff ---         0      1000
     00007f2b'e7209000-00007f2b'e7209fff ---         0      1000
     00007f2b'e720a000-00007f2b'e7306fff rw-         0     fd000  [stack:2257]
-    00007f2b'e7307000-00007f2b'e7386fff rw-         0     80000  /dev/ashmem/dalvik-jit-code-cache (deleted)
-    00007f2b'e7387000-00007f2b'e7506fff rwx     80000    180000  /dev/ashmem/dalvik-jit-code-cache (deleted)
+    00007f2b'e7307000-00007f2b'e7386fff rw-         0     80000  [anon:dalvik-jit-code-cache]
+    00007f2b'e7387000-00007f2b'e7506fff rwx     80000    180000  [anon:dalvik-jit-code-cache]
     00007f2b'e7507000-00007f2b'e7a75fff r-x         0    56f000  /system/lib64/libart-compiler.so
     00007f2b'e7a76000-00007f2b'e7a76fff ---         0      1000
     00007f2b'e7a77000-00007f2b'e7ab9fff r--    56f000     43000  /system/lib64/libart-compiler.so
@@ -15775,9 +15775,9 @@
     00007f2b'ee005000-00007f2b'ee006fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'ee007000-00007f2b'ee007fff ---         0      1000
     00007f2b'ee008000-00007f2b'ee009fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'ee00a000-00007f2b'ee00bfff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'ee00c000-00007f2b'ee00dfff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'ee00e000-00007f2b'ee00ffff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'ee00a000-00007f2b'ee00bfff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'ee00c000-00007f2b'ee00dfff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'ee00e000-00007f2b'ee00ffff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'ee010000-00007f2b'ee010fff ---         0      1000
     00007f2b'ee011000-00007f2b'ee012fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'ee013000-00007f2b'ee01bfff r--    2a3000      9000  /system/app/Browser/Browser.apk
@@ -15795,7 +15795,7 @@
     00007f2b'ee5e1000-00007f2b'ee5e1fff rw-     1b000      1000  /system/lib64/libandroid.so
     00007f2b'ee5e2000-00007f2b'ee67ffff r--    ff3000     9e000  /system/framework/framework-res.apk
     00007f2b'ee680000-00007f2b'ee73ffff rw-         0     c0000  [anon:libc_malloc]
-    00007f2b'ee740000-00007f2b'ee741fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'ee740000-00007f2b'ee741fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'ee742000-00007f2b'ee76cfff r-x         0     2b000  /system/lib64/egl/libGLES_android.so
     00007f2b'ee76d000-00007f2b'ee76efff r--     2a000      2000  /system/lib64/egl/libGLES_android.so
     00007f2b'ee76f000-00007f2b'ee76ffff rw-     2c000      1000  /system/lib64/egl/libGLES_android.so
@@ -15985,13 +15985,13 @@
     00007f2b'f2040000-00007f2b'f2040fff r--         0      1000  [anon:linker_alloc]
     00007f2b'f2041000-00007f2b'f2042fff r--         0      2000  /system/fonts/NotoSansBuhid-Regular.ttf
     00007f2b'f2043000-00007f2b'f205ffff r--         0     1d000  /system/fonts/NotoNaskhArabic-Bold.ttf
-    00007f2b'f2060000-00007f2b'f207ffff rw-         0     20000  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    00007f2b'f2060000-00007f2b'f207ffff rw-         0     20000  [anon:dalvik-LinearAlloc]
     00007f2b'f2080000-00007f2b'f20bffff rw-         0     40000  [anon:libc_malloc]
     00007f2b'f20c0000-00007f2b'f20dcfff r--         0     1d000  /system/fonts/NotoNaskhArabic-Regular.ttf
     00007f2b'f20dd000-00007f2b'f20ddfff rw-         0      1000
     00007f2b'f20de000-00007f2b'f20defff ---         0      1000
     00007f2b'f20df000-00007f2b'f20e0fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'f20e1000-00007f2b'f20e2fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'f20e1000-00007f2b'f20e2fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'f20e3000-00007f2b'f20e3fff ---         0      1000
     00007f2b'f20e4000-00007f2b'f20e5fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'f20e6000-00007f2b'f20e6fff ---         0      1000
@@ -16000,45 +16000,45 @@
     00007f2b'f20ea000-00007f2b'f20ebfff rw-         0      2000  [anon:thread signal stack]
     00007f2b'f20ec000-00007f2b'f20ecfff ---         0      1000
     00007f2b'f20ed000-00007f2b'f20eefff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'f20ef000-00007f2b'f20f0fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f20f1000-00007f2b'f20f1fff rw-         0      1000  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
-    00007f2b'f20f2000-00007f2b'f20f2fff ---      1000      1000  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
-    00007f2b'f20f3000-00007f2b'f21f0fff rw-      2000     fe000  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+    00007f2b'f20ef000-00007f2b'f20f0fff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'f20f1000-00007f2b'f20f1fff rw-         0      1000  [anon:dalvik-Jit thread pool worker thread 0]
+    00007f2b'f20f2000-00007f2b'f20f2fff ---      1000      1000  [anon:dalvik-Jit thread pool worker thread 0]
+    00007f2b'f20f3000-00007f2b'f21f0fff rw-      2000     fe000  [anon:dalvik-Jit thread pool worker thread 0]
     00007f2b'f21f1000-00007f2b'f22e4fff r-x         0     f4000  /system/lib64/libvixl.so (BuildId: 89dc2162d431d3d40e6765d1f9241b44)
     00007f2b'f22e5000-00007f2b'f22e9fff r--     f3000      5000  /system/lib64/libvixl.so
     00007f2b'f22ea000-00007f2b'f22eafff rw-     f8000      1000  /system/lib64/libvixl.so
     00007f2b'f22eb000-00007f2b'f22f0fff rw-         0      6000
-    00007f2b'f22f1000-00007f2b'f23f0fff rw-         0    100000  /dev/ashmem/dalvik-allocspace main rosalloc space mark-bitmap 3 (deleted)
-    00007f2b'f23f1000-00007f2b'f24f0fff rw-         0    100000  /dev/ashmem/dalvik-allocspace main rosalloc space live-bitmap 3 (deleted)
+    00007f2b'f22f1000-00007f2b'f23f0fff rw-         0    100000  [anon:dalvik-allocspace main rosalloc space mark-bitmap 3]
+    00007f2b'f23f1000-00007f2b'f24f0fff rw-         0    100000  [anon:dalvik-allocspace main rosalloc space live-bitmap 3]
     00007f2b'f24f1000-00007f2b'f3af0fff r--         0   1600000  /system/usr/icu/icudt55l.dat
-    00007f2b'f3af1000-00007f2b'f3b10fff rw-         0     20000  /dev/ashmem/dalvik-LinearAlloc (deleted)
+    00007f2b'f3af1000-00007f2b'f3b10fff rw-         0     20000  [anon:dalvik-LinearAlloc]
     00007f2b'f3b11000-00007f2b'f3b70fff r-x         0     60000  /system/lib64/libjavacore.so
     00007f2b'f3b71000-00007f2b'f3b71fff ---         0      1000
     00007f2b'f3b72000-00007f2b'f3b73fff r--     60000      2000  /system/lib64/libjavacore.so
     00007f2b'f3b74000-00007f2b'f3b76fff rw-     62000      3000  /system/lib64/libjavacore.so
     00007f2b'f3b77000-00007f2b'f3b77fff rw-         0      1000
-    00007f2b'f3b78000-00007f2b'f3c3ffff rw-         0     c8000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f3c40000-00007f2b'f3d07fff rw-         0     c8000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f3d08000-00007f2b'f4508fff rw-         0    801000  /dev/ashmem/dalvik-live stack (deleted)
-    00007f2b'f4509000-00007f2b'f4d09fff rw-         0    801000  /dev/ashmem/dalvik-allocation stack (deleted)
-    00007f2b'f4d0a000-00007f2b'f4d49fff rw-         0     40000  /dev/ashmem/dalvik-mark stack (deleted)
-    00007f2b'f4d4a000-00007f2b'f5a19fff rw-         0    cd0000  /dev/ashmem/dalvik-card table (deleted)
-    00007f2b'f5a1a000-00007f2b'f5a39fff rw-         0     20000  /dev/ashmem/dalvik-large marked objects (deleted)
-    00007f2b'f5a3a000-00007f2b'f5a59fff rw-         0     20000  /dev/ashmem/dalvik-large live objects (deleted)
-    00007f2b'f5a5a000-00007f2b'f5b59fff rw-         0    100000  /dev/ashmem/dalvik-allocspace main rosalloc space 1 mark-bitmap 2 (deleted)
-    00007f2b'f5b5a000-00007f2b'f5c59fff rw-         0    100000  /dev/ashmem/dalvik-allocspace main rosalloc space 1 live-bitmap 2 (deleted)
-    00007f2b'f5c5a000-00007f2b'f5c5bfff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f5c5c000-00007f2b'f5c5dfff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f5c5e000-00007f2b'f5c5ffff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f5c60000-00007f2b'f5d5cfff rw-         0     fd000  /dev/ashmem/dalvik-allocspace non moving space mark-bitmap 4 (deleted)
-    00007f2b'f5d5d000-00007f2b'f5e59fff rw-         0     fd000  /dev/ashmem/dalvik-allocspace non moving space live-bitmap 4 (deleted)
-    00007f2b'f5e5a000-00007f2b'f5f59fff rw-         0    100000  /dev/ashmem/dalvik-allocspace zygote / non moving space mark-bitmap 0 (deleted)
-    00007f2b'f5f5a000-00007f2b'f6059fff rw-         0    100000  /dev/ashmem/dalvik-allocspace zygote / non moving space live-bitmap 0 (deleted)
+    00007f2b'f3b78000-00007f2b'f3c3ffff rw-         0     c8000  [anon:dalvik-indirect ref table]
+    00007f2b'f3c40000-00007f2b'f3d07fff rw-         0     c8000  [anon:dalvik-indirect ref table]
+    00007f2b'f3d08000-00007f2b'f4508fff rw-         0    801000  [anon:dalvik-live stack]
+    00007f2b'f4509000-00007f2b'f4d09fff rw-         0    801000  [anon:dalvik-allocation stack]
+    00007f2b'f4d0a000-00007f2b'f4d49fff rw-         0     40000  [anon:dalvik-mark stack]
+    00007f2b'f4d4a000-00007f2b'f5a19fff rw-         0    cd0000  [anon:dalvik-card table]
+    00007f2b'f5a1a000-00007f2b'f5a39fff rw-         0     20000  [anon:dalvik-large marked objects]
+    00007f2b'f5a3a000-00007f2b'f5a59fff rw-         0     20000  [anon:dalvik-large live objects]
+    00007f2b'f5a5a000-00007f2b'f5b59fff rw-         0    100000  [anon:dalvik-allocspace main rosalloc space 1 mark-bitmap 2]
+    00007f2b'f5b5a000-00007f2b'f5c59fff rw-         0    100000  [anon:dalvik-allocspace main rosalloc space 1 live-bitmap 2]
+    00007f2b'f5c5a000-00007f2b'f5c5bfff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'f5c5c000-00007f2b'f5c5dfff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'f5c5e000-00007f2b'f5c5ffff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'f5c60000-00007f2b'f5d5cfff rw-         0     fd000  [anon:dalvik-allocspace non moving space mark-bitmap 4]
+    00007f2b'f5d5d000-00007f2b'f5e59fff rw-         0     fd000  [anon:dalvik-allocspace non moving space live-bitmap 4]
+    00007f2b'f5e5a000-00007f2b'f5f59fff rw-         0    100000  [anon:dalvik-allocspace zygote / non moving space mark-bitmap 0]
+    00007f2b'f5f5a000-00007f2b'f6059fff rw-         0    100000  [anon:dalvik-allocspace zygote / non moving space live-bitmap 0]
     00007f2b'f605a000-00007f2b'f607ffff r--    ceb000     26000  /data/dalvik-cache/x86_64/system@framework@boot.art
     00007f2b'f6080000-00007f2b'f60bffff rw-         0     40000  [anon:libc_malloc]
     00007f2b'f60c0000-00007f2b'f60c3fff r--         0      4000  /system/fonts/NotoSansArmenian-Regular.ttf
     00007f2b'f60c4000-00007f2b'f60c4fff rw-         0      1000  [anon:linker_alloc_vector]
-    00007f2b'f60c5000-00007f2b'f60c6fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'f60c5000-00007f2b'f60c6fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'f60c7000-00007f2b'f60c7fff ---         0      1000
     00007f2b'f60c8000-00007f2b'f60c9fff rw-         0      2000  [anon:thread signal stack]
     00007f2b'f60ca000-00007f2b'f60cafff ---         0      1000
@@ -16049,20 +16049,20 @@
     00007f2b'f67fd000-00007f2b'f67fffff rw-         0      3000
     00007f2b'f6800000-00007f2b'f6abffff rw-         0    2c0000  [anon:libc_malloc]
     00007f2b'f6ac0000-00007f2b'f6ac1fff r--         0      2000  /system/fonts/NotoSansBuginese-Regular.ttf
-    00007f2b'f6ac2000-00007f2b'f6ac3fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f6ac4000-00007f2b'f6ac5fff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
+    00007f2b'f6ac2000-00007f2b'f6ac3fff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'f6ac4000-00007f2b'f6ac5fff rw-         0      2000  [anon:dalvik-indirect ref table]
     00007f2b'f6ac6000-00007f2b'f6ac6fff ---         0      1000
     00007f2b'f6ac7000-00007f2b'f6ac8fff rw-         0      2000  [anon:thread signal stack]
-    00007f2b'f6ac9000-00007f2b'f6accfff rw-         0      4000  /dev/ashmem/dalvik-rosalloc page map (deleted)
-    00007f2b'f6acd000-00007f2b'f6acefff rw-         0      2000  /dev/ashmem/dalvik-indirect ref table (deleted)
-    00007f2b'f6acf000-00007f2b'f6ad0fff rw-         0      2000  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    00007f2b'f6ad1000-00007f2b'f6ad2fff rw-         0      2000  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    00007f2b'f6ad3000-00007f2b'f6ad4fff rw-         0      2000  /dev/ashmem/dalvik-mark sweep sweep array free buffer (deleted)
-    00007f2b'f6ad5000-00007f2b'f6ad8fff rw-         0      4000  /dev/ashmem/dalvik-rosalloc page map (deleted)
+    00007f2b'f6ac9000-00007f2b'f6accfff rw-         0      4000  [anon:dalvik-rosalloc page map]
+    00007f2b'f6acd000-00007f2b'f6acefff rw-         0      2000  [anon:dalvik-indirect ref table]
+    00007f2b'f6acf000-00007f2b'f6ad0fff rw-         0      2000  [anon:dalvik-mark sweep sweep array free buffer]
+    00007f2b'f6ad1000-00007f2b'f6ad2fff rw-         0      2000  [anon:dalvik-mark sweep sweep array free buffer]
+    00007f2b'f6ad3000-00007f2b'f6ad4fff rw-         0      2000  [anon:dalvik-mark sweep sweep array free buffer]
+    00007f2b'f6ad5000-00007f2b'f6ad8fff rw-         0      4000  [anon:dalvik-rosalloc page map]
     00007f2b'f6ad9000-00007f2b'f6ad9fff r--      c000      1000  /system/app/webview/webview.apk
     00007f2b'f6ada000-00007f2b'f6adafff r--         0      1000  [anon:linker_alloc]
     00007f2b'f6adb000-00007f2b'f6adbfff rw-         0      1000  [anon:linker_alloc_32]
-    00007f2b'f6adc000-00007f2b'f6adcfff rw-         0      1000  /dev/ashmem/dalvik-mod union bitmap (deleted)
+    00007f2b'f6adc000-00007f2b'f6adcfff rw-         0      1000  [anon:dalvik-mod union bitmap]
     00007f2b'f6add000-00007f2b'f6addfff r-x         0      1000  /system/lib64/libsigchain.so
     00007f2b'f6ade000-00007f2b'f6adefff r--         0      1000  /system/lib64/libsigchain.so
     00007f2b'f6adf000-00007f2b'f6adffff rw-      1000      1000  /system/lib64/libsigchain.so
@@ -16501,7 +16501,7 @@
          00007fff139c2f68  00007f2bfa37c015  /system/lib64/libbinder.so (android::Parcel::continueWrite(unsigned long)+869)
          00007fff139c2f70  0000000000000006
          00007fff139c2f78  00007f2bfa37beee  /system/lib64/libbinder.so (android::Parcel::continueWrite(unsigned long)+574)
-         00007fff139c2f80  0000000012e32040  /dev/ashmem/dalvik-main space (deleted)
+         00007fff139c2f80  0000000012e32040  [anon:dalvik-main space]
          00007fff139c2f88  0000000000000048
          00007fff139c2f90  00007fff139c3088  [stack]
          00007fff139c2f98  00007fff139c3088  [stack]
@@ -16509,8 +16509,8 @@
     #05  00007fff139c2fe0  0000000000000000
          00007fff139c2fe8  00007f2bedffe200  [anon:libc_malloc]
          00007fff139c2ff0  0000000000000000
-         00007fff139c2ff8  0000000012ca2a00  /dev/ashmem/dalvik-main space (deleted)
-         00007fff139c3000  0000000012c9c3c0  /dev/ashmem/dalvik-main space (deleted)
+         00007fff139c2ff8  0000000012ca2a00  [anon:dalvik-main space]
+         00007fff139c3000  0000000012c9c3c0  [anon:dalvik-main space]
          00007fff139c3008  00007fff139c3088  [stack]
          00007fff139c3010  00007fff139c3020  [stack]
          00007fff139c3018  00007f2bf9de19e2  /system/lib64/libgui.so (android::BpDisplayEventConnection::requestNextVsync()+82)
@@ -16537,15 +16537,15 @@
          00007fff139c3128  00007f2bf65de5e8  /system/lib64/libart.so (art::StackVisitor::WalkStack(bool)+264)
          00007fff139c3130  00007f2bf6812240  [anon:libc_malloc]
          00007fff139c3138  0000000000000001
-         00007fff139c3140  0000000012ca2a00  /dev/ashmem/dalvik-main space (deleted)
+         00007fff139c3140  0000000012ca2a00  [anon:dalvik-main space]
          00007fff139c3148  00007f2bfa253ec3  /system/lib64/libandroid_runtime.so
     #09  00007fff139c3150  00000000000000bc
          00007fff139c3158  00007f2bf9fe5b3a  /system/lib64/libc.so (je_free+42)
          00007fff139c3160  00007f2bedffe1c0  [anon:libc_malloc]
          00007fff139c3168  00007f2bedffe1c0  [anon:libc_malloc]
          00007fff139c3170  0000000000000001
-         00007fff139c3178  0000000012ca2a00  /dev/ashmem/dalvik-main space (deleted)
-         00007fff139c3180  0000000012c9c3c0  /dev/ashmem/dalvik-main space (deleted)
+         00007fff139c3178  0000000012ca2a00  [anon:dalvik-main space]
+         00007fff139c3180  0000000012c9c3c0  [anon:dalvik-main space]
          00007fff139c3188  00007f2bedffe1c0  [anon:libc_malloc]
          00007fff139c3190  0000000000000001
          00007fff139c3198  000000007381ea0e  /data/dalvik-cache/x86_64/system@framework@boot.oat
@@ -16564,7 +16564,7 @@
          00007fff139c3200  000000003f000000
          00007fff139c3208  00007f2bedffe1c0  [anon:libc_malloc]
          00007fff139c3210  0000000000000001
-         00007fff139c3218  0000000012ca2a00  /dev/ashmem/dalvik-main space (deleted)
+         00007fff139c3218  0000000012ca2a00  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2256, name: Jit thread pool  >>> com.android.browser <<<
     rax fffffffffffffe00  rbx 00007f2bf0048638  rcx ffffffffffffffff  rdx 0000000000000000
@@ -16584,12 +16584,12 @@
     #06 pc 000000000001ce55  /system/lib64/libc.so (__bionic_clone+53)
 
 stack:
-         00007f2bf21f0218  00007f2bf21f0290  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f0218  00007f2bf21f0290  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2bf21f0220  0000000000000000
          00007f2bf21f0228  00007f2bf0042000  [anon:libc_malloc]
          00007f2bf21f0230  00007f2bf6802e58  [anon:libc_malloc]
-         00007f2bf21f0238  00007f2bf21f0284  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
-         00007f2bf21f0240  00007f2bf21f0288  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f0238  00007f2bf21f0284  [anon:dalvik-Jit thread pool worker thread 0]
+         00007f2bf21f0240  00007f2bf21f0288  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2bf21f0248  00007f2bf9faa42f  /system/lib64/libc.so (pthread_setname_np+303)
          00007f2bf21f0250  00007f2bf6802e40  [anon:libc_malloc]
          00007f2bf21f0258  00007f2bf65f04ee  /system/lib64/libart.so (art::Thread::InitStringEntryPoints()+542)
@@ -16599,20 +16599,20 @@
          00007f2bf21f0278  fa0b7e1782291062
          00007f2bf21f0280  0000000000000001
          00007f2bf21f0288  00007f2bfa024a00
-         00007f2bf21f0290  00007f2bf21f02d0  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f0290  00007f2bf21f02d0  [anon:dalvik-Jit thread pool worker thread 0]
     #00  00007f2bf21f0298  00007f2bf624d1ce  /system/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+622)
     #01  00007f2bf21f02a0  0000000000000000
          00007f2bf21f02a8  00007f2bee695fa0  [anon:libc_malloc]
-         00007f2bf21f02b0  00007f2bf21f0310  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
-         00007f2bf21f02b8  00007f2bf21f0320  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f02b0  00007f2bf21f0310  [anon:dalvik-Jit thread pool worker thread 0]
+         00007f2bf21f02b8  00007f2bf21f0320  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2bf21f02c0  0000000000000000
          00007f2bf21f02c8  00007f2b00000001
          00007f2bf21f02d0  00007f2bf0048668  [anon:libc_malloc]
          00007f2bf21f02d8  00007f2b00000000
          00007f2bf21f02e0  00007f2bf0042000  [anon:libc_malloc]
          00007f2bf21f02e8  00000000f21f0344
-         00007f2bf21f02f0  00007f2bf21f0360  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
-         00007f2bf21f02f8  00007f2bf21f0320  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f02f0  00007f2bf21f0360  [anon:dalvik-Jit thread pool worker thread 0]
+         00007f2bf21f02f8  00007f2bf21f0320  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2bf21f0300  00007f2bf6802e40  [anon:libc_malloc]
          00007f2bf21f0308  00000001f21f0331
          00007f2bf21f0310  0000000000000001
@@ -16626,12 +16626,12 @@
          00007f2bf21f03b8  00007f2bfa4552c0
          00007f2bf21f03c0  0000000000000002
          00007f2bf21f03c8  00007f2bee706c00  [anon:libc_malloc]
-         00007f2bf21f03d0  00007f2bf21f0440  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f03d0  00007f2bf21f0440  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2bf21f03d8  00007f2bf660e542  /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+66)
     #03  00007f2bf21f03e0  0000000000002000
          00007f2bf21f03e8  0000000000000000
-         00007f2bf21f03f0  00007f2bf21f0440  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
-         00007f2bf21f03f8  00007f2bf21f04c0  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f03f0  00007f2bf21f0440  [anon:dalvik-Jit thread pool worker thread 0]
+         00007f2bf21f03f8  00007f2bf21f04c0  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2bf21f0400  00007f2bfa4552c0
          00007f2bf21f0408  00007f2bf9fa7eff  /system/lib64/libc.so (__pthread_start(void*)+47)
     #04  00007f2bf21f0410  0000000000000000
@@ -16644,7 +16644,7 @@
          00007f2bf21f0448  00007f2be7306440  [stack:2257]
          00007f2bf21f0450  000008cb000008d0
          00007f2bf21f0458  0000000000000000
-         00007f2bf21f0460  00007f2bf20f1000  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+         00007f2bf21f0460  00007f2bf20f1000  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2bf21f0468  00000000000ff440
          00007f2bf21f0470  0000000000001000
          00007f2bf21f0478  0000000000000000
@@ -16738,7 +16738,7 @@
          00007f2be7306428  00007f2bf9f4c6ec  /system/lib64/libc.so (__start_thread+12)
     #05  00007f2be7306430  00007f2bf9fa7ed0  /system/lib64/libc.so (__pthread_start(void*))
          00007f2be7306438  00007f2bf9f3fe56  /system/lib64/libc.so (__bionic_clone+54)
-    #06  00007f2be7306440  00007f2bf21f0440  /dev/ashmem/dalvik-Jit thread pool worker thread 0 (deleted)
+    #06  00007f2be7306440  00007f2bf21f0440  [anon:dalvik-Jit thread pool worker thread 0]
          00007f2be7306448  00007f2be7207440  [stack:2258]
          00007f2be7306450  000008cb000008d1
          00007f2be7306458  00007f2b00000000
@@ -16812,7 +16812,7 @@
          00007f2be7207150  0000004300000043
          00007f2be7207158  00007f2bf86ba000  /system/lib64/libnetd_client.so
          00007f2be7207160  00007f2bf680d140  [anon:libc_malloc]
-         00007f2be7207168  0000000012c890a0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be7207168  0000000012c890a0  [anon:dalvik-main space]
          00007f2be7207170  00007f2bf6a59520  [anon:libc_malloc]
          00007f2be7207178  00007f2bf67fcdc0  /system/lib64/libart.so
          00007f2be7207180  00007f2bf006c800  [anon:libc_malloc]
@@ -16917,8 +16917,8 @@
     #02  00007f2be7107f20  00000001e7108270
          00007f2be7107f28  00007f2be7107f01  [stack:2259]
          00007f2be7107f30  0000000000000000
-         00007f2be7107f38  0000000012e63100  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be7107f40  0000000012e63160  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be7107f38  0000000012e63100  [anon:dalvik-main space]
+         00007f2be7107f40  0000000012e63160  [anon:dalvik-main space]
          00007f2be7107f48  00007f2bfa024a00
          00007f2be7107f50  0000000071297300  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be7107f58  0000000800000000
@@ -16928,7 +16928,7 @@
          00007f2be7107f78  00007f2bf200b7e0  [anon:libc_malloc]
          00007f2be7107f80  00007f2bf0042a00  [anon:libc_malloc]
          00007f2be7107f88  0000000070f09810  /data/dalvik-cache/x86_64/system@framework@boot.art
-         00007f2be7107f90  0000000012e63160  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be7107f90  0000000012e63160  [anon:dalvik-main space]
          00007f2be7107f98  00007f2bf0042a00  [anon:libc_malloc]
          ........  ........
     #03  00007f2be7107fd0  00007f2be7108270  [stack:2259]
@@ -16940,11 +16940,11 @@
          00007f2be7108000  0000000071188fe0  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be7108008  0000000071188fe0  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be7108010  0000000070f09810  /data/dalvik-cache/x86_64/system@framework@boot.art
-         00007f2be7108018  0000000012e63160  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be7108018  0000000012e63160  [anon:dalvik-main space]
          00007f2be7108020  00007f2bfa024a00
          00007f2be7108028  000000007346754a  /data/dalvik-cache/x86_64/system@framework@boot.oat
     #04  00007f2be7108030  0000000070f09810  /data/dalvik-cache/x86_64/system@framework@boot.art
-         00007f2be7108038  0000000012e63160  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be7108038  0000000012e63160  [anon:dalvik-main space]
          00007f2be7108040  00000000714b93a8  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be7108048  0000000000000000
          00007f2be7108050  71188fe000000001
@@ -16957,7 +16957,7 @@
          00007f2be7108088  0000000071188fe0  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be7108090  0000000071188fe0  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be7108098  0000000070f09810  /data/dalvik-cache/x86_64/system@framework@boot.art
-         00007f2be71080a0  0000000012e63160  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be71080a0  0000000012e63160  [anon:dalvik-main space]
          00007f2be71080a8  00007f2bfa024a00
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2260, name: FinalizerDaemon  >>> com.android.browser <<<
@@ -17027,7 +17027,7 @@
          00007f2be7002e90  0000000000000006
          00007f2be7002e98  00007f2bf0043e00  [anon:libc_malloc]
          ........  ........
-    #03  00007f2be7002ed0  0000000012e63100  /dev/ashmem/dalvik-main space (deleted)
+    #03  00007f2be7002ed0  0000000012e63100  [anon:dalvik-main space]
          00007f2be7002ed8  fa0b7e1782291062
          00007f2be7002ee0  00007f2be7003270  [stack:2260]
          00007f2be7002ee8  00007f2bf0043e00  [anon:libc_malloc]
@@ -17196,7 +17196,7 @@
          00007f2be6df8e70  00007f2b0000004b
          00007f2be6df8e78  00007f2bf6884800  [anon:libc_malloc]
          00007f2be6df8e80  00007f2be6df8ed0  [stack:2262]
-         00007f2be6df8e88  00000000138851e9  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6df8e88  00000000138851e9  [anon:dalvik-main space]
          00007f2be6df8e90  00007f2bf6a75000  [anon:libc_malloc]
          00007f2be6df8e98  00007f2bf9fc6008  /system/lib64/libc.so (je_arena_dalloc_bin_junked_locked+632)
          00007f2be6df8ea0  00000002002005de
@@ -17270,7 +17270,7 @@
          00007f2be6bf61c0  0000000000000000
          00007f2be6bf61c8  0000000000000000
          00007f2be6bf61d0  0000000000000000
-         00007f2be6bf61d8  00007f2bf6010001  /dev/ashmem/dalvik-allocspace zygote / non moving space live-bitmap 0 (deleted)
+         00007f2be6bf61d8  00007f2bf6010001  [anon:dalvik-allocspace zygote / non moving space live-bitmap 0]
          00007f2be6bf61e0  00007f2bfa375580  /system/lib64/libbinder.so (android::IPCThreadState::freeBuffer(android::Parcel*, unsigned char const*, unsigned long, unsigned long long const*, unsigned long, void*))
          00007f2be6bf61e8  00007f2bf0048a80  [anon:libc_malloc]
          00007f2be6bf61f0  0000000000000000
@@ -17390,7 +17390,7 @@
          00007f2be6af71c0  0000000000000000
          00007f2be6af71c8  0000000000000000
          00007f2be6af71d0  0000000000000000
-         00007f2be6af71d8  00007f2bf6010001  /dev/ashmem/dalvik-allocspace zygote / non moving space live-bitmap 0 (deleted)
+         00007f2be6af71d8  00007f2bf6010001  [anon:dalvik-allocspace zygote / non moving space live-bitmap 0]
          00007f2be6af71e0  00007f2bfa375580  /system/lib64/libbinder.so (android::IPCThreadState::freeBuffer(android::Parcel*, unsigned char const*, unsigned long, unsigned long long const*, unsigned long, void*))
          00007f2be6af71e8  00007f2bf0049380  [anon:libc_malloc]
          00007f2be6af71f0  0000000000000000
@@ -17512,7 +17512,7 @@
          00007f2be6586d28  00000000714b9338  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be6586d30  00000000714b9300  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be6586d38  00007f2be6586dd0  [stack:2267]
-         00007f2be6586d40  00007f2bf3b0dfc0  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         00007f2be6586d40  00007f2bf3b0dfc0  [anon:dalvik-LinearAlloc]
          00007f2be6586d48  00007f2bf6706b67  /system/lib64/libart.so (artQuickResolutionTrampoline+1479)
          00007f2be6586d50  00007f2be6586f10  [stack:2267]
          00007f2be6586d58  00007f2bf2024000  [anon:libc_malloc]
@@ -17523,7 +17523,7 @@
          00007f2be6586d80  00007f2be6586e00  [stack:2267]
          00007f2be6586d88  00007f2bfa3c1909  /system/lib64/libutils.so (android::Looper::pollInner(int)+153)
     #02  00007f2be6586d90  0000000200000000
-         00007f2be6586d98  0000000012e23730  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6586d98  0000000012e23730  [anon:dalvik-main space]
          00007f2be6586da0  0000000000000000
          00007f2be6586da8  0000000212e23730
          00007f2be6586db0  0000000000000001
@@ -17541,11 +17541,11 @@
          ........  ........
     #03  00007f2be6586f00  00007f2bf6818880  [anon:libc_malloc]
          00007f2be6586f08  00007f2bedfc9740  [anon:libc_malloc]
-         00007f2be6586f10  0000000012d37040  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6586f18  0000000012d37040  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6586f10  0000000012d37040  [anon:dalvik-main space]
+         00007f2be6586f18  0000000012d37040  [anon:dalvik-main space]
          00007f2be6586f20  0000000000000000
          00007f2be6586f28  00007f2bfa269856  /system/lib64/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int)+38)
-    #04  00007f2be6586f30  0000000012d37040  /dev/ashmem/dalvik-main space (deleted)
+    #04  00007f2be6586f30  0000000012d37040  [anon:dalvik-main space]
          00007f2be6586f38  0000000000000001
          00007f2be6586f40  0000000000000000
          00007f2be6586f48  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
@@ -17564,7 +17564,7 @@
          00007f2be6586fb0  0000000000000000
          00007f2be6586fb8  0000000000000001
          00007f2be6586fc0  0000000000000000
-         00007f2be6586fc8  0000000012d37040  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6586fc8  0000000012d37040  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2268, name: pool-1-thread-1  >>> com.android.browser <<<
     rax fffffffffffffdfc  rbx 00007f2bf6818798  rcx ffffffffffffffff  rdx 0000000000000003
@@ -17586,7 +17586,7 @@
          00007f2be64819f0  00007f2be6481a20  [stack:2268]
          00007f2be64819f8  00007f2bf68be200  [anon:libc_malloc]
          00007f2be6481a00  00007f2be6481ac0  [stack:2268]
-         00007f2be6481a08  0000000012c22b70  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6481a08  0000000012c22b70  [anon:dalvik-main space]
          00007f2be6481a10  0001f02800000060
          00007f2be6481a18  000000000000f000
          00007f2be6481a20  00007f2be669a348  /system/app/Browser/oat/x86_64/Browser.odex
@@ -17619,7 +17619,7 @@
     #02  00007f2be6481b80  0000000100000001
          00007f2be6481b88  00007f2be6481b01  [stack:2268]
          00007f2be6481b90  00007f2be6481bac  [stack:2268]
-         00007f2be6481b98  0000000012c05360  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6481b98  0000000012c05360  [anon:dalvik-main space]
          00007f2be6481ba0  0000000000000000
          00007f2be6481ba8  710e5a9000000001
          00007f2be6481bb0  00000000714d8860  /data/dalvik-cache/x86_64/system@framework@boot.art
@@ -17629,7 +17629,7 @@
          00007f2be6481bd0  00007f2b00000001
          00007f2be6481bd8  00007f2bf2024a00  [anon:libc_malloc]
          00007f2be6481be0  0000004300000043
-         00007f2be6481be8  0000000012c04c00  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6481be8  0000000012c04c00  [anon:dalvik-main space]
          00007f2be6481bf0  00007f2bf67f4010  /system/lib64/libart.so
          00007f2be6481bf8  00007f2bf2024a00  [anon:libc_malloc]
          ........  ........
@@ -17639,16 +17639,16 @@
          00007f2be6481c48  00007f2bf2024a00  [anon:libc_malloc]
          00007f2be6481c50  000000000000ea60
          00007f2be6481c58  0000000000000000
-         00007f2be6481c60  0000000012d2f1c0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6481c68  0000000012c05d00  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6481c70  0000000012c05d00  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6481c60  0000000012d2f1c0  [anon:dalvik-main space]
+         00007f2be6481c68  0000000012c05d00  [anon:dalvik-main space]
+         00007f2be6481c70  0000000012c05d00  [anon:dalvik-main space]
          00007f2be6481c78  0000000000000000
          00007f2be6481c80  0000000000000000
          00007f2be6481c88  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
-    #04  00007f2be6481c90  0000000012d2f1c0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6481c98  0000000012d2f1c0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6481ca0  0000000012c05d00  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6481ca8  0000000012c05cb0  /dev/ashmem/dalvik-main space (deleted)
+    #04  00007f2be6481c90  0000000012d2f1c0  [anon:dalvik-main space]
+         00007f2be6481c98  0000000012d2f1c0  [anon:dalvik-main space]
+         00007f2be6481ca0  0000000012c05d00  [anon:dalvik-main space]
+         00007f2be6481ca8  0000000012c05cb0  [anon:dalvik-main space]
          00007f2be6481cb0  00000000714b9418  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be6481cb8  0000000000000000
          00007f2be6481cc0  12c05d0000000001
@@ -17658,9 +17658,9 @@
          00007f2be6481ce0  0000000000000000
          00007f2be6481ce8  0000000000000000
          00007f2be6481cf0  0000000000000000
-         00007f2be6481cf8  0000000012d2f1c0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6481d00  0000000012c05d00  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6481d08  0000000012c05d00  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6481cf8  0000000012d2f1c0  [anon:dalvik-main space]
+         00007f2be6481d00  0000000012c05d00  [anon:dalvik-main space]
+         00007f2be6481d08  0000000012c05d00  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2269, name: pool-2-thread-1  >>> com.android.browser <<<
     rax fffffffffffffe00  rbx 00007f2bf6818498  rcx ffffffffffffffff  rdx 0000000000000003
@@ -17735,16 +17735,16 @@
          00007f2be668bd08  00007f2bee846600  [anon:libc_malloc]
          00007f2be668bd10  0000000000000000
          00007f2be668bd18  0000000000000000
-         00007f2be668bd20  0000000012d3c100  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be668bd28  0000000012d321d0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be668bd30  0000000012d321d0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be668bd20  0000000012d3c100  [anon:dalvik-main space]
+         00007f2be668bd28  0000000012d321d0  [anon:dalvik-main space]
+         00007f2be668bd30  0000000012d321d0  [anon:dalvik-main space]
          00007f2be668bd38  0000000000000000
          00007f2be668bd40  0000000000000000
          00007f2be668bd48  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
-    #04  00007f2be668bd50  0000000012d3c100  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be668bd58  0000000012d3c100  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be668bd60  0000000012d321d0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be668bd68  0000000012ca0080  /dev/ashmem/dalvik-main space (deleted)
+    #04  00007f2be668bd50  0000000012d3c100  [anon:dalvik-main space]
+         00007f2be668bd58  0000000012d3c100  [anon:dalvik-main space]
+         00007f2be668bd60  0000000012d321d0  [anon:dalvik-main space]
+         00007f2be668bd68  0000000012ca0080  [anon:dalvik-main space]
          00007f2be668bd70  00000000714b9418  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be668bd78  0000000000000000
          00007f2be668bd80  12d321d000000001
@@ -17754,9 +17754,9 @@
          00007f2be668bda0  0000000040200000
          00007f2be668bda8  0000000000000000
          00007f2be668bdb0  0000000000000000
-         00007f2be668bdb8  0000000012d3c100  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be668bdc0  0000000012d321d0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be668bdc8  0000000012d321d0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be668bdb8  0000000012d3c100  [anon:dalvik-main space]
+         00007f2be668bdc0  0000000012d321d0  [anon:dalvik-main space]
+         00007f2be668bdc8  0000000012d321d0  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2270, name: AsyncTask #1  >>> com.android.browser <<<
     rax fffffffffffffe00  rbx 00007f2bedffed18  rcx ffffffffffffffff  rdx 0000000000000000
@@ -17785,7 +17785,7 @@
          00007f2be6039b08  00007f2be6039b60  [stack:2270]
          00007f2be6039b10  00007f2be6039b40  [stack:2270]
          00007f2be6039b18  00007f2bf65f6290  /system/lib64/libart.so (art::Thread::DecodeJObject(_jobject*) const+240)
-         00007f2be6039b20  00007f2bf3b0a7d0  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         00007f2be6039b20  00007f2bf3b0a7d0  [anon:dalvik-LinearAlloc]
          00007f2be6039b28  00000001f6701332
          00007f2be6039b30  0000000000000001
          00007f2be6039b38  00007f2bf6702943  /system/lib64/libart.so (art::QuickArgumentVisitor::VisitArguments() (.constprop.254)+275)
@@ -17831,16 +17831,16 @@
          00007f2be6039d08  00007f2bf2099600  [anon:libc_malloc]
          00007f2be6039d10  0000000000000000
          00007f2be6039d18  0000000000000000
-         00007f2be6039d20  0000000012de2b80  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6039d28  0000000012da1ff0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6039d30  0000000012da1ff0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6039d20  0000000012de2b80  [anon:dalvik-main space]
+         00007f2be6039d28  0000000012da1ff0  [anon:dalvik-main space]
+         00007f2be6039d30  0000000012da1ff0  [anon:dalvik-main space]
          00007f2be6039d38  0000000000000000
          00007f2be6039d40  0000000000000000
          00007f2be6039d48  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
     #04  00007f2be6039d50  00000000712e14a0  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be6039d58  00007f2bf623657d  /system/lib64/libart.so (art_quick_resolution_trampoline+141)
-         00007f2be6039d60  00007f2bf3b0a958  /dev/ashmem/dalvik-LinearAlloc (deleted)
-         00007f2be6039d68  0000000012e29040  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6039d60  00007f2bf3b0a958  [anon:dalvik-LinearAlloc]
+         00007f2be6039d68  0000000012e29040  [anon:dalvik-main space]
          00007f2be6039d70  00000000714b9418  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be6039d78  0000000000000000
          00007f2be6039d80  12da1ff000000001
@@ -17850,9 +17850,9 @@
          00007f2be6039da0  0000000000000000
          00007f2be6039da8  0000000000000000
          00007f2be6039db0  0000000000000000
-         00007f2be6039db8  0000000012de2b80  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6039dc0  0000000012da1ff0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be6039dc8  0000000012da1ff0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be6039db8  0000000012de2b80  [anon:dalvik-main space]
+         00007f2be6039dc0  0000000012da1ff0  [anon:dalvik-main space]
+         00007f2be6039dc8  0000000012da1ff0  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2272, name: DnsConfigServic  >>> com.android.browser <<<
     rax fffffffffffffffc  rbx 00007f2be5848230  rcx ffffffffffffffff  rdx 0000000000000020
@@ -18003,7 +18003,7 @@
          00007f2be5644160  0000000000000258
          00007f2be5644168  0000000000000000
          00007f2be5644170  00007f2bf68338e0  [anon:libc_malloc]
-         00007f2be5644178  00000000138851e9  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be5644178  00000000138851e9  [anon:dalvik-main space]
          00007f2be5644180  00007f2bf681bfa8  [anon:libc_malloc]
          00007f2be5644188  00007f2be3cd3230  [anon:libc_malloc]
          00007f2be5644190  00007f2be5644200  [stack:2274]
@@ -18011,9 +18011,9 @@
          00007f2be56441a0  00007f2bea7a2a40
          00007f2be56441a8  00007f2be81e3522  /system/app/webview/webview.apk
     #02  00007f2be56441b0  00000000000002da
-         00007f2be56441b8  00000000138851e9  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be56441b8  00000000138851e9  [anon:dalvik-main space]
          00007f2be56441c0  0000000000000082
-         00007f2be56441c8  00000000138851e9  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be56441c8  00000000138851e9  [anon:dalvik-main space]
          00007f2be56441d0  0000000000000000
          00007f2be56441d8  00007f2bf681bf40  [anon:libc_malloc]
          00007f2be56441e0  00007f2be5644310  [stack:2274]
@@ -18896,10 +18896,10 @@
          00007f2be437fef8  00007f2bedf42a00  [anon:libc_malloc]
          00007f2be437ff00  0000000000000000
          00007f2be437ff08  0000000000000000
-         00007f2be437ff10  0000000012c87890  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be437ff10  0000000012c87890  [anon:dalvik-main space]
          00007f2be437ff18  0000000000000000
          00007f2be437ff20  0000000000000000
-         00007f2be437ff28  00007f2be47f32c8  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         00007f2be437ff28  00007f2be47f32c8  [anon:dalvik-LinearAlloc]
          00007f2be437ff30  0000000000000000
          00007f2be437ff38  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
     #04  00007f2be437ff40  00007f2be448f000  [anon:libc_malloc]
@@ -18915,7 +18915,7 @@
          00007f2be437ff90  0000000000000000
          00007f2be437ff98  0000000000000000
          00007f2be437ffa0  0000000000000000
-         00007f2be437ffa8  0000000012c87890  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be437ffa8  0000000012c87890  [anon:dalvik-main space]
          00007f2be437ffb0  0000000000000000
          00007f2be437ffb8  0000000000000000
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@@ -18982,8 +18982,8 @@
          00007f2be41fedc0  0000000000000001
          00007f2be41fedc8  0000000082291062
          00007f2be41fedd0  000000007138ace8  /data/dalvik-cache/x86_64/system@framework@boot.art
-         00007f2be41fedd8  0000000012c77000  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41fede0  0000000012c9e0c0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be41fedd8  0000000012c77000  [anon:dalvik-main space]
+         00007f2be41fede0  0000000012c9e0c0  [anon:dalvik-main space]
          00007f2be41fede8  00007f2be4608400  [anon:libc_malloc]
          ........  ........
     #03  00007f2be41fee20  0000000000000019
@@ -18992,16 +18992,16 @@
          00007f2be41fee38  00007f2be4608400  [anon:libc_malloc]
          00007f2be41fee40  0000000000000000
          00007f2be41fee48  0000000000000000
-         00007f2be41fee50  0000000012c9bc40  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41fee58  0000000012c87bf0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41fee60  0000000012c87bf0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be41fee50  0000000012c9bc40  [anon:dalvik-main space]
+         00007f2be41fee58  0000000012c87bf0  [anon:dalvik-main space]
+         00007f2be41fee60  0000000012c87bf0  [anon:dalvik-main space]
          00007f2be41fee68  0000000000000000
          00007f2be41fee70  0000000000000000
          00007f2be41fee78  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
-    #04  00007f2be41fee80  0000000012c9bc40  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41fee88  0000000012c9bc40  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41fee90  0000000012c87bf0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41fee98  0000000012c77f60  /dev/ashmem/dalvik-main space (deleted)
+    #04  00007f2be41fee80  0000000012c9bc40  [anon:dalvik-main space]
+         00007f2be41fee88  0000000012c9bc40  [anon:dalvik-main space]
+         00007f2be41fee90  0000000012c87bf0  [anon:dalvik-main space]
+         00007f2be41fee98  0000000012c77f60  [anon:dalvik-main space]
          00007f2be41feea0  00000000714b9418  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be41feea8  0000000000000000
          00007f2be41feeb0  12c87bf000000001
@@ -19011,9 +19011,9 @@
          00007f2be41feed0  0000000000000000
          00007f2be41feed8  0000000000000000
          00007f2be41feee0  0000000000000000
-         00007f2be41feee8  0000000012c9bc40  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41feef0  0000000012c87bf0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be41feef8  0000000012c87bf0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be41feee8  0000000012c9bc40  [anon:dalvik-main space]
+         00007f2be41feef0  0000000012c87bf0  [anon:dalvik-main space]
+         00007f2be41feef8  0000000012c87bf0  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2291, name: Thread-149  >>> com.android.browser <<<
     rax fffffffffffffe00  rbx 00007f2be3fbe5c0  rcx ffffffffffffffff  rdx 0000000000000002
@@ -19212,7 +19212,7 @@
          00007f2be3b9fb20  0000000000000000
          00007f2be3b9fb28  00007f2be66a5600  /system/app/Browser/oat/x86_64/Browser.odex
          00007f2be3b9fb30  00007f2be3b9fb50  [stack:2294]
-         00007f2be3b9fb38  00007f2be42602d0  /dev/ashmem/dalvik-LinearAlloc (deleted)
+         00007f2be3b9fb38  00007f2be42602d0  [anon:dalvik-LinearAlloc]
          00007f2be3b9fb40  00007f2be6727b98  /system/app/Browser/oat/x86_64/Browser.odex
     #00  00007f2be3b9fb48  00007f2bf624d1ce  /system/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+622)
     #01  00007f2be3b9fb50  0000000000000000
@@ -19243,40 +19243,40 @@
          00007f2be3b9fc80  0000000000000000
          00007f2be3b9fc88  00430000f6506bda
          00007f2be3b9fc90  0000000200000001
-         00007f2be3b9fc98  0000000012e29140  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be3b9fc98  0000000012e29140  [anon:dalvik-main space]
          00007f2be3b9fca0  0000000000000000
          00007f2be3b9fca8  00000000747121ec  /data/dalvik-cache/x86_64/system@framework@boot.oat
          00007f2be3b9fcb0  000000007138aff8  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be3b9fcb8  00007f2be4608e00  [anon:libc_malloc]
          ........  ........
-    #03  00007f2be3b9fcf0  0000000012e29140  /dev/ashmem/dalvik-main space (deleted)
+    #03  00007f2be3b9fcf0  0000000012e29140  [anon:dalvik-main space]
          00007f2be3b9fcf8  0000004400000001
-         00007f2be3b9fd00  0000000012ccd370  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be3b9fd00  0000000012ccd370  [anon:dalvik-main space]
          00007f2be3b9fd08  00007f2be4608e00  [anon:libc_malloc]
          00007f2be3b9fd10  0000000000000000
          00007f2be3b9fd18  0000000000000000
-         00007f2be3b9fd20  0000000012c9b520  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be3b9fd28  0000000012c9c240  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be3b9fd30  0000000012c9c240  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be3b9fd20  0000000012c9b520  [anon:dalvik-main space]
+         00007f2be3b9fd28  0000000012c9c240  [anon:dalvik-main space]
+         00007f2be3b9fd30  0000000012c9c240  [anon:dalvik-main space]
          00007f2be3b9fd38  0000000000000000
          00007f2be3b9fd40  0000000000000000
          00007f2be3b9fd48  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
-    #04  00007f2be3b9fd50  0000000012e29140  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be3b9fd58  0000000012e26500  /dev/ashmem/dalvik-main space (deleted)
+    #04  00007f2be3b9fd50  0000000012e29140  [anon:dalvik-main space]
+         00007f2be3b9fd58  0000000012e26500  [anon:dalvik-main space]
          00007f2be3b9fd60  0000000071389430  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be3b9fd68  0000000073f39abc  /data/dalvik-cache/x86_64/system@framework@boot.oat
          00007f2be3b9fd70  00000000714b9418  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be3b9fd78  0000000000000000
          00007f2be3b9fd80  12c9c24000000001
          00007f2be3b9fd88  00007f2b00000000
-         00007f2be3b9fd90  0000000012ca8a30  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be3b9fd90  0000000012ca8a30  [anon:dalvik-main space]
          00007f2be3b9fd98  0000000000000000
          00007f2be3b9fda0  0000000000000000
          00007f2be3b9fda8  0000000000000000
          00007f2be3b9fdb0  0000000000000000
-         00007f2be3b9fdb8  0000000012c9b520  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be3b9fdc0  0000000012c9c240  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be3b9fdc8  0000000012c9c240  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be3b9fdb8  0000000012c9b520  [anon:dalvik-main space]
+         00007f2be3b9fdc0  0000000012c9c240  [anon:dalvik-main space]
+         00007f2be3b9fdc8  0000000012c9c240  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2296, name: JavaBridge  >>> com.android.browser <<<
     rax fffffffffffffffc  rbx 00007f2bf68904a0  rcx ffffffffffffffff  rdx 0000000000000010
@@ -19335,18 +19335,18 @@
          ........  ........
     #03  00007f2be221ef00  00007f2bedffe580  [anon:libc_malloc]
          00007f2be221ef08  00007f2be3d18680  [anon:libc_malloc]
-         00007f2be221ef10  0000000012c830d0  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be221ef18  0000000012c830d0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be221ef10  0000000012c830d0  [anon:dalvik-main space]
+         00007f2be221ef18  0000000012c830d0  [anon:dalvik-main space]
          00007f2be221ef20  0000000000000000
          00007f2be221ef28  00007f2bfa269856  /system/lib64/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int)+38)
-    #04  00007f2be221ef30  0000000012c830d0  /dev/ashmem/dalvik-main space (deleted)
+    #04  00007f2be221ef30  0000000012c830d0  [anon:dalvik-main space]
          00007f2be221ef38  0000000000000001
          00007f2be221ef40  0000000000000000
          00007f2be221ef48  0000000073467828  /data/dalvik-cache/x86_64/system@framework@boot.oat
     #05  00007f2be221ef50  0000000000000000
-         00007f2be221ef58  0000000012c02070  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be221ef60  0000000012c01160  /dev/ashmem/dalvik-main space (deleted)
-         00007f2be221ef68  0000000012c01100  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be221ef58  0000000012c02070  [anon:dalvik-main space]
+         00007f2be221ef60  0000000012c01160  [anon:dalvik-main space]
+         00007f2be221ef68  0000000012c01100  [anon:dalvik-main space]
          00007f2be221ef70  000000007150ba48  /data/dalvik-cache/x86_64/system@framework@boot.art
          00007f2be221ef78  0000000000000000
          00007f2be221ef80  12c830d000000001
@@ -19358,7 +19358,7 @@
          00007f2be221efb0  0000000000000000
          00007f2be221efb8  0000000000000001
          00007f2be221efc0  0000000000000000
-         00007f2be221efc8  0000000012c830d0  /dev/ashmem/dalvik-main space (deleted)
+         00007f2be221efc8  0000000012c830d0  [anon:dalvik-main space]
 --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 pid: 2251, tid: 2297, name: SimpleCacheWork  >>> com.android.browser <<<
     rax fffffffffffffe00  rbx 00007f2be3cfcab0  rcx ffffffffffffffff  rdx 0000000000000016
diff --git a/scripts/disassemble_tombstone.py b/scripts/disassemble_tombstone.py
index cadc34d..0120890 100755
--- a/scripts/disassemble_tombstone.py
+++ b/scripts/disassemble_tombstone.py
@@ -55,7 +55,7 @@
   #
   # It's easiest to nest register processing in the codeblock search loop.
   register_list_re = re.compile('^pid: ')
-  codeblock_re = re.compile('^code around ([a-z0-9]+)')
+  codeblock_re = re.compile('^code around ([a-z0-9]+)|memory near (pc)')
   register_text = {}
   for line in line_generator:
     yield line
@@ -65,8 +65,9 @@
         yield output
     code_match = codeblock_re.search(line)
     if code_match:
+      code_reg = ''.join(code_match.groups(''))
       for output in ProcessCodeBlock(
-          abi, tools, code_match.group(1), register_text, line_generator):
+          abi, tools, code_reg, register_text, line_generator):
         yield output
 
 
@@ -138,6 +139,12 @@
   subprocess.check_call(tools.Assemble([
       '-o', object_file.name, scratch_file.name]))
   scratch_file.close()
+
+  # Work around ARM data tagging: rename $d to $t.
+  if abi.startswith('arm'):
+    subprocess.check_call(
+        ['sed', '-i', '-e', "s/\\x00\\x24\\x64\\x00/\\x00\\x24\\x71\\x00/", object_file.name])
+
   linked_file = tempfile.NamedTemporaryFile(suffix='.o')
   cmd = tools.Link([
       '-Ttext', '0x' + start_address, '-o', linked_file.name, object_file.name])
diff --git a/scripts/gdbclient.py b/scripts/gdbclient.py
index 982ddc8..611b2e8 100755
--- a/scripts/gdbclient.py
+++ b/scripts/gdbclient.py
@@ -17,11 +17,13 @@
 
 import adb
 import argparse
+import json
 import logging
 import os
 import re
 import subprocess
 import sys
+import textwrap
 
 # Shared functions across gdbclient.py and ndk-gdb.py.
 import gdbrunner
@@ -64,6 +66,11 @@
     parser.add_argument(
         "--user", nargs="?", default="root",
         help="user to run commands as on the device [default: root]")
+    parser.add_argument(
+        "--setup-forwarding", default=None, choices=["gdb", "vscode"],
+        help=("Setup the gdbserver and port forwarding. Prints commands or " +
+              ".vscode/launch.json configuration needed to connect the debugging " +
+              "client to the server."))
 
     return parser.parse_args()
 
@@ -153,33 +160,60 @@
 
     return (binary_file, pid, run_cmd)
 
+def generate_vscode_script(gdbpath, root, sysroot, binary_name, port, dalvik_gdb_script, solib_search_path):
+    # TODO It would be nice if we didn't need to copy this or run the
+    #      gdbclient.py program manually. Doing this would probably require
+    #      writing a vscode extension or modifying an existing one.
+    res = {
+        "name": "(gdbclient.py) Attach {} (port: {})".format(binary_name.split("/")[-1], port),
+        "type": "cppdbg",
+        "request": "launch",  # Needed for gdbserver.
+        "cwd": root,
+        "program": binary_name,
+        "MIMode": "gdb",
+        "miDebuggerServerAddress": "localhost:{}".format(port),
+        "miDebuggerPath": gdbpath,
+        "setupCommands": [
+            {
+                # Required for vscode.
+                "description": "Enable pretty-printing for gdb",
+                "text": "-enable-pretty-printing",
+                "ignoreFailures": True,
+            },
+            {
+                "description": "gdb command: dir",
+                "text": "-environment-directory {}".format(root),
+                "ignoreFailures": False
+            },
+            {
+                "description": "gdb command: set solib-search-path",
+                "text": "-gdb-set solib-search-path {}".format(":".join(solib_search_path)),
+                "ignoreFailures": False
+            },
+            {
+                "description": "gdb command: set solib-absolute-prefix",
+                "text": "-gdb-set solib-absolute-prefix {}".format(sysroot),
+                "ignoreFailures": False
+            },
+        ]
+    }
+    if dalvik_gdb_script:
+        res["setupCommands"].append({
+            "description": "gdb command: source art commands",
+            "text": "-interpreter-exec console \"source {}\"".format(dalvik_gdb_script),
+            "ignoreFailures": False,
+        })
+    return json.dumps(res, indent=4)
 
-def generate_gdb_script(sysroot, binary_file, is64bit, port, connect_timeout=5):
-    # Generate a gdb script.
-    # TODO: Detect the zygote and run 'art-on' automatically.
-    root = os.environ["ANDROID_BUILD_TOP"]
-    symbols_dir = os.path.join(sysroot, "system", "lib64" if is64bit else "lib")
-    vendor_dir = os.path.join(sysroot, "vendor", "lib64" if is64bit else "lib")
-
-    solib_search_path = []
-    symbols_paths = ["", "hw", "ssl/engines", "drm", "egl", "soundfx"]
-    vendor_paths = ["", "hw", "egl"]
-    solib_search_path += [os.path.join(symbols_dir, x) for x in symbols_paths]
-    solib_search_path += [os.path.join(vendor_dir, x) for x in vendor_paths]
+def generate_gdb_script(root, sysroot, binary_name, port, dalvik_gdb_script, solib_search_path, connect_timeout):
     solib_search_path = ":".join(solib_search_path)
 
     gdb_commands = ""
-    gdb_commands += "file '{}'\n".format(binary_file.name)
+    gdb_commands += "file '{}'\n".format(binary_name)
     gdb_commands += "directory '{}'\n".format(root)
     gdb_commands += "set solib-absolute-prefix {}\n".format(sysroot)
     gdb_commands += "set solib-search-path {}\n".format(solib_search_path)
-
-    dalvik_gdb_script = os.path.join(root, "development", "scripts", "gdb",
-                                     "dalvik.gdb")
-    if not os.path.exists(dalvik_gdb_script):
-        logging.warning(("couldn't find {} - ART debugging options will not " +
-                         "be available").format(dalvik_gdb_script))
-    else:
+    if dalvik_gdb_script:
         gdb_commands += "source {}\n".format(dalvik_gdb_script)
 
     # Try to connect for a few seconds, sometimes the device gdbserver takes
@@ -192,7 +226,7 @@
   end_time = time.time() + timeout_seconds
   while True:
     try:
-      gdb.execute("target remote " + target)
+      gdb.execute("target extended-remote " + target)
       return True
     except gdb.error as e:
       time_left = end_time - time.time()
@@ -209,6 +243,33 @@
 
     return gdb_commands
 
+def generate_setup_script(gdbpath, sysroot, binary_file, is64bit, port, debugger, connect_timeout=5):
+    # Generate a setup script.
+    # TODO: Detect the zygote and run 'art-on' automatically.
+    root = os.environ["ANDROID_BUILD_TOP"]
+    symbols_dir = os.path.join(sysroot, "system", "lib64" if is64bit else "lib")
+    vendor_dir = os.path.join(sysroot, "vendor", "lib64" if is64bit else "lib")
+
+    solib_search_path = []
+    symbols_paths = ["", "hw", "ssl/engines", "drm", "egl", "soundfx"]
+    vendor_paths = ["", "hw", "egl"]
+    solib_search_path += [os.path.join(symbols_dir, x) for x in symbols_paths]
+    solib_search_path += [os.path.join(vendor_dir, x) for x in vendor_paths]
+
+    dalvik_gdb_script = os.path.join(root, "development", "scripts", "gdb", "dalvik.gdb")
+    if not os.path.exists(dalvik_gdb_script):
+        logging.warning(("couldn't find {} - ART debugging options will not " +
+                         "be available").format(dalvik_gdb_script))
+        dalvik_gdb_script = None
+
+    if debugger == "vscode":
+        return generate_vscode_script(
+            gdbpath, root, sysroot, binary_file.name, port, dalvik_gdb_script, solib_search_path)
+    elif debugger == "gdb":
+        return generate_gdb_script(root, sysroot, binary_file.name, port, dalvik_gdb_script, solib_search_path, connect_timeout)
+    else:
+        raise Exception("Unknown debugger type " + debugger)
+
 
 def main():
     required_env = ["ANDROID_BUILD_TOP",
@@ -258,12 +319,6 @@
             gdbrunner.forward_gdbserver_port(device, local=args.port,
                                              remote="tcp:{}".format(args.port))
 
-        # Generate a gdb script.
-        gdb_commands = generate_gdb_script(sysroot=sysroot,
-                                           binary_file=binary_file,
-                                           is64bit=is64bit,
-                                           port=args.port)
-
         # Find where gdb is
         if sys.platform.startswith("linux"):
             platform_name = "linux-x86"
@@ -271,14 +326,39 @@
             platform_name = "darwin-x86"
         else:
             sys.exit("Unknown platform: {}".format(sys.platform))
+
         gdb_path = os.path.join(root, "prebuilts", "gdb", platform_name, "bin",
                                 "gdb")
+        # Generate a gdb script.
+        setup_commands = generate_setup_script(gdbpath=gdb_path,
+                                               sysroot=sysroot,
+                                               binary_file=binary_file,
+                                               is64bit=is64bit,
+                                               port=args.port,
+                                               debugger=args.setup_forwarding or "gdb")
 
-        # Print a newline to separate our messages from the GDB session.
-        print("")
+        if not args.setup_forwarding:
+            # Print a newline to separate our messages from the GDB session.
+            print("")
 
-        # Start gdb.
-        gdbrunner.start_gdb(gdb_path, gdb_commands)
+            # Start gdb.
+            gdbrunner.start_gdb(gdb_path, setup_commands)
+        else:
+            print("")
+            print setup_commands
+            print("")
+            if args.setup_forwarding == "vscode":
+                print textwrap.dedent("""
+                        Paste the above json into .vscode/launch.json and start the debugger as
+                        normal. Press enter in this terminal once debugging is finished to shutdown
+                        the gdbserver and close all the ports.""")
+            else:
+                print textwrap.dedent("""
+                        Paste the above gdb commands into the gdb frontend to setup the gdbserver
+                        connection. Press enter in this terminal once debugging is finished to
+                        shutdown the gdbserver and close all the ports.""")
+            print("")
+            raw_input("Press enter to shutdown gdbserver")
 
 if __name__ == "__main__":
     main()
diff --git a/scripts/native_heapdump_viewer-tests.xml b/scripts/native_heapdump_viewer-tests.xml
new file mode 100644
index 0000000..25d5623
--- /dev/null
+++ b/scripts/native_heapdump_viewer-tests.xml
@@ -0,0 +1,7 @@
+<configuration description="Config for python tradefed symbol test">
+    <option name="test-suite-tag" value="python-native_heapdump_viewer_test" />
+    <test class="com.android.tradefed.testtype.python.PythonBinaryHostTest" >
+        <option name="par-file-name" value="python-native_heapdump_viewer_test" />
+        <option name="test-timeout" value="2m" />
+    </test>
+</configuration>
diff --git a/scripts/native_heapdump_viewer.py b/scripts/native_heapdump_viewer.py
index 0689a1d..9b2a6e5 100755
--- a/scripts/native_heapdump_viewer.py
+++ b/scripts/native_heapdump_viewer.py
@@ -16,13 +16,16 @@
 
 """Generates a human-interpretable view of a native heap dump from 'am dumpheap -n'."""
 
+import logging
 import os
 import os.path
 import re
 import subprocess
 import sys
+import zipfile
 
-usage = """
+class Args:
+  _usage = """
 Usage:
 1. Collect a native heap dump from the device. For example:
    $ adb shell stop
@@ -40,6 +43,8 @@
       [--reverse]: reverse the backtraces (start the tree from the leaves)
       [--symbols SYMBOL_DIR] SYMBOL_DIR is the directory containing the .so files with symbols.
                  Defaults to $ANDROID_PRODUCT_OUT/symbols
+      [--app-symbols SYMBOL_DIR] SYMBOL_DIR is the directory containing the app APK and so files.
+                 Defaults to the current directory.
    This outputs a file with lines of the form:
 
       5831776  29.09% 100.00%    10532     71b07bc0b0 /system/lib64/libandroid_runtime.so Typeface_createFromArray frameworks/base/core/jni/android/graphics/Typeface.cpp:68
@@ -50,233 +55,366 @@
    stack frame. 71b07bc0b0 is the address of the stack frame.
 """
 
-verbose = False
-html_output = False
-reverse_frames = False
-product_out = os.getenv("ANDROID_PRODUCT_OUT")
-if product_out:
-    symboldir = product_out + "/symbols"
-else:
-    symboldir = "./symbols"
-
-args = sys.argv[1:]
-while len(args) > 1:
-    if args[0] == "--symbols":
-        symboldir = args[1]
-        args = args[2:]
-    elif args[0] == "--verbose":
-        verbose = True
-        args = args[1:]
-    elif args[0] == "--html":
-        html_output = True
-        args = args[1:]
-    elif args[0] == "--reverse":
-        reverse_frames = True
-        args = args[1:]
+  def __init__(self):
+    self.verbose = False
+    self.html_output = False
+    self.reverse_frames = False
+    product_out = os.getenv("ANDROID_PRODUCT_OUT")
+    if product_out:
+      self.symboldir = product_out + "/symbols"
     else:
-        print "Invalid option "+args[0]
-        break
+      self.symboldir = "./symbols"
+    self.app_symboldir = ""
 
-if len(args) != 1:
-    print usage
-    exit(0)
+    i = 1
+    extra_args = []
+    while i < len(sys.argv):
+      if sys.argv[i] == "--symbols":
+        i += 1
+        self.symboldir = sys.argv[i] + "/"
+      elif sys.argv[i] == "--app-symbols":
+        i += 1
+        self.app_symboldir = sys.argv[i] + "/"
+      elif sys.argv[i] == "--verbose":
+        self.verbose = True
+      elif sys.argv[i] == "--html":
+        self.html_output = True
+      elif sys.argv[i] == "--reverse":
+        self.reverse_frames = True
+      elif sys.argv[i][0] == '-':
+        print("Invalid option %s" % (sys.argv[i]))
+      else:
+        extra_args.append(sys.argv[i])
+      i += 1
 
-native_heap = args[0]
+    if len(extra_args) != 1:
+      print(self._usage)
+      sys.exit(1)
 
-re_map = re.compile("(?P<start>[0-9a-f]+)-(?P<end>[0-9a-f]+) .... (?P<offset>[0-9a-f]+) [0-9a-f]+:[0-9a-f]+ [0-9]+ +(?P<name>.*)")
+    self.native_heap = extra_args[0]
 
 class Backtrace:
-    def __init__(self, is_zygote, size, frames):
-        self.is_zygote = is_zygote
-        self.size = size
-        self.frames = frames
+  def __init__(self, is_zygote, size, num_allocs, frames):
+    self.is_zygote = is_zygote
+    self.size = size
+    self.num_allocs = num_allocs
+    self.frames = frames
 
 class Mapping:
-    def __init__(self, start, end, offset, name):
-        self.start = start
-        self.end = end
-        self.offset = offset
-        self.name = name
+  def __init__(self, start, end, offset, name):
+    self.start = start
+    self.end = end
+    self.offset = offset
+    self.name = name
 
 class FrameDescription:
-    def __init__(self, function, location, library):
-        self.function = function
-        self.location = location
-        self.library = library
+  def __init__(self, function, location, library):
+    self.function = function
+    self.location = location
+    self.library = library
 
+def GetVersion(native_heap):
+  """Get the version of the native heap dump."""
 
-backtraces = []
-mappings = []
+  re_line = re.compile("Android\s+Native\s+Heap\s+Dump\s+(?P<version>v\d+\.\d+)\s*$")
+  matched = 0
+  with open(native_heap, "r") as f:
+    for line in f:
+      m = re_line.match(line)
+      if m:
+        return m.group('version')
+  return None
 
-for line in open(native_heap, "r"):
-    parts = line.split()
-    if len(parts) > 7 and parts[0] == "z" and parts[2] == "sz":
+def GetNumFieldValidByParsingLines(native_heap):
+  """Determine if the num field is valid by parsing the backtrace lines.
+
+  Malloc debug for N incorrectly set the num field to the number of
+  backtraces instead of the number of allocations with the same size and
+  backtrace. Read the file and if at least three lines all have the field
+  set to the number of backtraces values, then consider this generated by
+  the buggy malloc debug and indicate the num field is not valid.
+
+  Returns:
+    True if the num field is valid.
+    False if the num field is not valid and should be ignored.
+  """
+
+  re_backtrace = re.compile("Backtrace\s+size:\s+(?P<backtrace_size>\d+)")
+
+  re_line = re.compile("z\s+(?P<zygote>\d+)\s+sz\s+(?P<size>\d+)\s+num\s+(?P<num_allocations>\d+)")
+  matched = 0
+  backtrace_size = 0
+  with open(native_heap, "r") as f:
+    for line in f:
+      if backtrace_size == 0:
+        m = re_backtrace.match(line)
+        if m:
+          backtrace_size = int(m.group('backtrace_size'))
+      parts = line.split()
+      if len(parts) > 7 and parts[0] == "z" and parts[2] == "sz":
+        m = re_line.match(line)
+        if m:
+          num_allocations = int(m.group('num_allocations'))
+          if num_allocations == backtrace_size:
+            # At least three lines must match this pattern before
+            # considering this the old buggy version of malloc debug.
+            matched += 1
+            if matched == 3:
+              return False
+          else:
+            return True
+  return matched == 0
+
+def GetNumFieldValid(native_heap):
+  version = GetVersion(native_heap)
+  if not version or version == "v1.0":
+    # Version v1.0 was produced by a buggy version of malloc debug where the
+    # num field was set incorrectly.
+    # Unfortunately, Android P produced a v1.0 version that does set the
+    # num field. Do one more check to see if this is the broken version.
+    return GetNumFieldValidByParsingLines(native_heap)
+  else:
+    return True
+
+def GetMappingFromOffset(mapping, app_symboldir):
+  """
+  If the input mapping is a zip file, translate the contained uncompressed files and add mapping
+  entries.
+
+  This is done to handle symbols for the uncompressed .so files inside APKs. With the replaced
+  mappings, the script looks up the .so files as separate files.
+  """
+  basename = os.path.basename(mapping.name)
+  zip_name = app_symboldir + basename
+  if os.path.isfile(zip_name):
+    opened_zip = zipfile.ZipFile(zip_name)
+    if opened_zip:
+      # For all files in the zip, add mappings for the internal files.
+      for file_info in opened_zip.infolist():
+        # Only add stored files since it doesn't make sense to have PC into compressed ones.
+        if file_info.compress_type == zipfile.ZIP_STORED:
+          zip_header_entry_size = 30
+          data_offset = (file_info.header_offset
+              + zip_header_entry_size
+              + len(file_info.filename)
+              + len(file_info.extra)
+              + len(file_info.comment))
+          end_offset = data_offset + file_info.file_size
+          if mapping.offset >= data_offset and mapping.offset < end_offset:
+            # Round up the data_offset to the nearest page since the .so must be aligned.
+            so_file_alignment = 4096
+            data_offset += so_file_alignment - 1;
+            data_offset -= data_offset % so_file_alignment;
+            mapping.name = file_info.filename
+            mapping.offset -= data_offset
+            break
+  return mapping
+
+def ParseNativeHeap(native_heap, reverse_frames, num_field_valid, app_symboldir):
+  """Parse the native heap into backtraces, maps.
+
+  Returns two lists, the first is a list of all of the backtraces, the
+  second is the sorted list of maps.
+  """
+
+  backtraces = []
+  mappings = []
+
+  re_map = re.compile("(?P<start>[0-9a-f]+)-(?P<end>[0-9a-f]+) .... (?P<offset>[0-9a-f]+) [0-9a-f]+:[0-9a-f]+ [0-9]+ +(?P<name>.*)")
+
+  with open(native_heap, "r") as f:
+    for line in f:
+      # Format of line:
+      #   z 0  sz       50  num    1  bt 000000000000a100 000000000000b200
+      parts = line.split()
+      if len(parts) > 7 and parts[0] == "z" and parts[2] == "sz":
         is_zygote = parts[1] != "1"
         size = int(parts[3])
-        frames = map(lambda x: int(x, 16), parts[7:])
+        if num_field_valid:
+          num_allocs = int(parts[5])
+        else:
+          num_allocs = 1
+        frames = list(map(lambda x: int(x, 16), parts[7:]))
         if reverse_frames:
-            frames = list(reversed(frames))
-        backtraces.append(Backtrace(is_zygote, size, frames))
-        continue
+          frames = list(reversed(frames))
+        backtraces.append(Backtrace(is_zygote, size, num_allocs, frames))
+      else:
+        # Parse map line:
+        #   720de01000-720ded7000 r-xp 00000000 fd:00 495  /system/lib64/libc.so
+        m = re_map.match(line)
+        if m:
+          # Offset of mapping start
+          start = int(m.group('start'), 16)
+          # Offset of mapping end
+          end = int(m.group('end'), 16)
+          # Offset within file that is mapped
+          offset = int(m.group('offset'), 16)
+          name = m.group('name')
+          mappings.append(GetMappingFromOffset(Mapping(start, end, offset, name), app_symboldir))
+  return backtraces, mappings
 
-    m = re_map.match(line)
-    if m:
-        start = int(m.group('start'), 16)
-        end = int(m.group('end'), 16)
-        offset = int(m.group('offset'), 16)
-        name = m.group('name')
-        mappings.append(Mapping(start, end, offset, name))
-        continue
+def FindMapping(mappings, addr):
+  """Find the mapping given addr.
 
-# Return the mapping that contains the given address.
-# Returns None if there is no such mapping.
-def find_mapping(addr):
-    min = 0
-    max = len(mappings) - 1
-    while True:
-        if max < min:
-            return None
-        mid = (min + max) // 2
-        if mappings[mid].end <= addr:
-            min = mid + 1
-        elif mappings[mid].start > addr:
-            max = mid - 1
-        else:
-            return mappings[mid]
+  Returns the mapping that contains addr.
+  Returns None if there is no such mapping.
+  """
 
-# Resolve address libraries and offsets.
-# addr_offsets maps addr to .so file offset
-# addrs_by_lib maps library to list of addrs from that library
-# Resolved addrs maps addr to FrameDescription
-addr_offsets = {}
-addrs_by_lib = {}
-resolved_addrs = {}
-EMPTY_FRAME_DESCRIPTION = FrameDescription("???", "???", "???")
-for backtrace in backtraces:
-    for addr in backtrace.frames:
-        if addr in addr_offsets:
-            continue
-        mapping = find_mapping(addr)
-        if mapping:
-            addr_offsets[addr] = addr - mapping.start + mapping.offset
-            if not (mapping.name in addrs_by_lib):
-                addrs_by_lib[mapping.name] = []
-            addrs_by_lib[mapping.name].append(addr)
-        else:
-            resolved_addrs[addr] = EMPTY_FRAME_DESCRIPTION
-
-
-# Resolve functions and line numbers
-if html_output == False:
-  print "Resolving symbols using directory %s..." % symboldir
-for lib in addrs_by_lib:
-    sofile = symboldir + lib
-    if os.path.isfile(sofile):
-        file_offset = 0
-        result = subprocess.check_output(["objdump", "-w", "-j", ".text", "-h", sofile])
-        for line in result.split("\n"):
-            splitted = line.split()
-            if len(splitted) > 5 and splitted[1] == ".text":
-                file_offset = int(splitted[5], 16)
-                break
-
-        input_addrs = ""
-        for addr in addrs_by_lib[lib]:
-            input_addrs += "%s\n" % hex(addr_offsets[addr] - file_offset)
-        p = subprocess.Popen(["addr2line", "-C", "-j", ".text", "-e", sofile, "-f"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
-        result = p.communicate(input_addrs)[0]
-        splitted = result.split("\n")
-        for x in range(0, len(addrs_by_lib[lib])):
-            function = splitted[2*x];
-            location = splitted[2*x+1];
-            resolved_addrs[addrs_by_lib[lib][x]] = FrameDescription(function, location, lib)
-
+  min = 0
+  max = len(mappings) - 1
+  while True:
+    if max < min:
+      return None
+    mid = (min + max) // 2
+    if mappings[mid].end <= addr:
+      min = mid + 1
+    elif mappings[mid].start > addr:
+      max = mid - 1
     else:
-        if html_output == False:
-            print "%s not found for symbol resolution" % lib
-        fd = FrameDescription("???", "???", lib)
-        for addr in addrs_by_lib[lib]:
-            resolved_addrs[addr] = fd
+      return mappings[mid]
 
-def addr2line(addr):
-    if addr == "ZYGOTE" or addr == "APP":
-        return FrameDescription("", "", "")
 
-    return resolved_addrs[int(addr, 16)]
+def ResolveAddrs(html_output, symboldir, app_symboldir, backtraces, mappings):
+  """Resolve address libraries and offsets.
+
+  addr_offsets maps addr to .so file offset
+  addrs_by_lib maps library to list of addrs from that library
+  Resolved addrs maps addr to FrameDescription
+
+  Returns the resolved_addrs hash.
+  """
+
+  addr_offsets = {}
+  addrs_by_lib = {}
+  resolved_addrs = {}
+  empty_frame_description = FrameDescription("???", "???", "???")
+  for backtrace in backtraces:
+    for addr in backtrace.frames:
+      if addr in addr_offsets:
+        continue
+      mapping = FindMapping(mappings, addr)
+      if mapping:
+        addr_offsets[addr] = addr - mapping.start + mapping.offset
+        if not (mapping.name in addrs_by_lib):
+          addrs_by_lib[mapping.name] = []
+        addrs_by_lib[mapping.name].append(addr)
+      else:
+        resolved_addrs[addr] = empty_frame_description
+
+  # Resolve functions and line numbers.
+  if html_output == False:
+    print("Resolving symbols using directory %s..." % symboldir)
+
+  for lib in addrs_by_lib:
+    sofile = app_symboldir + lib
+    if not os.path.isfile(sofile):
+      sofile = symboldir + lib
+    if os.path.isfile(sofile):
+      file_offset = 0
+      result = subprocess.check_output(["objdump", "-w", "-j", ".text", "-h", sofile])
+      for line in result.split("\n"):
+        splitted = line.split()
+        if len(splitted) > 5 and splitted[1] == ".text":
+          file_offset = int(splitted[5], 16)
+          break
+
+      input_addrs = ""
+      for addr in addrs_by_lib[lib]:
+        input_addrs += "%s\n" % hex(addr_offsets[addr] - file_offset)
+
+      p = subprocess.Popen(["addr2line", "-C", "-j", ".text", "-e", sofile, "-f"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+      result = p.communicate(input_addrs)[0]
+      addr2line_rc = p.returncode
+      if addr2line_rc and (addr2line_rc < 0):
+        logging.warn("addr2line on " + sofile + " terminated by signal " + str(-1 * addr2line_rc))
+      splitted = result.split("\n")
+      for x in range(0, len(addrs_by_lib[lib])):
+        try:
+          function = splitted[2*x];
+          location = splitted[2*x+1];
+          resolved_addrs[addrs_by_lib[lib][x]] = FrameDescription(function, location, lib)
+        except Exception:
+          logging.warn("exception while resolving symbols", exc_info=True)
+          resolved_addrs[addrs_by_lib[lib][x]] = FrameDescription("---", "---", lib)
+    else:
+      if html_output == False:
+        print("%s not found for symbol resolution" % lib)
+
+      fd = FrameDescription("???", "???", lib)
+      for addr in addrs_by_lib[lib]:
+        resolved_addrs[addr] = fd
+
+  return resolved_addrs
+
+def Addr2Line(resolved_addrs, addr):
+  if addr == "ZYGOTE" or addr == "APP":
+    return FrameDescription("", "", "")
+
+  return resolved_addrs[int(addr, 16)]
 
 class AddrInfo:
-    def __init__(self, addr):
-        self.addr = addr
-        self.size = 0
-        self.number = 0
-        self.children = {}
+  def __init__(self, addr):
+    self.addr = addr
+    self.size = 0
+    self.number = 0
+    self.num_allocs = 0
+    self.children = {}
 
-    def addStack(self, size, stack):
-        self.size += size
-        self.number += 1
-        if len(stack) > 0:
-            child = stack[0]
-            if not (child.addr in self.children):
-                self.children[child.addr] = child
-            self.children[child.addr].addStack(size, stack[1:])
+  def addStack(self, size, num_allocs, stack):
+    self.size += size * num_allocs
+    self.number += num_allocs
+    if len(stack) > 0:
+      child = stack[0]
+      if not (child.addr in self.children):
+        self.children[child.addr] = child
+      self.children[child.addr].addStack(size, num_allocs, stack[1:])
 
-zygote = AddrInfo("ZYGOTE")
-app = AddrInfo("APP")
+def Display(resolved_addrs, indent, total, parent_total, node):
+  fd = Addr2Line(resolved_addrs, node.addr)
+  total_percent = 0
+  if total != 0:
+    total_percent = 100 * node.size / float(total)
+  parent_percent = 0
+  if parent_total != 0:
+    parent_percent = 100 * node.size / float(parent_total)
+  print("%9d %6.2f%% %6.2f%% %8d %s%s %s %s %s" % (node.size, total_percent, parent_percent, node.number, indent, node.addr, fd.library, fd.function, fd.location))
+  children = sorted(node.children.values(), key=lambda x: x.size, reverse=True)
+  for child in children:
+    Display(resolved_addrs, indent + "  ", total, node.size, child)
 
-def display(indent, total, parent_total, node):
-    fd = addr2line(node.addr)
-    total_percent = 0
-    if total != 0:
-      total_percent = 100 * node.size / float(total)
-    parent_percent = 0
-    if parent_total != 0:
-      parent_percent = 100 * node.size / float(parent_total)
-    print "%9d %6.2f%% %6.2f%% %8d %s%s %s %s %s" % (node.size, total_percent, parent_percent, node.number, indent, node.addr, fd.library, fd.function, fd.location)
-    children = sorted(node.children.values(), key=lambda x: x.size, reverse=True)
+def DisplayHtml(verbose, resolved_addrs, total, node, extra, label_count):
+  fd = Addr2Line(resolved_addrs, node.addr)
+  if verbose:
+    lib = fd.library
+  else:
+    lib = os.path.basename(fd.library)
+  total_percent = 0
+  if total != 0:
+    total_percent = 100 * node.size / float(total)
+  label = "%d %6.2f%% %6d %s%s %s %s" % (node.size, total_percent, node.number, extra, lib, fd.function, fd.location)
+  label = label.replace("&", "&amp;")
+  label = label.replace("'", "&apos;")
+  label = label.replace('"', "&quot;")
+  label = label.replace("<", "&lt;")
+  label = label.replace(">", "&gt;")
+  children = sorted(node.children.values(), key=lambda x: x.size, reverse=True)
+  print('<li>')
+  if len(children) > 0:
+    print('<label for="' + str(label_count) + '">' + label + '</label>')
+    print('<input type="checkbox" id="' + str(label_count) + '"/>')
+    print('<ol>')
+    label_count += 1
     for child in children:
-        display(indent + "  ", total, node.size, child)
+      label_count = DisplayHtml(verbose, resolved_addrs, total, child, "", label_count)
+    print('</ol>')
+  else:
+    print(label)
+  print('</li>')
 
-label_count=0
-def display_html(total, node, extra):
-    global label_count
-    fd = addr2line(node.addr)
-    if verbose:
-        lib = fd.library
-    else:
-        lib = os.path.basename(fd.library)
-    total_percent = 0
-    if total != 0:
-        total_percent = 100 * node.size / float(total)
-    label = "%d %6.2f%% %6d %s%s %s %s" % (node.size, total_percent, node.number, extra, lib, fd.function, fd.location)
-    label = label.replace("&", "&amp;")
-    label = label.replace("'", "&apos;")
-    label = label.replace('"', "&quot;")
-    label = label.replace("<", "&lt;")
-    label = label.replace(">", "&gt;")
-    children = sorted(node.children.values(), key=lambda x: x.size, reverse=True)
-    print '<li>'
-    if len(children) > 0:
-        print '<label for="' + str(label_count) + '">' + label + '</label>'
-        print '<input type="checkbox" id="' + str(label_count) + '"/>'
-        print '<ol>'
-        label_count+=1
-        for child in children:
-            display_html(total, child, "")
-        print '</ol>'
-    else:
-        print label
-    print '</li>'
-for backtrace in backtraces:
-    stack = []
-    for addr in backtrace.frames:
-        stack.append(AddrInfo("%x" % addr))
-    stack.reverse()
-    if backtrace.is_zygote:
-        zygote.addStack(backtrace.size, stack)
-    else:
-        app.addStack(backtrace.size, stack)
+  return label_count
 
-html_header = """
+def CreateHtml(verbose, app, zygote, resolved_addrs):
+  print("""
 <!DOCTYPE html>
 <html><head><style>
 li input {
@@ -295,21 +433,50 @@
     font-family: Roboto Mono,monospace;
     cursor: pointer
 }
-</style></head><body>Native allocation HTML viewer<ol>
-"""
-html_footer = "</ol></body></html>"
+</style></head><body>Native allocation HTML viewer<br><br>
+Click on an individual line to expand/collapse to see the details of the
+allocation data<ol>
+""")
 
-if html_output:
-    print html_header
-    display_html(app.size, app, "app ")
-    if zygote.size>0:
-        display_html(zygote.size, zygote, "zygote ")
-    print html_footer
-else:
-    print ""
-    print "%9s %6s %6s %8s    %s %s %s %s" % ("BYTES", "%TOTAL", "%PARENT", "COUNT", "ADDR", "LIBRARY", "FUNCTION", "LOCATION")
-    display("", app.size, app.size + zygote.size, app)
-    print ""
-    display("", zygote.size, app.size + zygote.size, zygote)
-    print ""
+  label_count = 0
+  label_count = DisplayHtml(verbose, resolved_addrs, app.size, app, "app ", label_count)
+  if zygote.size > 0:
+    DisplayHtml(verbose, resolved_addrs, zygote.size, zygote, "zygote ", label_count)
+  print("</ol></body></html>")
 
+def main():
+  args = Args()
+
+  num_field_valid = GetNumFieldValid(args.native_heap)
+
+  backtraces, mappings = ParseNativeHeap(args.native_heap, args.reverse_frames, num_field_valid,
+      args.app_symboldir)
+  # Resolve functions and line numbers
+  resolved_addrs = ResolveAddrs(args.html_output, args.symboldir, args.app_symboldir, backtraces,
+      mappings)
+
+  app = AddrInfo("APP")
+  zygote = AddrInfo("ZYGOTE")
+
+  for backtrace in backtraces:
+    stack = []
+    for addr in backtrace.frames:
+      stack.append(AddrInfo("%x" % addr))
+    stack.reverse()
+    if backtrace.is_zygote:
+      zygote.addStack(backtrace.size, backtrace.num_allocs, stack)
+    else:
+      app.addStack(backtrace.size, backtrace.num_allocs, stack)
+
+  if args.html_output:
+    CreateHtml(args.verbose, app, zygote, resolved_addrs)
+  else:
+    print("")
+    print("%9s %6s %6s %8s    %s %s %s %s" % ("BYTES", "%TOTAL", "%PARENT", "COUNT", "ADDR", "LIBRARY", "FUNCTION", "LOCATION"))
+    Display(resolved_addrs, "", app.size, app.size + zygote.size, app)
+    print("")
+    Display(resolved_addrs, "", zygote.size, app.size + zygote.size, zygote)
+    print("")
+
+if __name__ == '__main__':
+  main()
diff --git a/scripts/native_heapdump_viewer_tests.py b/scripts/native_heapdump_viewer_tests.py
new file mode 100755
index 0000000..423d1c8
--- /dev/null
+++ b/scripts/native_heapdump_viewer_tests.py
@@ -0,0 +1,183 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Tests for the native_heapdump_viewer script."""
+
+import native_heapdump_viewer
+import os
+import sys
+import tempfile
+import unittest
+
+class NativeHeapdumpViewerTest(unittest.TestCase):
+  _tmp_file_name = None
+
+  def CreateTmpFile(self, contents):
+    fd, self._tmp_file_name = tempfile.mkstemp()
+    os.write(fd, contents.encode())
+    os.close(fd)
+    return self._tmp_file_name
+
+  def tearDown(self):
+    if self._tmp_file_name:
+      try:
+        os.unlink(self._tmp_file_name)
+      except Exception:
+        print("Failed to delete %s" % (heap))
+
+class GetNumFieldValidTest(NativeHeapdumpViewerTest):
+  _map_data = """
+MAPS
+1000-10000 r-xp 00000000 fd:00 495                            /data/does_not_exist.so
+END
+"""
+
+  _heap_num_field_valid_version10 = """
+Android Native Heap Dump v1.0
+
+Total memory: 33800
+Allocation records: 13
+Backtrace size: 16
+
+z 1  sz   1000  num    4  bt 1000 2000 3000
+z 1  sz   2000  num    6  bt 1100 2100 3100
+z 0  sz   1200  num    1  bt 1200 2200 3200
+z 0  sz   8300  num    2  bt 1300 2300 3300
+"""
+
+  _heap_num_field_invalid_version10 = """
+Android Native Heap Dump v1.0
+
+Total memory: 12500
+Allocation records: 4
+Backtrace size: 16
+
+z 1  sz   1000  num    16  bt 1000 2000 3000
+z 1  sz   2000  num    16  bt 1100 2100 3100
+z 0  sz   1200  num    16  bt 1200 2200 3200
+z 0  sz   8300  num    16  bt 1300 2300 3300
+"""
+
+  _heap_data = """
+
+Total memory: 200000
+Allocation records: 64
+Backtrace size: 16
+
+z 1  sz   1000  num    16  bt 1000 2000 3000
+z 1  sz   2000  num    16  bt 1100 2100 3100
+z 0  sz   1200  num    16  bt 1200 2200 3200
+z 0  sz   8300  num    16  bt 1300 2300 3300
+"""
+
+  def test_version10_valid(self):
+    heap = self.CreateTmpFile(self._heap_num_field_valid_version10 + self._map_data)
+    self.assertTrue(native_heapdump_viewer.GetNumFieldValid(heap))
+
+  def test_version10_invalid(self):
+    heap = self.CreateTmpFile(self._heap_num_field_invalid_version10 + self._map_data)
+    self.assertFalse(native_heapdump_viewer.GetNumFieldValid(heap))
+
+  def test_version11_valid(self):
+    heap = self.CreateTmpFile("Android Native Heap Dump v1.1" + self._heap_data + self._map_data)
+    self.assertTrue(native_heapdump_viewer.GetNumFieldValid(heap))
+
+  def test_version12_valid(self):
+    heap = self.CreateTmpFile("Android Native Heap Dump v1.2" + self._heap_data + self._map_data)
+    self.assertTrue(native_heapdump_viewer.GetNumFieldValid(heap))
+
+class ParseNativeHeapTest(NativeHeapdumpViewerTest):
+  _backtrace_data = """
+z 1  sz   1000  num    4  bt 1000 2000 3000
+z 0  sz   8300  num    5  bt 1300 2300 3300
+"""
+
+
+  def test_backtrace_num_field_valid(self):
+    heap = self.CreateTmpFile(self._backtrace_data)
+    backtraces, mapppings = native_heapdump_viewer.ParseNativeHeap(heap, False, True, "")
+    self.assertTrue(backtraces)
+    self.assertEqual(2, len(backtraces))
+
+    self.assertFalse(backtraces[0].is_zygote)
+    self.assertEqual(1000, backtraces[0].size)
+    self.assertEqual(4, backtraces[0].num_allocs)
+    self.assertEqual([0x1000, 0x2000, 0x3000], backtraces[0].frames)
+
+    self.assertTrue(backtraces[1].is_zygote)
+    self.assertEqual(8300, backtraces[1].size)
+    self.assertEqual(5, backtraces[1].num_allocs)
+    self.assertEqual([0x1300, 0x2300, 0x3300], backtraces[1].frames)
+
+  def test_backtrace_num_field_invalid(self):
+    heap = self.CreateTmpFile(self._backtrace_data)
+    backtraces, mapppings = native_heapdump_viewer.ParseNativeHeap(heap, False, False, "")
+    self.assertTrue(backtraces)
+    self.assertEqual(2, len(backtraces))
+
+    self.assertFalse(backtraces[0].is_zygote)
+    self.assertEqual(1000, backtraces[0].size)
+    self.assertEqual(1, backtraces[0].num_allocs)
+    self.assertEqual([0x1000, 0x2000, 0x3000], backtraces[0].frames)
+
+    self.assertTrue(backtraces[1].is_zygote)
+    self.assertEqual(8300, backtraces[1].size)
+    self.assertEqual(1, backtraces[1].num_allocs)
+    self.assertEqual([0x1300, 0x2300, 0x3300], backtraces[1].frames)
+
+  def test_backtrace_reverse_field_valid(self):
+    heap = self.CreateTmpFile(self._backtrace_data)
+    backtraces, mapppings = native_heapdump_viewer.ParseNativeHeap(heap, True, True, "")
+    self.assertTrue(backtraces)
+    self.assertEqual(2, len(backtraces))
+
+    self.assertFalse(backtraces[0].is_zygote)
+    self.assertEqual(1000, backtraces[0].size)
+    self.assertEqual(4, backtraces[0].num_allocs)
+    self.assertEqual([0x3000, 0x2000, 0x1000], backtraces[0].frames)
+
+    self.assertTrue(backtraces[1].is_zygote)
+    self.assertEqual(8300, backtraces[1].size)
+    self.assertEqual(5, backtraces[1].num_allocs)
+    self.assertEqual([0x3300, 0x2300, 0x1300], backtraces[1].frames)
+
+  def test_mappings(self):
+    map_data = """
+MAPS
+1000-4000 r-xp 00000000 fd:00 495    /system/lib64/libc.so
+6000-8000 r-xp 00000000 fd:00 495
+a000-f000 r-xp 0000b000 fd:00 495    /system/lib64/libutils.so
+END
+"""
+
+    heap = self.CreateTmpFile(map_data)
+    backtraces, mappings = native_heapdump_viewer.ParseNativeHeap(heap, True, True, "")
+
+    self.assertTrue(mappings)
+    self.assertEqual(2, len(mappings))
+
+    self.assertEqual(0x1000, mappings[0].start)
+    self.assertEqual(0x4000, mappings[0].end)
+    self.assertEqual(0, mappings[0].offset)
+    self.assertEqual("/system/lib64/libc.so", mappings[0].name)
+
+    self.assertEqual(0xa000, mappings[1].start)
+    self.assertEqual(0xf000, mappings[1].end)
+    self.assertEqual(0xb000, mappings[1].offset)
+    self.assertEqual("/system/lib64/libutils.so", mappings[1].name)
+
+if __name__ == '__main__':
+  unittest.main(verbosity=2)
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh b/scripts/pid
similarity index 60%
copy from vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
copy to scripts/pid
index bc94afc..d78005e 100755
--- a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
+++ b/scripts/pid
@@ -1,6 +1,4 @@
-#!/bin/bash -ex
-
-#
+#!/bin/bash
 # Copyright (C) 2018 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,7 +12,29 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-#
 
-python3 -m unittest discover "$@"
-python -m unittest discover "$@"
+# Get the pid of processes matching a string.
+EXACT=0
+if [ "$1" = "--exact" ]; then
+    EXACT=1
+    shift
+fi
+
+EXE="$1"
+if ! [ "$EXE" ] ; then
+    echo "usage: pid [--exact] <process name>"
+    exit 255
+fi
+
+if [ $EXACT == 1 ]; then
+    PIDS="$(adb shell pidof $EXE)"
+else
+    PIDS="$(adb shell pgrep -f $EXE)"
+fi
+RC=$?
+
+for PID in $PIDS; do
+    echo $PID
+done
+
+exit $RC
diff --git a/scripts/stacks b/scripts/stacks
new file mode 100755
index 0000000..f66b7b3
--- /dev/null
+++ b/scripts/stacks
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Get backtraces for a process.
+if [[ $1 =~ ^[0-9]+$ ]] ; then
+    PID="$1"
+elif [ "$1" ] ; then
+    # Try --exact first, and fallback to nonexact if we find nothing.
+    PIDLIST="$(pid --exact $1 || pid $1)"
+    if [[ $PIDLIST =~ ^[0-9]+$ ]] ; then
+        PID="$PIDLIST"
+    elif [ "$PIDLIST" ] ; then
+        echo "more than one process: $1"
+    else
+        echo "no such process: $1"
+    fi
+else
+    echo "usage: stacks [pid|process name]"
+fi
+
+if [ "$PID" ] ; then
+    # Use `debuggerd -j` on java processes.
+    if adb shell readlink /proc/$PID/exe | egrep -q '^/system/bin/app_process' ; then
+        # But not the zygote.
+        if ! adb shell cat /proc/$PID/cmdline | egrep -q '^zygote'; then
+            adb shell debuggerd -j $PID
+            exit $?
+        fi
+    fi
+
+    adb shell debuggerd -b $PID
+fi
diff --git a/scripts/symbol-tests.xml b/scripts/symbol-tests.xml
new file mode 100644
index 0000000..a0e575b
--- /dev/null
+++ b/scripts/symbol-tests.xml
@@ -0,0 +1,7 @@
+<configuration description="Config for python tradefed symbol test">
+    <option name="test-suite-tag" value="python-symbol_test" />
+    <test class="com.android.tradefed.testtype.python.PythonBinaryHostTest" >
+        <option name="par-file-name" value="python-symbol_test" />
+        <option name="test-timeout" value="2m" />
+    </test>
+</configuration>
diff --git a/scripts/symbol.py b/scripts/symbol.py
index 77ee1b3..e6560e4 100755
--- a/scripts/symbol.py
+++ b/scripts/symbol.py
@@ -28,18 +28,24 @@
 import subprocess
 import unittest
 
-ANDROID_BUILD_TOP = os.environ["ANDROID_BUILD_TOP"]
-if not ANDROID_BUILD_TOP:
+try:
+  ANDROID_BUILD_TOP = str(os.environ["ANDROID_BUILD_TOP"])
+  if not ANDROID_BUILD_TOP:
+    ANDROID_BUILD_TOP = "."
+except:
   ANDROID_BUILD_TOP = "."
 
 def FindSymbolsDir():
   saveddir = os.getcwd()
   os.chdir(ANDROID_BUILD_TOP)
+  stream = None
   try:
     cmd = "build/soong/soong_ui.bash --dumpvar-mode --abs TARGET_OUT_UNSTRIPPED"
     stream = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True).stdout
-    return os.path.join(ANDROID_BUILD_TOP, stream.read().strip())
+    return os.path.join(ANDROID_BUILD_TOP, str(stream.read().strip()))
   finally:
+    if stream is not None:
+        stream.close()
     os.chdir(saveddir)
 
 SYMBOLS_DIR = FindSymbolsDir()
@@ -166,7 +172,7 @@
 
   _CACHED_TOOLCHAIN = toolchain
   _CACHED_TOOLCHAIN_ARCH = ARCH
-  print "Using %s toolchain from: %s" % (_CACHED_TOOLCHAIN_ARCH, _CACHED_TOOLCHAIN)
+  print("Using %s toolchain from: %s" % (_CACHED_TOOLCHAIN_ARCH, _CACHED_TOOLCHAIN))
   return _CACHED_TOOLCHAIN
 
 
@@ -297,26 +303,30 @@
   child = _PIPE_ADDR2LINE_CACHE.GetProcess(cmd)
 
   for addr in addrs:
-    child.stdin.write("0x%s\n" % addr)
-    child.stdin.flush()
-    records = []
-    first = True
-    while True:
-      symbol = child.stdout.readline().strip()
-      if symbol == "??":
-        symbol = None
-      location = child.stdout.readline().strip()
-      if location == "??:0" or location == "??:?":
-        location = None
-      if symbol is None and location is None:
-        break
-      records.append((symbol, location))
-      if first:
-        # Write a blank line as a sentinel so we know when to stop
-        # reading inlines from the output.
-        # The blank line will cause addr2line to emit "??\n??:0\n".
-        child.stdin.write("\n")
-        first = False
+    try:
+      child.stdin.write("0x%s\n" % addr)
+      child.stdin.flush()
+      records = []
+      first = True
+      while True:
+        symbol = child.stdout.readline().strip()
+        if symbol == "??":
+          symbol = None
+        location = child.stdout.readline().strip()
+        if location == "??:0" or location == "??:?":
+          location = None
+        if symbol is None and location is None:
+          break
+        records.append((symbol, location))
+        if first:
+          # Write a blank line as a sentinel so we know when to stop
+          # reading inlines from the output.
+          # The blank line will cause addr2line to emit "??\n??:0\n".
+          child.stdin.write("\n")
+          first = False
+    except IOError as e:
+      # Remove the / in front of the library name to match other output.
+      records = [(None, lib[1:] + "  ***Error: " + str(e))]
     result[addr] = records
     addr_cache[addr] = records
   return result
@@ -543,6 +553,7 @@
     ARCH = abi
     FindToolchain() # Will throw on failure.
 
+  @unittest.skipIf(ANDROID_BUILD_TOP == '.', 'Test only supported in an Android tree.')
   def test_toolchains_found(self):
     self.assert_toolchain_found("arm")
     self.assert_toolchain_found("arm64")
@@ -713,7 +724,13 @@
   def test_no_abi(self):
     global ARCH
 
-    self.assertRaisesRegexp(Exception, "Could not determine arch from input, use --arch=XXX to specify it", SetAbi, [])
+    # Python2 vs Python3 compatibility: Python3 warns on Regexp deprecation, but Regex
+    #                                   does not provide that name.
+    if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
+      unittest.TestCase.assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegexp')
+    self.assertRaisesRegex(Exception,
+                           "Could not determine arch from input, use --arch=XXX to specify it",
+                           SetAbi, [])
 
 if __name__ == '__main__':
-    unittest.main()
+    unittest.main(verbosity=2)
diff --git a/sdk/Android.bp b/sdk/Android.bp
new file mode 100644
index 0000000..0b1a318
--- /dev/null
+++ b/sdk/Android.bp
@@ -0,0 +1,6 @@
+genrule {
+    name: "platform_tools_version",
+    cmd: "sed 's/$${PLATFORM_SDK_VERSION}/0/ ; s/^Pkg.Revision=\\(.*\\)/#define PLATFORM_TOOLS_VERSION \"\\1\"/p ; d' $(in) > $(out)",
+    srcs: ["plat_tools_source.prop_template"],
+    out: ["platform_tools_version.h"],
+}
diff --git a/sdk/plat_tools_source.prop_template b/sdk/plat_tools_source.prop_template
index 2175bbb..7b629b3 100644
--- a/sdk/plat_tools_source.prop_template
+++ b/sdk/plat_tools_source.prop_template
@@ -1,3 +1,2 @@
 Pkg.UserSrc=false
-#Pkg.Revision=${PLATFORM_SDK_VERSION}.0.0
-Pkg.Revision=28.0.0 rc1
+Pkg.Revision=28.0.2
diff --git a/sys-img/advancedFeatures.ini b/sys-img/advancedFeatures.ini
index 0234cb0..d2ed42c 100644
--- a/sys-img/advancedFeatures.ini
+++ b/sys-img/advancedFeatures.ini
@@ -6,3 +6,5 @@
 EncryptUserData = on
 SystemAsRoot = on
 Wifi = on
+KernelDeviceTreeBlobSupport = on
+HostComposition = on
diff --git a/sys-img/images_arm64-v8a_source.prop_template b/sys-img/images_arm64-v8a_source.prop_template
index c2c3851..54f52d5 100644
--- a/sys-img/images_arm64-v8a_source.prop_template
+++ b/sys-img/images_arm64-v8a_source.prop_template
@@ -1,6 +1,6 @@
 Pkg.Desc=Android SDK System Image
 Pkg.UserSrc=false
-Pkg.Revision=4
+Pkg.Revision=1
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=arm64-v8a
diff --git a/sys-img/images_armeabi-v7a_source.prop_template b/sys-img/images_armeabi-v7a_source.prop_template
index 6322547..a2ae522 100644
--- a/sys-img/images_armeabi-v7a_source.prop_template
+++ b/sys-img/images_armeabi-v7a_source.prop_template
@@ -1,6 +1,6 @@
 Pkg.Desc=Android SDK System Image
 Pkg.UserSrc=false
-Pkg.Revision=4
+Pkg.Revision=1
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=armeabi-v7a
diff --git a/sys-img/images_armeabi_source.prop_template b/sys-img/images_armeabi_source.prop_template
index ebfec29..280fa9b 100644
--- a/sys-img/images_armeabi_source.prop_template
+++ b/sys-img/images_armeabi_source.prop_template
@@ -1,6 +1,6 @@
 Pkg.Desc=Android SDK System Image
 Pkg.UserSrc=false
-Pkg.Revision=4
+Pkg.Revision=1
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=armeabi
diff --git a/sys-img/images_x86_64_source.prop_template b/sys-img/images_x86_64_source.prop_template
index 7f7af45..5b6b90a 100644
--- a/sys-img/images_x86_64_source.prop_template
+++ b/sys-img/images_x86_64_source.prop_template
@@ -1,6 +1,6 @@
 Pkg.Desc=Android SDK System Image
 Pkg.UserSrc=false
-Pkg.Revision=4
+Pkg.Revision=1
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=x86_64
diff --git a/sys-img/images_x86_source.prop_template b/sys-img/images_x86_source.prop_template
index ef470a0..a437d6d 100644
--- a/sys-img/images_x86_source.prop_template
+++ b/sys-img/images_x86_source.prop_template
@@ -1,6 +1,6 @@
 Pkg.Desc=Android SDK System Image
 Pkg.UserSrc=false
-Pkg.Revision=4
+Pkg.Revision=1
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=x86
diff --git a/testrunner/adb_interface.py b/testrunner/adb_interface.py
index 7dd8f4c..93b4088 100755
--- a/testrunner/adb_interface.py
+++ b/testrunner/adb_interface.py
@@ -176,7 +176,8 @@
 
   def StartInstrumentationForPackage(
       self, package_name, runner_name, timeout_time=60*10,
-      no_window_animation=False, instrumentation_args={}, user=None):
+      no_window_animation=False, instrumentation_args={}, user=None,
+      no_hidden_api_checks=False):
     """Run instrumentation test for given package and runner.
 
     Equivalent to StartInstrumentation, except instrumentation path is
@@ -186,11 +187,13 @@
     return self.StartInstrumentation(instrumentation_path, timeout_time=timeout_time,
                                      no_window_animation=no_window_animation,
                                      instrumentation_args=instrumentation_args,
-                                     user=user)
+                                     user=user,
+                                     no_hidden_api_checks=no_hidden_api_checks)
 
   def StartInstrumentation(
       self, instrumentation_path, timeout_time=60*10, no_window_animation=False,
-      profile=False, instrumentation_args={}, user=None):
+      profile=False, instrumentation_args={}, user=None,
+      no_hidden_api_checks=False):
 
     """Runs an instrumentation class on the target.
 
@@ -232,7 +235,7 @@
         instrumentation_path, no_window_animation=no_window_animation,
         profile=profile, raw_mode=True,
         instrumentation_args=instrumentation_args,
-        user=user)
+        user=user, no_hidden_api_checks=no_hidden_api_checks)
     logger.Log(command_string)
     (test_results, inst_finished_bundle) = (
         am_instrument_parser.ParseAmInstrumentOutput(
@@ -258,7 +261,8 @@
 
   def StartInstrumentationNoResults(
       self, package_name, runner_name, no_window_animation=False,
-      raw_mode=False, instrumentation_args={}, user=None):
+      raw_mode=False, instrumentation_args={}, user=None,
+      no_hidden_api_checks=False):
     """Runs instrumentation and dumps output to stdout.
 
     Equivalent to StartInstrumentation, but will dump instrumentation
@@ -268,18 +272,19 @@
     adb_command_string = self.PreviewInstrumentationCommand(
         package_name, runner_name, no_window_animation=no_window_animation,
         raw_mode=raw_mode, instrumentation_args=instrumentation_args,
-        user=user)
+        user=user, no_hidden_api_checks=no_hidden_api_checks)
     logger.Log(adb_command_string)
     run_command.RunCommand(adb_command_string, return_output=False)
 
   def PreviewInstrumentationCommand(
       self, package_name, runner_name, no_window_animation=False,
-      raw_mode=False, instrumentation_args={}, user=None):
+      raw_mode=False, instrumentation_args={}, user=None,
+      no_hidden_api_checks=False):
     """Returns a string of adb command that will be executed."""
     inst_command_string = self._BuildInstrumentationCommand(
         package_name, runner_name, no_window_animation=no_window_animation,
         raw_mode=raw_mode, instrumentation_args=instrumentation_args,
-        user=user)
+        user=user, no_hidden_api_checks=no_hidden_api_checks)
     return self.PreviewShellCommand(inst_command_string)
 
   def PreviewShellCommand(self, cmd):
@@ -287,18 +292,23 @@
 
   def _BuildInstrumentationCommand(
       self, package, runner_name, no_window_animation=False, profile=False,
-      raw_mode=True, instrumentation_args={}, user=None):
+      raw_mode=True, instrumentation_args={}, user=None,
+      no_hidden_api_checks=False):
     instrumentation_path = "%s/%s" % (package, runner_name)
 
     return self._BuildInstrumentationCommandPath(
         instrumentation_path, no_window_animation=no_window_animation,
         profile=profile, raw_mode=raw_mode,
-        instrumentation_args=instrumentation_args, user=user)
+        instrumentation_args=instrumentation_args, user=user,
+        no_hidden_api_checks=no_hidden_api_checks)
 
   def _BuildInstrumentationCommandPath(
       self, instrumentation_path, no_window_animation=False, profile=False,
-      raw_mode=True, instrumentation_args={}, user=None):
+      raw_mode=True, instrumentation_args={}, user=None,
+      no_hidden_api_checks=False):
     command_string = "am instrument"
+    if no_hidden_api_checks:
+      command_string += " --no-hidden-api-checks"
     if user:
       command_string += " --user %s" % user
     if no_window_animation:
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index 2a11871..2072cfe 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -183,6 +183,10 @@
                       " and will install all packages built.  This is"
                       " useful when the test path has a lot of apks but you"
                       " only care about one.")
+    parser.add_option("--no-hidden-api-checks", dest="no_hidden_api_checks",
+                      default=False, action="store_true",
+                      help="Disable hidden API checks in instrumentation"
+                      " tests.")
     group = optparse.OptionGroup(
         parser, "Targets", "Use these options to direct tests to a specific "
         "Android target")
diff --git a/testrunner/test_defs/instrumentation_test.py b/testrunner/test_defs/instrumentation_test.py
index 979ba0b..5651d2e 100644
--- a/testrunner/test_defs/instrumentation_test.py
+++ b/testrunner/test_defs/instrumentation_test.py
@@ -155,7 +155,8 @@
             runner_name=self.GetRunnerName(),
             timeout_time=60*60,
             instrumentation_args=instrumentation_args,
-            user=options.user)
+            user=options.user,
+            no_hidden_api_checks=options.no_hidden_api_checks)
       except errors.InstrumentationError, errors.DeviceUnresponsiveError:
         return
       self._PrintTestResults(test_results)
@@ -172,12 +173,13 @@
 
     else:
       self._CheckInstrumentationInstalled(adb)
-      adb.StartInstrumentationNoResults(package_name=self.GetPackageName(),
-                                        runner_name=self.GetRunnerName(),
-                                        raw_mode=options.raw_mode,
-                                        instrumentation_args=
-                                        instrumentation_args,
-                                        user=options.user)
+      adb.StartInstrumentationNoResults(
+          package_name=self.GetPackageName(),
+          runner_name=self.GetRunnerName(),
+          raw_mode=options.raw_mode,
+          instrumentation_args=instrumentation_args,
+          user=options.user,
+          no_hidden_api_checks=options.no_hidden_api_checks)
 
   def _CheckInstrumentationInstalled(self, adb):
     if not adb.IsInstrumentationInstalled(self.GetPackageName(),
diff --git a/tools/compare_failed_tests/compare_failed_tests.py b/tools/compare_failed_tests/compare_failed_tests.py
new file mode 100755
index 0000000..c691c13
--- /dev/null
+++ b/tools/compare_failed_tests/compare_failed_tests.py
@@ -0,0 +1,208 @@
+#!/usr/bin/python
+"""Compare failed tests in CTS/VTS test_result.xml.
+
+Given two test_result.xml's (A and B), this script lists all failed tests in A,
+and shows result of the same test in B.
+"""
+
+import argparse
+import collections
+import csv
+import xml.etree.ElementTree as ET
+
+
+PASS = 'pass'
+FAIL = 'fail'
+NO_DATA = 'no_data'
+
+ATTRS_TO_SHOW = ['Result::Build.build_model',
+                 'Result::Build.build_id',
+                 'Result.suite_name',
+                 'Result.suite_plan',
+                 'Result.suite_build_number',
+                 'Result.start_display',
+                 'Result::Build.build_abis_32',
+                 'Result::Build.build_abis_64',]
+
+
+def parse_attrib_path(attrib_path):
+  first_dot = attrib_path.index('.')
+  tags = attrib_path[:first_dot].split('::')
+  attr_name = attrib_path[first_dot+1:]
+  return tags, attr_name
+
+
+def get_test_info(root):
+  """Get test info from test_result.xml."""
+
+  test_info = collections.OrderedDict()
+
+  for attrib_path in ATTRS_TO_SHOW:
+    tags, attr_name = parse_attrib_path(attrib_path)
+    node = root
+
+    while True:
+      tags = tags[1:]
+      if tags:
+        node = node.find(tags[0])
+      else:
+        break
+
+    test_info[attr_name] = node.attrib[attr_name]
+
+  return test_info
+
+
+def print_test_infos(test_result_a, test_result_b):
+  """Print test infomation of both results in table format."""
+
+  info_a = test_result_a['info']
+  info_b = test_result_b['info']
+
+  max_key_len = max([len(k) for k in info_a])
+  max_value_a_len = max([len(info_a[k]) for k in info_a])
+  max_value_b_len = max([len(info_b[k]) for k in info_b])
+  table_len = (max_key_len + 2 + max_value_a_len + 2 + max_value_b_len)
+
+  line_format = '{:{}}  {:{}}  {}'
+
+  print '=' * table_len
+
+  for key in info_a:
+    print line_format.format(key, max_key_len,
+                             info_a[key], max_value_a_len,
+                             info_b[key])
+
+  print '=' * table_len
+  print
+
+
+def get_result(test_result, module_name, testcase_name, test_name):
+  """Get result of specifc module, testcase and test name."""
+
+  modules = test_result['modules']
+  if module_name not in modules:
+    return NO_DATA
+
+  testcases = modules[module_name]
+  if testcase_name not in testcases:
+    return NO_DATA
+
+  tests = testcases[testcase_name]
+  if test_name not in tests:
+    return NO_DATA
+
+  return ', '.join([x + ': ' + y for x, y in tests[test_name].items()])
+
+
+def read_test_result_xml(test_result_path):
+  """Given the path to a test_result.xml, read that into a ordered dict."""
+
+  tree = ET.parse(test_result_path)
+  root = tree.getroot()
+
+  test_result = collections.OrderedDict()
+  test_result['info'] = get_test_info(root)
+
+  modules = collections.OrderedDict()
+  test_result['modules'] = modules
+
+  for module in root.iter('Module'):
+    abi = module.attrib['abi']
+
+    module_name = module.attrib['name']
+
+    if not module_name in modules:
+      modules[module_name] = collections.OrderedDict()
+
+    testcases = modules[module_name]
+
+    for testcase in module.iter('TestCase'):
+      testcase_name = testcase.attrib['name']
+
+      if not testcase_name in testcases:
+        testcases[testcase_name] = collections.OrderedDict()
+
+      tests = testcases[testcase_name]
+
+      for test in testcase.iter('Test'):
+        test_name = test.attrib['name']
+
+        if not test_name in tests:
+          tests[test_name] = collections.OrderedDict()
+
+        if abi in tests[test_name]:
+          print '[WARNING] duplicated test:', test_name
+
+        tests[test_name][abi] = test.attrib['result']
+
+  return test_result
+
+
+def compare_failed_tests(test_result_a, test_result_b, csvfile):
+  """Do the comparison.
+
+  Given two test result dicts (A and B), list all failed test in A and display
+  result of the same test in B.
+
+  Args:
+    test_result_a: the dict returned from read_test_result(test_result_a.xml)
+    test_result_b: the dict returned from read_test_result(test_result_b.xml)
+    csvfile: a opened file
+
+  Returns:
+    string: diff report, summary
+  """
+
+  writer = csv.writer(csvfile)
+  writer.writerow(['module', 'testcase', 'test', 'result in B'])
+
+  summary = ''
+
+  modules = test_result_a['modules']
+
+  for module_name, testcases in modules.iteritems():
+    module_sub_summary = ''
+
+    for testcase_name, tests in testcases.iteritems():
+      testcase_sub_summary = ''
+
+      for test_name, result in tests.iteritems():
+        if FAIL in result.values():
+          result_b = get_result(
+              test_result_b, module_name, testcase_name, test_name)
+
+          testcase_sub_summary += '    ' + test_name + ': ' + result_b + '\n'
+          writer.writerow([module_name, testcase_name, test_name, result_b])
+
+      if testcase_sub_summary:
+        module_sub_summary = '  ' + testcase_name + '\n' + testcase_sub_summary
+
+    if module_sub_summary:
+      summary += module_name + '\n' + module_sub_summary + '\n'
+
+  return summary
+
+
+def main():
+  parser = argparse.ArgumentParser()
+
+  parser.add_argument('test_result_a', help='path to first test_result.xml')
+  parser.add_argument('test_result_b', help='path to second test_result.xml')
+  parser.add_argument('--csv', default='diff.csv', help='path to csv output')
+
+  args = parser.parse_args()
+
+  test_result_a = read_test_result_xml(args.test_result_a)
+  test_result_b = read_test_result_xml(args.test_result_b)
+
+  print_test_infos(test_result_a, test_result_b)
+
+  with open(args.csv, 'w') as csvfile:
+    summary = compare_failed_tests(test_result_a, test_result_b, csvfile)
+
+    print summary
+
+
+if __name__ == '__main__':
+  main()
diff --git a/tools/core_connectivity/check_style.sh b/tools/core_connectivity/check_style.sh
new file mode 100755
index 0000000..38761fb
--- /dev/null
+++ b/tools/core_connectivity/check_style.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+#VERSION=1
+
+SELFNAME=$0
+
+function printUsage() {
+    echo "  $SELFNAME             check coding style for HEAD in this git repository"
+    echo "  $SELFNAME -h          show this message"
+}
+
+function main() {
+    test "$1" == "-h" && printUsage && exit
+    test "$ANDROID_BUILD_TOP" == "" && echo "please run env setup" && exit
+    GITROOTDIR=`git rev-parse --show-toplevel`
+    test "$GITROOTDIR" == "" && echo "not inside a git repository" && exit
+    MODIFIED=`git status -s --untracked-files=no | wc -l`
+    test $MODIFIED -ne 0 && echo "please commit first" && exit
+
+    cd $GITROOTDIR
+
+    #basic check
+    local PARAMS=" --config_xml $ANDROID_BUILD_TOP/prebuilts/checkstyle/android-style.xml"
+    $ANDROID_BUILD_TOP/prebuilts/checkstyle/checkstyle.py $PARAMS
+
+    #C++ check, no-op if no C, C++ files.
+    $ANDROID_BUILD_TOP/prebuilts/clang/host/linux-x86/clang-stable/bin/git-clang-format \
+            --commit HEAD^ --style file --extensions c,h,cc,cpp
+
+    #commit message equal or less then 65 char for each line (suggested by lorenzo@20180625)
+    local MSG=`git rev-list --format=%B --max-count=1 HEAD`
+    local i=1
+    while read -r line; do
+        test `echo $line | wc -c` -gt 65 && echo "FAILED: Line $i exceed 65 chars limit: $line"
+        i=$((i+1))
+    done < <(echo "$MSG")
+
+    cd -
+}
+
+main $*
diff --git a/tools/ops/android_test_parser.py b/tools/ops/android_test_parser.py
new file mode 100644
index 0000000..485f25f
--- /dev/null
+++ b/tools/ops/android_test_parser.py
@@ -0,0 +1,98 @@
+import os
+import json
+import xml.etree.ElementTree as ET
+import sys
+
+
+STATIC_FILENAME = "tmp.xml"
+KNOWN_FAILING_FILENAME = "known_failing_names.txt"
+
+
+class FileDownloader(object):
+
+  def __init__(self, file_url):
+    self.file_url = file_url
+
+  def __enter__(self):
+    os.system("wget -O %s %s" % (STATIC_FILENAME, self.file_url))
+    os.system("touch %s" % KNOWN_FAILING_FILENAME)
+
+  def __exit__(self, *args):
+    os.system("rm %s" % STATIC_FILENAME)
+
+
+class TestCase(object):
+
+  def __init__(self, xml_test):
+    self._xml_test = xml_test
+
+  @property
+  def name(self):
+    return self._xml_test.get("name")
+
+  @property
+  def passed(self):
+    return self._xml_test.get("result") == "pass"
+
+  def __repr__(self):
+    return "%s: %s" % (self.name, self.passed)
+
+
+def generate_tests_from_file(fname):
+  tree = ET.parse(fname)
+  result = tree.getroot()
+  for module in result:
+    for test_case in module:
+      for test in test_case:
+        yield TestCase(test)
+
+
+def get_failing_tests(fname):
+  return filter(
+    lambda test: not test.passed,
+    generate_tests_from_file(fname),
+  )
+
+
+def get_failing_test_names(fname):
+  return map(
+    lambda test: test.name,
+    get_failing_tests(fname),
+  )
+
+
+def get_known_failing_names():
+  try:
+    with open(KNOWN_FAILING_FILENAME, "rb") as f:
+      return [line for line in f.read().splitlines() if line]
+  except IOError:
+    return []
+
+
+def new_test_failures(failing_test_names, known_failing_test_names):
+  return sorted(
+    list(
+      set(failing_test_names) - set(known_failing_test_names),
+    ),
+  )
+
+
+if __name__ == "__main__":
+  print "Any known test failures can be added to %s as a new line" % KNOWN_FAILING_FILENAME
+  try:
+    input_test_url = sys.argv[1]
+  except IndexError:
+    print "Supply *result_*.xml URL from a build from https://partner.android.com/"
+    sys.exit(1)
+
+  with FileDownloader(input_test_url):
+    print "Current failing tests"
+    print json.dumps(
+      sorted(
+        new_test_failures(
+          get_failing_test_names(STATIC_FILENAME),
+          get_known_failing_names(),
+        ),
+      ),
+      indent=4,
+    )
diff --git a/tools/repo_diff/git_commits_not_upstreamed.py b/tools/repo_diff/git_commits_not_upstreamed.py
index 30e798b..7111689 100644
--- a/tools/repo_diff/git_commits_not_upstreamed.py
+++ b/tools/repo_diff/git_commits_not_upstreamed.py
@@ -100,26 +100,11 @@
     A set of downstream commits missing upstream.
   """
 
-  commits_not_upstreamed = set()
   revlist_output = git(['-C', working_dir, 'rev-list', '--no-merges',
                         '%s..%s' % (upstream, downstream)])
   downstream_only_commits = set(revlist_output.splitlines())
-  insertion_commits = set()
-
-  # If there are no downstream-only commits there's no point in
-  # futher filtering
-  if downstream_only_commits:
-    insertion_commits = find_insertion_commits(upstream, downstream,
-                                               working_dir)
-
-  # The commits that are only downstream and are visible in 'git blame' are the
-  # ones that insert lines in the diff between upstream and downstream.
-  commits_not_upstreamed.update(
-      downstream_only_commits.intersection(insertion_commits))
-
-  # TODO(diegowilson) add commits that deleted lines
-
-  return commits_not_upstreamed
+  # TODO(slobdell b/78283222) resolve commits not upstreamed that are purely reverts
+  return downstream_only_commits
 
 
 def main():
diff --git a/tools/repo_pull/README.md b/tools/repo_pull/README.md
new file mode 100644
index 0000000..c4723ea
--- /dev/null
+++ b/tools/repo_pull/README.md
@@ -0,0 +1,123 @@
+Repo Pull
+=========
+
+`repo_pull.py` pulls multiple change lists from a Gerrit code review website.
+A user may specify a query string and `repo_pull.py` will pull the matching
+change lists.
+
+For example, to pull the `repo-pull-initial-cl` topic from AOSP, run this
+command:
+
+    repo_pull.py pull 'topic:repo-pull-initial-cl' \
+        -g https://android-review.googlesource.com
+
+Read [Usage](#Usages) and [Examples](#Examples) for more details.
+
+
+## Installation
+
+`repo_pull.py` requires `.gitcookies` to access Gerrit APIs.  Please
+check whether the Gerrit Code Review URL is in `~/.gitcookies`.
+
+If you don't have an entry, follow these steps:
+
+1. Visit the [Gerrit Code Review](https://android-review.googlesource.com).
+
+2. Click [Settings -> HTTP Credentials](https://android-review.googlesource.com/settings/#HTTPCredentials)
+
+3. Click **Obtain password**
+
+4. Copy the highlighted shell commands and paste them in a terminal.
+
+Note: You must repeat these for each Gerrit Code Review websites.
+
+
+## Usages
+
+Command line usages:
+
+    $ repo_pull.py [sub-command] [query] \
+                   [-g gerrit] \
+                   [-b local-topic-branch] \
+                   [-j num-threads] \
+                   [--limits max-num-changes]
+
+
+Three sub-commands are supported:
+
+* `repo_pull.py json` prints the change lists in the JSON file format.
+
+* `repo_pull.py bash` prints the *bash commands* that can pull the change lists.
+
+* `repo_pull.py pull` *pulls the change lists* immediately.
+
+
+### Query String
+
+`[query]` is the query string that can be entered to the Gerrit search box.
+
+These are common queries:
+
+* `topic:name`
+* `hashtag:name`
+* `branch:name`
+* `project:name`
+* `owner:name`
+* `is:open` | `is:merged` | `is:abandoned`
+* `message:text`
+
+
+### Options
+
+* `-g` or `--gerrit` specifies the URL of the Gerrit Code Review website.
+  *(required)*
+
+* `-b` or `--branch` specifies the local branch name that will be passed to
+  `repo start`.
+
+* `-j` or `--parallel` specifies the number of parallel threads while pulling
+  change lists.
+
+* `-n` or `--limits` specifies the maximum number of change lists.  (default:
+  1000)
+
+* `-m` or `--merge` specifies the method to pick the merge commits.  (default:
+  `merge-ff-only`)
+
+* `-p` or `--pick` specifies the method to pick the non-merge commits.
+  (default: `pick`)
+
+  * `pick` maps to `git cherry-pick --allow-empty`
+  * `merge` maps to `git merge --no-edit`
+  * `merge-ff-only` maps to `git merge --no-edit --ff-only`
+  * `merge-no-ff` maps to `git merge --no-edit --no-ff`
+  * `reset` maps to `git reset --hard`
+  * `checkout` maps to `git checkout`
+
+
+## Examples
+
+To print the change lists with the topic `repo-pull-initial-cl` in JSON file
+format:
+
+```
+repo_pull.py json 'topic:repo-pull-initial-cl' \
+    -g https://android-review.googlesource.com
+```
+
+To print the bash commands that can pull the change lists, use the `bash`
+command:
+
+```
+repo_pull.py bash 'topic:repo-pull-initial-cl' \
+    -g https://android-review.googlesource.com \
+    -b my-local-topic-branch
+```
+
+To pull the change lists immediately, use the `pull` command:
+
+```
+repo_pull.py pull 'topic:repo-pull-initial-cl' \
+    -g https://android-review.googlesource.com \
+    -b my-local-topic-branch
+```
diff --git a/tools/repo_pull/gerrit.py b/tools/repo_pull/gerrit.py
new file mode 100755
index 0000000..063b351
--- /dev/null
+++ b/tools/repo_pull/gerrit.py
@@ -0,0 +1,265 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""Gerrit Restful API client library."""
+
+from __future__ import print_function
+
+import argparse
+import base64
+import json
+import os
+import sys
+
+try:
+    from urllib.request import (
+        HTTPBasicAuthHandler, Request, build_opener)  # PY3
+except ImportError:
+    from urllib2 import (
+        HTTPBasicAuthHandler, Request, build_opener)  # PY2
+
+try:
+    # pylint: disable=ungrouped-imports
+    from urllib.parse import urlencode, urlparse  # PY3
+except ImportError:
+    # pylint: disable=ungrouped-imports
+    from urllib import urlencode  # PY2
+    from urlparse import urlparse  # PY2
+
+
+def load_auth_credentials_from_file(cookie_file):
+    """Load credentials from an opened .gitcookies file."""
+    credentials = {}
+    for line in cookie_file:
+        if line.startswith('#HttpOnly_'):
+            line = line[len('#HttpOnly_'):]
+
+        if not line or line[0] == '#':
+            continue
+
+        row = line.split('\t')
+        if len(row) != 7:
+            continue
+
+        domain = row[0]
+        cookie = row[6]
+
+        sep = cookie.find('=')
+        if sep == -1:
+            continue
+        username = cookie[0:sep]
+        password = cookie[sep + 1:]
+
+        credentials[domain] = (username, password)
+    return credentials
+
+
+def load_auth_credentials(cookie_file_path):
+    """Load credentials from a .gitcookies file path."""
+    with open(cookie_file_path, 'r') as cookie_file:
+        return load_auth_credentials_from_file(cookie_file)
+
+
+def create_url_opener(cookie_file_path, domain):
+    """Load username and password from .gitcookies and return a URL opener with
+    an authentication handler."""
+
+    # Load authentication credentials
+    credentials = load_auth_credentials(cookie_file_path)
+    username, password = credentials[domain]
+
+    # Create URL opener with authentication handler
+    auth_handler = HTTPBasicAuthHandler()
+    auth_handler.add_password(domain, domain, username, password)
+    return build_opener(auth_handler)
+
+
+def create_url_opener_from_args(args):
+    """Create URL opener from command line arguments."""
+
+    domain = urlparse(args.gerrit).netloc
+
+    try:
+        return create_url_opener(args.gitcookies, domain)
+    except KeyError:
+        print('error: Cannot find the domain "{}" in "{}". '
+              .format(domain, args.gitcookies), file=sys.stderr)
+        print('error: Please check the Gerrit Code Review URL or follow the '
+              'instructions in '
+              'https://android.googlesource.com/platform/development/'
+              '+/master/tools/repo_pull#installation', file=sys.stderr)
+        sys.exit(1)
+
+
+def _decode_xssi_json(data):
+    """Trim XSSI protector and decode JSON objects."""
+
+    # Decode UTF-8
+    data = data.decode('utf-8')
+
+    # Trim cross site script inclusion (XSSI) protector
+    if data[0:4] != ')]}\'':
+        raise ValueError('unexpected responsed content: ' + data)
+    data = data[4:]
+
+    # Parse JSON objects
+    return json.loads(data)
+
+
+def query_change_lists(url_opener, gerrit, query_string, limits):
+    """Query change lists."""
+    data = [
+        ('q', query_string),
+        ('o', 'CURRENT_REVISION'),
+        ('o', 'CURRENT_COMMIT'),
+        ('n', str(limits)),
+    ]
+    url = gerrit + '/a/changes/?' + urlencode(data)
+
+    response_file = url_opener.open(url)
+    try:
+        return _decode_xssi_json(response_file.read())
+    finally:
+        response_file.close()
+
+
+def _make_json_post_request(url_opener, url, data, method='POST'):
+    data = json.dumps(data).encode('utf-8')
+    headers = {
+        'Content-Type': 'application/json; charset=UTF-8',
+    }
+
+    request = Request(url, data, headers)
+    request.get_method = lambda: method
+    response_file = url_opener.open(request)
+    try:
+        res_code = response_file.getcode()
+        res_json = _decode_xssi_json(response_file.read())
+        return (res_code, res_json)
+    finally:
+        response_file.close()
+
+
+def set_review(url_opener, gerrit_url, change_id, labels, message):
+    """Set review votes to a change list."""
+
+    url = '{}/a/changes/{}/revisions/current/review'.format(
+        gerrit_url, change_id)
+
+    data = {}
+    if labels:
+        data['labels'] = labels
+    if message:
+        data['message'] = message
+
+    return _make_json_post_request(url_opener, url, data)
+
+
+def abandon(url_opener, gerrit_url, change_id, message):
+    """Abandon a change list."""
+
+    url = '{}/a/changes/{}/abandon'.format(gerrit_url, change_id)
+
+    data = {}
+    if message:
+        data['message'] = message
+
+    return _make_json_post_request(url_opener, url, data)
+
+
+def set_topic(url_opener, gerrit_url, change_id, name):
+    """Set the topic name."""
+
+    url = '{}/a/changes/{}/topic'.format(gerrit_url, change_id)
+    data = {'topic': name}
+    return _make_json_post_request(url_opener, url, data, method='PUT')
+
+
+def delete_topic(url_opener, gerrit_url, change_id):
+    """Delete the topic name."""
+
+    url = '{}/a/changes/{}/topic'.format(gerrit_url, change_id)
+    request = Request(url)
+    request.get_method = lambda: 'DELETE'
+    response_file = url_opener.open(request)
+    try:
+        return (response_file.getcode(), response_file.read())
+    finally:
+        response_file.close()
+
+
+def set_hashtags(url_opener, gerrit_url, change_id, add_tags=None,
+                 remove_tags=None):
+    """Add or remove hash tags."""
+
+    url = '{}/a/changes/{}/hashtags'.format(gerrit_url, change_id)
+
+    data = {}
+    if add_tags:
+        data['add'] = add_tags
+    if remove_tags:
+        data['remove'] = remove_tags
+
+    return _make_json_post_request(url_opener, url, data)
+
+
+def get_patch(url_opener, gerrit_url, change_id, revision_id='current'):
+    """Download the patch file."""
+
+    url = '{}/a/changes/{}/revisions/{}/patch'.format(
+        gerrit_url, change_id, revision_id)
+
+    response_file = url_opener.open(url)
+    try:
+        return base64.b64decode(response_file.read())
+    finally:
+        response_file.close()
+
+
+def _parse_args():
+    """Parse command line options."""
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('query', help='Change list query string')
+    parser.add_argument('-g', '--gerrit', required=True,
+                        help='Gerrit review URL')
+
+    parser.add_argument('--gitcookies',
+                        default=os.path.expanduser('~/.gitcookies'),
+                        help='Gerrit cookie file')
+    parser.add_argument('--limits', default=1000,
+                        help='Max number of change lists')
+
+    return parser.parse_args()
+
+
+def main():
+    """Main function"""
+    args = _parse_args()
+
+    # Query change lists
+    url_opener = create_url_opener_from_args(args)
+    change_lists = query_change_lists(
+        url_opener, args.gerrit, args.query, args.limits)
+
+    # Print the result
+    json.dump(change_lists, sys.stdout, indent=4, separators=(', ', ': '))
+    print()  # Print the end-of-line
+
+if __name__ == '__main__':
+    main()
diff --git a/tools/repo_pull/repo_patch.py b/tools/repo_pull/repo_patch.py
new file mode 100755
index 0000000..3938706
--- /dev/null
+++ b/tools/repo_pull/repo_patch.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""A command line utility to download multiple patch files of change lists from
+Gerrit."""
+
+from __future__ import print_function
+
+import argparse
+import os
+
+from gerrit import create_url_opener_from_args, query_change_lists, get_patch
+
+
+def _parse_args():
+    """Parse command line options."""
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('query', help='Change list query string')
+    parser.add_argument('-g', '--gerrit', required=True,
+                        help='Gerrit review URL')
+
+    parser.add_argument('--gitcookies',
+                        default=os.path.expanduser('~/.gitcookies'),
+                        help='Gerrit cookie file')
+    parser.add_argument('--limits', default=1000,
+                        help='Max number of change lists')
+
+    return parser.parse_args()
+
+
+def main():
+    """Main function"""
+    args = _parse_args()
+
+    # Query change lists
+    url_opener = create_url_opener_from_args(args)
+    change_lists = query_change_lists(
+        url_opener, args.gerrit, args.query, args.limits)
+
+    # Download patch files
+    num_changes = len(change_lists)
+    num_changes_width = len(str(num_changes))
+    for i, change in enumerate(change_lists, start=1):
+        print('{:>{}}/{} | {} {}'.format(
+            i, num_changes_width, num_changes, change['_number'],
+            change['subject']))
+
+        patch_file = get_patch(url_opener, args.gerrit, change['id'])
+        with open('{}.patch'.format(change['_number']), 'wb') as output_file:
+            output_file.write(patch_file)
+
+if __name__ == '__main__':
+    main()
diff --git a/tools/repo_pull/repo_pull.py b/tools/repo_pull/repo_pull.py
new file mode 100755
index 0000000..79b94c5
--- /dev/null
+++ b/tools/repo_pull/repo_pull.py
@@ -0,0 +1,467 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""A command line utility to pull multiple change lists from Gerrit."""
+
+from __future__ import print_function
+
+import argparse
+import collections
+import itertools
+import json
+import multiprocessing
+import os
+import re
+import sys
+import xml.dom.minidom
+
+from gerrit import create_url_opener_from_args, query_change_lists
+
+try:
+    # pylint: disable=redefined-builtin
+    from __builtin__ import raw_input as input  # PY2
+except ImportError:
+    pass
+
+try:
+    from shlex import quote as _sh_quote  # PY3.3
+except ImportError:
+    # Shell language simple string pattern.  If a string matches this pattern,
+    # it doesn't have to be quoted.
+    _SHELL_SIMPLE_PATTERN = re.compile('^[a-zA-Z90-9_./-]+$')
+
+    def _sh_quote(txt):
+        """Quote a string if it contains special characters."""
+        return txt if _SHELL_SIMPLE_PATTERN.match(txt) else json.dumps(txt)
+
+try:
+    from subprocess import PIPE, run  # PY3.5
+except ImportError:
+    from subprocess import CalledProcessError, PIPE, Popen
+
+    class CompletedProcess(object):
+        """Process execution result returned by subprocess.run()."""
+        # pylint: disable=too-few-public-methods
+
+        def __init__(self, args, returncode, stdout, stderr):
+            self.args = args
+            self.returncode = returncode
+            self.stdout = stdout
+            self.stderr = stderr
+
+    def run(*args, **kwargs):
+        """Run a command with subprocess.Popen() and redirect input/output."""
+
+        check = kwargs.pop('check', False)
+
+        try:
+            stdin = kwargs.pop('input')
+            assert 'stdin' not in kwargs
+            kwargs['stdin'] = PIPE
+        except KeyError:
+            stdin = None
+
+        proc = Popen(*args, **kwargs)
+        try:
+            stdout, stderr = proc.communicate(stdin)
+        except:
+            proc.kill()
+            proc.wait()
+            raise
+        returncode = proc.wait()
+
+        if check and returncode:
+            raise CalledProcessError(returncode, args, stdout)
+        return CompletedProcess(args, returncode, stdout, stderr)
+
+
+if bytes is str:
+    def write_bytes(data, file):  # PY2
+        """Write bytes to a file."""
+        # pylint: disable=redefined-builtin
+        file.write(data)
+else:
+    def write_bytes(data, file):  # PY3
+        """Write bytes to a file."""
+        # pylint: disable=redefined-builtin
+        file.buffer.write(data)
+
+
+def _confirm(question, default, file=sys.stderr):
+    """Prompt a yes/no question and convert the answer to a boolean value."""
+    # pylint: disable=redefined-builtin
+    answers = {'': default, 'y': True, 'yes': True, 'n': False, 'no': False}
+    suffix = '[Y/n] ' if default else ' [y/N] '
+    while True:
+        file.write(question + suffix)
+        file.flush()
+        ans = answers.get(input().lower())
+        if ans is not None:
+            return ans
+
+
+class ChangeList(object):
+    """A ChangeList to be checked out."""
+    # pylint: disable=too-few-public-methods,too-many-instance-attributes
+
+    def __init__(self, project, fetch, commit_sha1, commit, change_list):
+        """Initialize a ChangeList instance."""
+        # pylint: disable=too-many-arguments
+
+        self.project = project
+        self.number = change_list['_number']
+
+        self.fetch = fetch
+
+        fetch_git = None
+        for protocol in ('http', 'sso', 'rpc'):
+            fetch_git = fetch.get(protocol)
+            if fetch_git:
+                break
+
+        if not fetch_git:
+            raise ValueError(
+                'unknown fetch protocols: ' + str(list(fetch.keys())))
+
+        self.fetch_url = fetch_git['url']
+        self.fetch_ref = fetch_git['ref']
+
+        self.commit_sha1 = commit_sha1
+        self.commit = commit
+        self.parents = commit['parents']
+
+        self.change_list = change_list
+
+
+    def is_merge(self):
+        """Check whether this change list a merge commit."""
+        return len(self.parents) > 1
+
+
+def find_manifest_xml(dir_path):
+    """Find the path to manifest.xml for this Android source tree."""
+    dir_path_prev = None
+    while dir_path != dir_path_prev:
+        path = os.path.join(dir_path, '.repo', 'manifest.xml')
+        if os.path.exists(path):
+            return path
+        dir_path_prev = dir_path
+        dir_path = os.path.dirname(dir_path)
+    raise ValueError('.repo dir not found')
+
+
+def build_project_name_dir_dict(manifest_path):
+    """Build the mapping from Gerrit project name to source tree project
+    directory path."""
+    project_dirs = {}
+    parsed_xml = xml.dom.minidom.parse(manifest_path)
+    projects = parsed_xml.getElementsByTagName('project')
+    for project in projects:
+        name = project.getAttribute('name')
+        path = project.getAttribute('path')
+        if path:
+            project_dirs[name] = path
+        else:
+            project_dirs[name] = name
+    return project_dirs
+
+
+def group_and_sort_change_lists(change_lists):
+    """Build a dict that maps projects to a list of topologically sorted change
+    lists."""
+
+    # Build a dict that map projects to dicts that map commits to changes.
+    projects = collections.defaultdict(dict)
+    for change_list in change_lists:
+        commit_sha1 = None
+        for commit_sha1, value in change_list['revisions'].items():
+            fetch = value['fetch']
+            commit = value['commit']
+
+        if not commit_sha1:
+            raise ValueError('bad revision')
+
+        project = change_list['project']
+
+        project_changes = projects[project]
+        if commit_sha1 in project_changes:
+            raise KeyError('repeated commit sha1 "{}" in project "{}"'.format(
+                commit_sha1, project))
+
+        project_changes[commit_sha1] = ChangeList(
+            project, fetch, commit_sha1, commit, change_list)
+
+    # Sort all change lists in a project in post ordering.
+    def _sort_project_change_lists(changes):
+        visited_changes = set()
+        sorted_changes = []
+
+        def _post_order_traverse(change):
+            visited_changes.add(change)
+            for parent in change.parents:
+                parent_change = changes.get(parent['commit'])
+                if parent_change and parent_change not in visited_changes:
+                    _post_order_traverse(parent_change)
+            sorted_changes.append(change)
+
+        for change in sorted(changes.values(), key=lambda x: x.number):
+            if change not in visited_changes:
+                _post_order_traverse(change)
+
+        return sorted_changes
+
+    # Sort changes in each projects
+    sorted_changes = []
+    for project in sorted(projects.keys()):
+        sorted_changes.append(_sort_project_change_lists(projects[project]))
+
+    return sorted_changes
+
+
+def _main_json(args):
+    """Print the change lists in JSON format."""
+    change_lists = _get_change_lists_from_args(args)
+    json.dump(change_lists, sys.stdout, indent=4, separators=(', ', ': '))
+    print()  # Print the end-of-line
+
+
+# Git commands for merge commits
+_MERGE_COMMANDS = {
+    'merge': ['git', 'merge', '--no-edit'],
+    'merge-ff-only': ['git', 'merge', '--no-edit', '--ff-only'],
+    'merge-no-ff': ['git', 'merge', '--no-edit', '--no-ff'],
+    'reset': ['git', 'reset', '--hard'],
+    'checkout': ['git', 'checkout'],
+}
+
+
+# Git commands for non-merge commits
+_PICK_COMMANDS = {
+    'pick': ['git', 'cherry-pick', '--allow-empty'],
+    'merge': ['git', 'merge', '--no-edit'],
+    'merge-ff-only': ['git', 'merge', '--no-edit', '--ff-only'],
+    'merge-no-ff': ['git', 'merge', '--no-edit', '--no-ff'],
+    'reset': ['git', 'reset', '--hard'],
+    'checkout': ['git', 'checkout'],
+}
+
+
+def build_pull_commands(change, branch_name, merge_opt, pick_opt):
+    """Build command lines for each change.  The command lines will be passed
+    to subprocess.run()."""
+
+    cmds = []
+    if branch_name is not None:
+        cmds.append(['repo', 'start', branch_name])
+    cmds.append(['git', 'fetch', change.fetch_url, change.fetch_ref])
+    if change.is_merge():
+        cmds.append(_MERGE_COMMANDS[merge_opt] + ['FETCH_HEAD'])
+    else:
+        cmds.append(_PICK_COMMANDS[pick_opt] + ['FETCH_HEAD'])
+    return cmds
+
+
+def _sh_quote_command(cmd):
+    """Convert a command (an argument to subprocess.run()) to a shell command
+    string."""
+    return ' '.join(_sh_quote(x) for x in cmd)
+
+
+def _sh_quote_commands(cmds):
+    """Convert multiple commands (arguments to subprocess.run()) to shell
+    command strings."""
+    return ' && '.join(_sh_quote_command(cmd) for cmd in cmds)
+
+
+def _main_bash(args):
+    """Print the bash command to pull the change lists."""
+
+    branch_name = _get_local_branch_name_from_args(args)
+
+    manifest_path = _get_manifest_xml_from_args(args)
+    project_dirs = build_project_name_dir_dict(manifest_path)
+
+    change_lists = _get_change_lists_from_args(args)
+    change_list_groups = group_and_sort_change_lists(change_lists)
+
+    for changes in change_list_groups:
+        for change in changes:
+            project_dir = project_dirs.get(change.project, change.project)
+            cmds = []
+            cmds.append(['pushd', project_dir])
+            cmds.extend(build_pull_commands(
+                change, branch_name, args.merge, args.pick))
+            cmds.append(['popd'])
+            print(_sh_quote_commands(cmds))
+
+
+def _do_pull_change_lists_for_project(task):
+    """Pick a list of changes (usually under a project directory)."""
+    changes, task_opts = task
+
+    branch_name = task_opts['branch_name']
+    merge_opt = task_opts['merge_opt']
+    pick_opt = task_opts['pick_opt']
+    project_dirs = task_opts['project_dirs']
+
+    for i, change in enumerate(changes):
+        try:
+            cwd = project_dirs[change.project]
+        except KeyError:
+            err_msg = 'error: project "{}" cannot be found in manifest.xml\n'
+            err_msg = err_msg.format(change.project).encode('utf-8')
+            return (change, changes[i + 1:], [], err_msg)
+
+        print(change.commit_sha1[0:10], i + 1, cwd)
+        cmds = build_pull_commands(change, branch_name, merge_opt, pick_opt)
+        for cmd in cmds:
+            proc = run(cmd, cwd=cwd, stderr=PIPE)
+            if proc.returncode != 0:
+                return (change, changes[i + 1:], cmd, proc.stderr)
+    return None
+
+
+def _print_pull_failures(failures, file=sys.stderr):
+    """Print pull failures and tracebacks."""
+    # pylint: disable=redefined-builtin
+
+    separator = '=' * 78
+    separator_sub = '-' * 78
+
+    print(separator, file=file)
+    for failed_change, skipped_changes, cmd, errors in failures:
+        print('PROJECT:', failed_change.project, file=file)
+        print('FAILED COMMIT:', failed_change.commit_sha1, file=file)
+        for change in skipped_changes:
+            print('PENDING COMMIT:', change.commit_sha1, file=file)
+        print(separator_sub, file=sys.stderr)
+        print('FAILED COMMAND:', _sh_quote_command(cmd), file=file)
+        write_bytes(errors, file=sys.stderr)
+        print(separator, file=sys.stderr)
+
+
+def _main_pull(args):
+    """Pull the change lists."""
+
+    branch_name = _get_local_branch_name_from_args(args)
+
+    manifest_path = _get_manifest_xml_from_args(args)
+    project_dirs = build_project_name_dir_dict(manifest_path)
+
+    # Collect change lists
+    change_lists = _get_change_lists_from_args(args)
+    change_list_groups = group_and_sort_change_lists(change_lists)
+
+    # Build the options list for tasks
+    task_opts = {
+        'branch_name': branch_name,
+        'merge_opt': args.merge,
+        'pick_opt': args.pick,
+        'project_dirs': project_dirs,
+    }
+
+    # Run the commands to pull the change lists
+    if args.parallel <= 1:
+        results = [_do_pull_change_lists_for_project((changes, task_opts))
+                   for changes in change_list_groups]
+    else:
+        pool = multiprocessing.Pool(processes=args.parallel)
+        results = pool.map(_do_pull_change_lists_for_project,
+                           zip(change_list_groups, itertools.repeat(task_opts)))
+
+    # Print failures and tracebacks
+    failures = [result for result in results if result]
+    if failures:
+        _print_pull_failures(failures)
+        sys.exit(1)
+
+
+def _parse_args():
+    """Parse command line options."""
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('command', choices=['pull', 'bash', 'json'],
+                        help='Commands')
+
+    parser.add_argument('query', help='Change list query string')
+    parser.add_argument('-g', '--gerrit', required=True,
+                        help='Gerrit review URL')
+
+    parser.add_argument('--gitcookies',
+                        default=os.path.expanduser('~/.gitcookies'),
+                        help='Gerrit cookie file')
+    parser.add_argument('--manifest', help='Manifest')
+    parser.add_argument('--limits', default=1000,
+                        help='Max number of change lists')
+
+    parser.add_argument('-m', '--merge',
+                        choices=sorted(_MERGE_COMMANDS.keys()),
+                        default='merge-ff-only',
+                        help='Method to pull merge commits')
+
+    parser.add_argument('-p', '--pick',
+                        choices=sorted(_PICK_COMMANDS.keys()),
+                        default='pick',
+                        help='Method to pull merge commits')
+
+    parser.add_argument('-b', '--branch',
+                        help='Local branch name for `repo start`')
+
+    parser.add_argument('-j', '--parallel', default=1, type=int,
+                        help='Number of parallel running commands')
+
+    return parser.parse_args()
+
+
+def _get_manifest_xml_from_args(args):
+    """Get the path to manifest.xml from args."""
+    manifest_path = args.manifest
+    if not args.manifest:
+        manifest_path = find_manifest_xml(os.getcwd())
+    return manifest_path
+
+
+def _get_change_lists_from_args(args):
+    """Query the change lists by args."""
+    url_opener = create_url_opener_from_args(args)
+    return query_change_lists(url_opener, args.gerrit, args.query, args.limits)
+
+
+def _get_local_branch_name_from_args(args):
+    """Get the local branch name from args."""
+    if not args.branch and not _confirm(
+            'Do you want to continue without local branch name?', False):
+        print('error: `-b` or `--branch` must be specified', file=sys.stderr)
+        sys.exit(1)
+    return args.branch
+
+
+def main():
+    """Main function"""
+    args = _parse_args()
+    if args.command == 'json':
+        _main_json(args)
+    elif args.command == 'bash':
+        _main_bash(args)
+    elif args.command == 'pull':
+        _main_pull(args)
+    else:
+        raise KeyError('unknown command')
+
+if __name__ == '__main__':
+    main()
diff --git a/tools/repo_pull/repo_review.py b/tools/repo_pull/repo_review.py
new file mode 100755
index 0000000..2279e4b
--- /dev/null
+++ b/tools/repo_pull/repo_review.py
@@ -0,0 +1,229 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""A command line utility to post review votes to multiple CLs on Gerrit."""
+
+from __future__ import print_function
+
+import argparse
+import json
+import os
+import sys
+
+try:
+    from urllib.error import HTTPError  # PY3
+except ImportError:
+    from urllib2 import HTTPError  # PY2
+
+from gerrit import (
+    abandon, create_url_opener_from_args, delete_topic, query_change_lists,
+    set_hashtags, set_review, set_topic)
+
+
+def _get_labels_from_args(args):
+    """Collect and check labels from args."""
+    if not args.label:
+        return None
+    labels = {}
+    for (name, value) in args.label:
+        try:
+            labels[name] = int(value)
+        except ValueError:
+            print('error: Label {} takes integer, but {} is specified'
+                  .format(name, value), file=sys.stderr)
+    return labels
+
+
+# pylint: disable=redefined-builtin
+def _print_change_lists(change_lists, file=sys.stdout):
+    """Print matching change lists for each projects."""
+    change_lists = sorted(
+        change_lists, key=lambda change: (change['project'], change['_number']))
+
+    prev_project = None
+    print('Change Lists:', file=file)
+    for change in change_lists:
+        project = change['project']
+        if project != prev_project:
+            print(' ', project, file=file)
+            prev_project = project
+
+        change_id = change['change_id']
+        revision_sha1 = change['current_revision']
+        revision = change['revisions'][revision_sha1]
+        subject = revision['commit']['subject']
+        print('   ', change_id, '--', subject, file=file)
+
+
+def _confirm(question):
+    """Confirm before proceeding."""
+    try:
+        if input(question + ' [yn] ').lower() not in {'y', 'yes'}:
+            print('Cancelled', file=sys.stderr)
+            sys.exit(1)
+    except KeyboardInterrupt:
+        print('Cancelled', file=sys.stderr)
+        sys.exit(1)
+
+
+def _parse_args():
+    """Parse command line options."""
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('query', help='Change list query string')
+    parser.add_argument('-g', '--gerrit', required=True,
+                        help='Gerrit review URL')
+
+    parser.add_argument('--gitcookies',
+                        default=os.path.expanduser('~/.gitcookies'),
+                        help='Gerrit cookie file')
+    parser.add_argument('--limits', default=1000,
+                        help='Max number of change lists')
+
+    parser.add_argument('-l', '--label', nargs=2, action='append',
+                        help='Labels to be added')
+    parser.add_argument('-m', '--message', help='Review message')
+
+    parser.add_argument('--abandon', help='Abandon a CL with a message')
+
+    parser.add_argument('--add-hashtag', action='append', help='Add hashtag')
+    parser.add_argument('--remove-hashtag', action='append',
+                        help='Remove hashtag')
+    parser.add_argument('--delete-hashtag', action='append',
+                        help='Remove hashtag', dest='remove_hashtag')
+
+    parser.add_argument('--set-topic', help='Set topic name')
+    parser.add_argument('--delete-topic', action='store_true',
+                        help='Delete topic name')
+    parser.add_argument('--remove-topic', action='store_true',
+                        help='Delete topic name', dest='delete_topic')
+
+    return parser.parse_args()
+
+
+def _has_task(args):
+    """Determine whether a task has been specified in the arguments."""
+    if args.label is not None or args.message is not None:
+        return True
+    if args.abandon is not None:
+        return True
+    if args.add_hashtag or args.remove_hashtag:
+        return True
+    if args.set_topic or args.delete_topic:
+        return True
+    return False
+
+
+_SEP_SPLIT = '=' * 79
+_SEP = '-' * 79
+
+
+def _print_error(change, res_code, res_json):
+    """Print the error message"""
+
+    change_id = change['change_id']
+    project = change['project']
+    revision_sha1 = change['current_revision']
+    revision = change['revisions'][revision_sha1]
+    subject = revision['commit']['subject']
+
+    print(_SEP_SPLIT, file=sys.stderr)
+    print('Project:', project, file=sys.stderr)
+    print('Change-Id:', change_id, file=sys.stderr)
+    print('Subject:', subject, file=sys.stderr)
+    print('HTTP status code:', res_code, file=sys.stderr)
+    if res_json:
+        print(_SEP, file=sys.stderr)
+        json.dump(res_json, sys.stderr, indent=4,
+                  separators=(', ', ': '))
+        print(file=sys.stderr)
+    print(_SEP_SPLIT, file=sys.stderr)
+
+
+def _do_task(change, func, *args, **kwargs):
+    """Process a task and report errors when necessary."""
+    try:
+        res_code, res_json = func(*args)
+    except HTTPError as error:
+        res_code = error.code
+        res_json = None
+
+    if res_code != kwargs.get('expected_http_code', 200):
+        _print_error(change, res_code, res_json)
+
+        errors = kwargs.get('errors')
+        if errors is not None:
+            errors['num_errors'] += 1
+
+
+def main():
+    """Set review labels to selected change lists"""
+
+    # Parse and check the command line options
+    args = _parse_args()
+    if not _has_task(args):
+        print('error: Either --label, --message, --abandon, --add-hashtag, '
+              '--remove-hashtag, --set-topic, or --delete-topic must be ',
+              'specified', file=sys.stderr)
+        sys.exit(1)
+
+    # Convert label arguments
+    labels = _get_labels_from_args(args)
+
+    # Load authentication credentials
+    url_opener = create_url_opener_from_args(args)
+
+    # Retrieve change lists
+    change_lists = query_change_lists(
+        url_opener, args.gerrit, args.query, args.limits)
+    if not change_lists:
+        print('error: No matching change lists.', file=sys.stderr)
+        sys.exit(1)
+
+    # Print matching lists
+    _print_change_lists(change_lists, file=sys.stdout)
+
+    # Confirm
+    _confirm('Do you want to continue?')
+
+    # Post review votes
+    errors = {'num_errors': 0}
+    for change in change_lists:
+        if args.label or args.message:
+            _do_task(change, set_review, url_opener, args.gerrit, change['id'],
+                     labels, args.message, errors=errors)
+        if args.add_hashtag or args.remove_hashtag:
+            _do_task(change, set_hashtags, url_opener, args.gerrit,
+                     change['id'], args.add_hashtag, args.remove_hashtag,
+                     errors=errors)
+        if args.set_topic:
+            _do_task(change, set_topic, url_opener, args.gerrit, change['id'],
+                     args.set_topic, errors=errors)
+        if args.delete_topic:
+            _do_task(change, delete_topic, url_opener, args.gerrit,
+                     change['id'], expected_http_code=204, errors=errors)
+        if args.abandon:
+            _do_task(change, abandon, url_opener, args.gerrit, change['id'],
+                     args.abandon, errors=errors)
+
+    if errors['num_errors']:
+        sys.exit(1)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/OWNERS b/vndk/OWNERS
index e80d02c..402c928 100644
--- a/vndk/OWNERS
+++ b/vndk/OWNERS
@@ -1,2 +1,2 @@
-loganchien@google.com
 andrewhsieh@google.com
+loganchien@google.com
diff --git a/vndk/snapshot/OWNERS b/vndk/snapshot/OWNERS
new file mode 100644
index 0000000..0c6b741
--- /dev/null
+++ b/vndk/snapshot/OWNERS
@@ -0,0 +1,2 @@
+andrewhsieh@google.com
+justinyun@google.com
diff --git a/vndk/snapshot/build.sh b/vndk/snapshot/build.sh
index 10d92d8..c957cdb 100755
--- a/vndk/snapshot/build.sh
+++ b/vndk/snapshot/build.sh
@@ -35,6 +35,3 @@
 
 echo "-----Generating VNDK snapshot for x86, 32-bit binder"
 make -j vndk dist TARGET_PRODUCT=aosp_x86_ab
-
-echo "-----Running tests"
-source development/vndk/snapshot/test.sh all
diff --git a/vndk/snapshot/check_gpl_license.py b/vndk/snapshot/check_gpl_license.py
index 2500444..fcee1f8 100644
--- a/vndk/snapshot/check_gpl_license.py
+++ b/vndk/snapshot/check_gpl_license.py
@@ -17,6 +17,7 @@
 
 import argparse
 import glob
+import logging
 import os
 import shutil
 import subprocess
@@ -35,16 +36,23 @@
     MANIFEST_XML = utils.MANIFEST_FILE_NAME
     MODULE_PATHS_TXT = utils.MODULE_PATHS_FILE_NAME
 
-    def __init__(self, install_dir, android_build_top, temp_artifact_dir):
+    def __init__(self, install_dir, android_build_top, temp_artifact_dir,
+                 remote_git):
         """GPLChecker constructor.
 
         Args:
           install_dir: string, absolute path to the prebuilts/vndk/v{version}
             directory where the build files will be generated.
           android_build_top: string, absolute path to ANDROID_BUILD_TOP
+          temp_artifact_dir: string, temp directory to hold build artifacts
+            fetched from Android Build server.
+          remote_git: string, remote name to fetch and check if the revision of
+            VNDK snapshot is included in the source if it is not in the current
+            git repository.
         """
         self._android_build_top = android_build_top
         self._install_dir = install_dir
+        self._remote_git = remote_git
         self._manifest_file = os.path.join(temp_artifact_dir,
                                            self.MANIFEST_XML)
         self._notice_files_dir = os.path.join(install_dir,
@@ -57,7 +65,7 @@
                     manifest_file=self._manifest_file))
 
     def _parse_module_paths(self):
-        """Parses the module_path.txt files into a dictionary,
+        """Parses the module_paths.txt files into a dictionary,
 
         Returns:
           module_paths: dict, e.g. {libfoo.so: some/path/here}
@@ -102,12 +110,59 @@
           git_project_path: string, path relative to ANDROID_BUILD_TOP
         """
         path = utils.join_realpath(self._android_build_top, git_project_path)
-        try:
-            subprocess.check_call(
-                ['git', '-C', path, 'rev-list', 'HEAD..{}'.format(revision)])
+
+        def _check_rev_list(revision):
+            """Checks whether revision is reachable from HEAD of git project."""
+
+            logging.info('Checking if revision {rev} exists in {proj}'.format(
+                rev=revision, proj=git_project_path))
+            try:
+                cmd = [
+                    'git', '-C', path, 'rev-list', 'HEAD..{}'.format(revision)
+                ]
+                output = utils.check_output(cmd).strip()
+            except subprocess.CalledProcessError as error:
+                logging.error('Error: {}'.format(error))
+                return False
+            else:
+                if output:
+                    logging.debug(
+                        '{proj} does not have the following revisions: {rev}'.
+                        format(proj=git_project_path, rev=output))
+                    return False
+                else:
+                    logging.info(
+                        'Found revision {rev} in project {proj}'.format(
+                            rev=revision, proj=git_project_path))
             return True
-        except subprocess.CalledProcessError:
-            return False
+
+        if not _check_rev_list(revision):
+            # VNDK snapshots built from a *-release branch will have merge
+            # CLs in the manifest because the *-dev branch is merged to the
+            # *-release branch periodically. In order to extract the
+            # revision relevant to the source of the git_project_path,
+            # we fetch the *-release branch and get the revision of the
+            # parent commit with FETCH_HEAD^2.
+            logging.info(
+                'Checking if the parent of revision {rev} exists in {proj}'.
+                format(rev=revision, proj=git_project_path))
+            try:
+                cmd = ['git', '-C', path, 'fetch', self._remote_git, revision]
+                utils.check_call(cmd)
+                cmd = ['git', '-C', path, 'rev-parse', 'FETCH_HEAD^2']
+                parent_revision = utils.check_output(cmd).strip()
+            except subprocess.CalledProcessError as error:
+                logging.error(
+                    'Failed to get parent of revision {rev} from "{remote}": '
+                    '{err}'.format(
+                        rev=revision, remote=self._remote_git, err=error))
+                logging.error('Try --remote to manually set remote name')
+                raise
+            else:
+                if not _check_rev_list(parent_revision):
+                    return False
+
+        return True
 
     def check_gpl_projects(self):
         """Checks that all GPL projects have released sources.
@@ -115,7 +170,7 @@
         Raises:
           ValueError: There are GPL projects with unreleased sources.
         """
-        print 'Starting license check for GPL projects...'
+        logging.info('Starting license check for GPL projects...')
 
         notice_files = glob.glob('{}/*'.format(self._notice_files_dir))
         if len(notice_files) == 0:
@@ -132,10 +187,10 @@
                     gpl_projects.append(lib_name)
 
         if not gpl_projects:
-            print 'No GPL projects found.'
+            logging.info('No GPL projects found.')
             return
 
-        print 'GPL projects found:', ', '.join(gpl_projects)
+        logging.info('GPL projects found: {}'.format(', '.join(gpl_projects)))
 
         module_paths = self._parse_module_paths()
         manifest_projects = self._parse_manifest()
@@ -162,23 +217,35 @@
                     format(lib=lib, module_paths=self.MODULE_PATHS_TXT))
 
         if released_projects:
-            print 'Released GPL projects:', released_projects
+            logging.info('Released GPL projects: {}'.format(released_projects))
 
         if unreleased_projects:
             raise ValueError(
                 ('FAIL: The following GPL projects have NOT been released in '
                  'current tree: {}'.format(unreleased_projects)))
 
-        print 'PASS: All GPL projects have source in current tree.'
+        logging.info('PASS: All GPL projects have source in current tree.')
 
 
 def get_args():
     parser = argparse.ArgumentParser()
     parser.add_argument(
-        'vndk_version', type=int,
+        'vndk_version',
+        type=int,
         help='VNDK snapshot version to check, e.g. "27".')
     parser.add_argument('-b', '--branch', help='Branch to pull manifest from.')
     parser.add_argument('--build', help='Build number to pull manifest from.')
+    parser.add_argument(
+        '--remote',
+        default='aosp',
+        help=('Remote name to fetch and check if the revision of VNDK snapshot '
+              'is included in the source to conform GPL license. default=aosp'))
+    parser.add_argument(
+        '-v',
+        '--verbose',
+        action='count',
+        default=0,
+        help='Increase output verbosity, e.g. "-v", "-vv".')
     return parser.parse_args()
 
 
@@ -195,31 +262,36 @@
     args = get_args()
     vndk_version = args.vndk_version
     install_dir = os.path.join(PREBUILTS_VNDK_DIR, 'v{}'.format(vndk_version))
+    remote = args.remote
     if not os.path.isdir(install_dir):
         raise ValueError(
             'Please provide valid VNDK version. {} does not exist.'
             .format(install_dir))
+    utils.set_logging_config(args.verbose)
 
     temp_artifact_dir = tempfile.mkdtemp()
     os.chdir(temp_artifact_dir)
     manifest_pattern = 'manifest_{}.xml'.format(args.build)
-    print 'Fetching {file} from {branch} (bid: {build})'.format(
-        file=manifest_pattern, branch=args.branch, build=args.build)
     manifest_dest = os.path.join(temp_artifact_dir, utils.MANIFEST_FILE_NAME)
+    logging.info('Fetching {file} from {branch} (bid: {build})'.format(
+        file=manifest_pattern, branch=args.branch, build=args.build))
     utils.fetch_artifact(args.branch, args.build, manifest_pattern,
                          manifest_dest)
 
     license_checker = GPLChecker(install_dir, ANDROID_BUILD_TOP,
-                                 temp_artifact_dir)
+                                 temp_artifact_dir, remote)
     try:
         license_checker.check_gpl_projects()
     except ValueError as error:
-        print error
+        logging.error('Error: {}'.format(error))
         raise
     finally:
-        print 'Deleting temp_artifact_dir: {}'.format(temp_artifact_dir)
+        logging.info(
+            'Deleting temp_artifact_dir: {}'.format(temp_artifact_dir))
         shutil.rmtree(temp_artifact_dir)
 
+    logging.info('Done.')
+
 
 if __name__ == '__main__':
     main()
diff --git a/vndk/snapshot/gen_buildfiles.py b/vndk/snapshot/gen_buildfiles.py
index e103dd5..f504f55 100644
--- a/vndk/snapshot/gen_buildfiles.py
+++ b/vndk/snapshot/gen_buildfiles.py
@@ -15,7 +15,9 @@
 # limitations under the License.
 #
 
+import argparse
 import glob
+import logging
 import os
 import sys
 
@@ -23,10 +25,11 @@
 
 
 class GenBuildFile(object):
-    """Generates Android.mk and Android.bp for VNDK snapshot.
+    """Generates Android.bp for VNDK snapshot.
 
     VNDK snapshot directory structure under prebuilts/vndk/v{version}:
-        {SNAPSHOT_VARIANT}/
+        Android.bp
+        {SNAPSHOT_ARCH}/
             Android.bp
             arch-{TARGET_ARCH}-{TARGET_ARCH_VARIANT}/
                 shared/
@@ -40,11 +43,17 @@
                         (VNDK-core libraries, e.g. libbinder.so)
                     vndk-sp/
                         (VNDK-SP libraries, e.g. libc++.so)
+            binder32/
+                (This directory is newly introduced in v28 (Android P) to hold
+                prebuilts built for 32-bit binder interface.)
+                Android.bp
+                arch-{TARGET_ARCH}-{TARGE_ARCH_VARIANT}/
+                    ...
             configs/
                 (various *.txt configuration files, e.g. ld.config.*.txt)
-        ... (other {SNAPSHOT_VARIANT}/ directories)
+        ... (other {SNAPSHOT_ARCH}/ directories)
         common/
-            Android.mk
+            Android.bp
             NOTICE_FILES/
                 (license files, e.g. libfoo.so.txt)
     """
@@ -67,12 +76,14 @@
         self._install_dir = install_dir
         self._vndk_version = vndk_version
         self._etc_paths = self._get_etc_paths()
-        self._snapshot_variants = utils.get_snapshot_variants(install_dir)
-        self._mkfile = os.path.join(install_dir, utils.ANDROID_MK_PATH)
+        self._snapshot_archs = utils.get_snapshot_archs(install_dir)
+        self._root_bpfile = os.path.join(install_dir, utils.ROOT_BP_PATH)
+        self._common_bpfile = os.path.join(install_dir, utils.COMMON_BP_PATH)
         self._vndk_core = self._parse_lib_list('vndkcore.libraries.txt')
         self._vndk_sp = self._parse_lib_list(
             os.path.basename(self._etc_paths['vndksp.libraries.txt']))
         self._vndk_private = self._parse_lib_list('vndkprivate.libraries.txt')
+        self._modules_with_notice = self._get_modules_with_notice()
 
     def _get_etc_paths(self):
         """Returns a map of relative file paths for each ETC module."""
@@ -88,7 +99,7 @@
         return etc_paths
 
     def _parse_lib_list(self, txt_filename):
-        """Returns a map of VNDK library lists per VNDK snapshot variant.
+        """Returns a map of VNDK library lists per VNDK snapshot arch.
 
         Args:
           txt_filename: string, name of snapshot config file
@@ -98,70 +109,148 @@
         """
         lib_map = dict()
         for txt_path in utils.find(self._install_dir, [txt_filename]):
-            variant = utils.variant_from_path(txt_path)
+            arch = utils.snapshot_arch_from_path(txt_path)
             abs_path_of_txt = os.path.join(self._install_dir, txt_path)
             with open(abs_path_of_txt, 'r') as f:
-                lib_map[variant] = f.read().strip().split('\n')
+                lib_map[arch] = f.read().strip().split('\n')
         return lib_map
 
-    def generate_android_mk(self):
-        """Autogenerates Android.mk."""
+    def _get_modules_with_notice(self):
+        """Returns a list of modules that have associated notice files. """
+        notice_paths = glob.glob(
+            os.path.join(self._install_dir, utils.NOTICE_FILES_DIR_PATH,
+                         '*.txt'))
+        return [os.path.splitext(os.path.basename(p))[0] for p in notice_paths]
 
+    def generate_root_android_bp(self):
+        """Autogenerates Android.bp."""
+
+        logging.info('Generating Android.bp for snapshot v{}'.format(
+            self._vndk_version))
         etc_buildrules = []
         for prebuilt in self.ETC_MODULES:
+            # ld.config.VER.txt is not installed as a prebuilt but is built and
+            # installed from thesource tree at the time the VNDK snapshot is
+            # installed to the system.img.
+            if prebuilt == 'ld.config.txt':
+                continue
             etc_buildrules.append(self._gen_etc_prebuilt(prebuilt))
 
-        with open(self._mkfile, 'w') as mkfile:
-            mkfile.write(self._gen_autogen_msg('#'))
-            mkfile.write('\n')
-            mkfile.write('LOCAL_PATH := $(call my-dir)\n')
-            mkfile.write('\n')
-            mkfile.write('\n\n'.join(etc_buildrules))
-            mkfile.write('\n')
+        with open(self._root_bpfile, 'w') as bpfile:
+            bpfile.write(self._gen_autogen_msg('/'))
+            bpfile.write('\n')
+            bpfile.write('\n'.join(etc_buildrules))
+            bpfile.write('\n')
+
+        logging.info('Successfully generated {}'.format(self._root_bpfile))
+
+    def generate_common_android_bp(self):
+        """Autogenerates common/Android.bp."""
+
+        logging.info('Generating common/Android.bp for snapshot v{}'.format(
+            self._vndk_version))
+        with open(self._common_bpfile, 'w') as bpfile:
+            bpfile.write(self._gen_autogen_msg('/'))
+            for module in self._modules_with_notice:
+                bpfile.write('\n')
+                bpfile.write(self._gen_notice_filegroup(module))
 
     def generate_android_bp(self):
-        """Autogenerates Android.bp file for each VNDK snapshot variant."""
+        """Autogenerates Android.bp."""
 
-        for variant in self._snapshot_variants:
-            bpfile = os.path.join(self._install_dir, variant, 'Android.bp')
+        def gen_for_variant(arch, is_binder32=False):
+            """Generates Android.bp file for specified VNDK snapshot variant.
+
+            A VNDK snapshot variant is defined by the TARGET_ARCH and binder
+            bitness. Example snapshot variants:
+                vndk_v{ver}_arm:            {arch: arm, binder: 64-bit}
+                vndk_v{ver}_arm_binder32:   {arch: arm, binder: 32-bit}
+
+            Args:
+              arch: string, VNDK snapshot arch (e.g. 'arm64')
+              is_binder32: bool, True if binder interface is 32-bit
+            """
+            binder32_suffix = '_{}'.format(
+                utils.BINDER32) if is_binder32 else ''
+            logging.info('Generating Android.bp for vndk_v{}_{}{}'.format(
+                self._vndk_version, arch, binder32_suffix))
+
+            variant_subpath = arch
+            # For O-MR1 snapshot (v27), 32-bit binder prebuilts are not
+            # isolated in separate 'binder32' subdirectory.
+            if is_binder32 and self._vndk_version >= 28:
+                variant_subpath = os.path.join(arch, utils.BINDER32)
+            bpfile_path = os.path.join(self._install_dir, variant_subpath,
+                                       'Android.bp')
+
             vndk_core_buildrules = self._gen_vndk_shared_prebuilts(
-                self._vndk_core[variant], variant, False)
+                self._vndk_core[arch], arch, is_binder32=is_binder32)
             vndk_sp_buildrules = self._gen_vndk_shared_prebuilts(
-                self._vndk_sp[variant], variant, True)
+                self._vndk_sp[arch],
+                arch,
+                is_vndk_sp=True,
+                is_binder32=is_binder32)
 
-            with open(bpfile, 'w') as bpfile:
+            with open(bpfile_path, 'w') as bpfile:
                 bpfile.write(self._gen_autogen_msg('/'))
                 bpfile.write('\n')
-                bpfile.write(self._gen_bp_phony(variant))
+                bpfile.write(self._gen_bp_phony(arch, is_binder32))
                 bpfile.write('\n')
                 bpfile.write('\n'.join(vndk_core_buildrules))
                 bpfile.write('\n')
                 bpfile.write('\n'.join(vndk_sp_buildrules))
 
+            logging.info('Successfully generated {}'.format(bpfile_path))
+
+        if self._vndk_version == 27:
+            # For O-MR1 snapshot (v27), 32-bit binder prebuilts are not
+            # isolated in separate 'binder32' subdirectory.
+            for arch in self._snapshot_archs:
+                if arch in ('arm', 'x86'):
+                    gen_for_variant(arch, is_binder32=True)
+                else:
+                    gen_for_variant(arch)
+            return
+
+        for arch in self._snapshot_archs:
+            if os.path.isdir(
+                    os.path.join(self._install_dir, arch, utils.BINDER32)):
+                gen_for_variant(arch, is_binder32=True)
+            gen_for_variant(arch)
+
     def _gen_autogen_msg(self, comment_char):
         return ('{0}{0} THIS FILE IS AUTOGENERATED BY '
                 'development/vndk/snapshot/gen_buildfiles.py\n'
                 '{0}{0} DO NOT EDIT\n'.format(comment_char))
 
-    def _get_versioned_name(self, prebuilt, variant, is_etc):
+    def _get_versioned_name(self,
+                            prebuilt,
+                            arch,
+                            is_etc=False,
+                            is_binder32=False):
         """Returns the VNDK version-specific module name for a given prebuilt.
 
         The VNDK version-specific module name is defined as follows:
         For a VNDK shared lib: 'libfoo.so'
-                            -> 'libfoo.vndk.{version}.{variant}.vendor'
+            if binder is 32-bit:
+                'libfoo.vndk.{version}.{arch}.binder32.vendor'
+            else:
+                'libfoo.vndk.{version}.{arch}.vendor'
         For an ETC module: 'foo.txt' -> 'foo.{version}.txt'
 
         Args:
           prebuilt: string, name of the prebuilt object
-          variant: string, VNDK snapshot variant (e.g. 'arm64')
+          arch: string, VNDK snapshot arch (e.g. 'arm64')
           is_etc: bool, True if the LOCAL_MODULE_CLASS of prebuilt is 'ETC'
+          is_binder32: bool, True if binder interface is 32-bit
         """
         name, ext = os.path.splitext(prebuilt)
         if is_etc:
             versioned_name = '{}.{}{}'.format(name, self._vndk_version, ext)
         else:
-            versioned_name = '{}.vndk.{}.{}.vendor'.format(
-                name, self._vndk_version, variant)
+            binder_suffix = '.{}'.format(utils.BINDER32) if is_binder32 else ''
+            versioned_name = '{}.vndk.{}.{}{}.vendor'.format(
+                name, self._vndk_version, arch, binder_suffix)
 
         return versioned_name
 
@@ -174,34 +263,65 @@
         etc_path = self._etc_paths[prebuilt]
         etc_sub_path = etc_path[etc_path.index('/') + 1:]
 
-        return ('#######################################\n'
-                '# {prebuilt}\n'
-                'include $(CLEAR_VARS)\n'
-                'LOCAL_MODULE := {versioned_name}\n'
-                'LOCAL_SRC_FILES := ../$(TARGET_ARCH)/{etc_sub_path}\n'
-                'LOCAL_MODULE_CLASS := ETC\n'
-                'LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)\n'
-                'LOCAL_MODULE_STEM := $(LOCAL_MODULE)\n'
-                'include $(BUILD_PREBUILT)\n'.format(
-                    prebuilt=prebuilt,
-                    versioned_name=self._get_versioned_name(
-                        prebuilt, None, True),
-                    etc_sub_path=etc_sub_path))
+        prebuilt_etc = ('prebuilt_etc {{\n'
+                        '{ind}name: "{versioned_name}",\n'
+                        '{ind}target: {{\n'.format(
+                            ind=self.INDENT,
+                            versioned_name=self._get_versioned_name(
+                                prebuilt, None, is_etc=True)))
+        for arch in self._snapshot_archs:
+            prebuilt_etc += ('{ind}{ind}android_{arch}: {{\n'
+                             '{ind}{ind}{ind}src: "{arch}/{etc_sub_path}",\n'
+                             '{ind}{ind}}},\n'.format(
+                                 ind=self.INDENT,
+                                 arch=arch,
+                                 etc_sub_path=etc_sub_path))
+        prebuilt_etc += ('{ind}}},\n'
+                         '}}\n'.format(ind=self.INDENT))
+        return prebuilt_etc
 
-    def _gen_bp_phony(self, variant):
-        """Generates build rule for phony package 'vndk_v{ver}_{variant}'.
+    def _gen_notice_filegroup(self, module):
+        """Generates a notice filegroup build rule for a given module.
 
         Args:
-          variant: string, VNDK snapshot variant (e.g. 'arm64')
+          notice: string, module name
+        """
+        return ('filegroup {{\n'
+                '{ind}name: "{filegroup_name}",\n'
+                '{ind}srcs: ["{notice_dir}/{module}.txt"],\n'
+                '}}\n'.format(
+                    ind=self.INDENT,
+                    filegroup_name=self._get_notice_filegroup_name(module),
+                    module=module,
+                    notice_dir=utils.NOTICE_FILES_DIR_NAME))
+
+    def _get_notice_filegroup_name(self, module):
+        """ Gets a notice filegroup module name for a given module.
+
+        Args:
+          notice: string, module name.
+        """
+        return 'vndk-v{ver}-{module}-notice'.format(
+            ver=self._vndk_version, module=module)
+
+    def _gen_bp_phony(self, arch, is_binder32=False):
+        """Generates build rule for phony package 'vndk_v{ver}_{arch}'.
+
+        Args:
+          arch: string, VNDK snapshot arch (e.g. 'arm64')
+          is_binder32: bool, True if binder interface is 32-bit
         """
         required = []
-        for prebuilts in (self._vndk_core[variant], self._vndk_sp[variant]):
+        for prebuilts in (self._vndk_core[arch], self._vndk_sp[arch]):
             for prebuilt in prebuilts:
                 required.append(
-                    self._get_versioned_name(prebuilt, variant, False))
+                    self._get_versioned_name(
+                        prebuilt, arch, is_binder32=is_binder32))
 
         for prebuilt in self.ETC_MODULES:
-            required.append(self._get_versioned_name(prebuilt, None, True))
+            required.append(
+                self._get_versioned_name(
+                    prebuilt, None, is_etc=True, is_binder32=is_binder32))
 
         required_str = ['"{}",'.format(prebuilt) for prebuilt in required]
         required_formatted = '\n{ind}{ind}'.format(
@@ -211,37 +331,53 @@
                               '{ind}],\n'.format(
                                   ind=self.INDENT,
                                   required_formatted=required_formatted))
+        binder_suffix = '_{}'.format(utils.BINDER32) if is_binder32 else ''
 
         return ('phony {{\n'
-                '{ind}name: "vndk_v{ver}_{variant}",\n'
+                '{ind}name: "vndk_v{ver}_{arch}{binder_suffix}",\n'
                 '{required_buildrule}'
                 '}}\n'.format(
                     ind=self.INDENT,
                     ver=self._vndk_version,
-                    variant=variant,
+                    arch=arch,
+                    binder_suffix=binder_suffix,
                     required_buildrule=required_buildrule))
 
-    def _gen_vndk_shared_prebuilts(self, prebuilts, variant, is_vndk_sp):
+    def _gen_vndk_shared_prebuilts(self,
+                                   prebuilts,
+                                   arch,
+                                   is_vndk_sp=False,
+                                   is_binder32=False):
         """Returns list of build rules for given prebuilts.
 
         Args:
           prebuilts: list of VNDK shared prebuilts
-          variant: string, VNDK snapshot variant (e.g. 'arm64')
+          arch: string, VNDK snapshot arch (e.g. 'arm64')
           is_vndk_sp: bool, True if prebuilts are VNDK_SP libs
+          is_binder32: bool, True if binder interface is 32-bit
         """
         build_rules = []
         for prebuilt in prebuilts:
             build_rules.append(
-                self._gen_vndk_shared_prebuilt(prebuilt, variant, is_vndk_sp))
+                self._gen_vndk_shared_prebuilt(
+                    prebuilt,
+                    arch,
+                    is_vndk_sp=is_vndk_sp,
+                    is_binder32=is_binder32))
         return build_rules
 
-    def _gen_vndk_shared_prebuilt(self, prebuilt, variant, is_vndk_sp):
+    def _gen_vndk_shared_prebuilt(self,
+                                  prebuilt,
+                                  arch,
+                                  is_vndk_sp=False,
+                                  is_binder32=False):
         """Returns build rule for given prebuilt.
 
         Args:
           prebuilt: string, name of prebuilt object
-          variant: string, VNDK snapshot variant (e.g. 'arm64')
+          arch: string, VNDK snapshot arch (e.g. 'arm64')
           is_vndk_sp: bool, True if prebuilt is a VNDK_SP lib
+          is_binder32: bool, True if binder interface is 32-bit
         """
 
         def get_notice_file(prebuilt):
@@ -251,15 +387,10 @@
               prebuilt: string, name of prebuilt object
             """
             notice = ''
-            notice_file_name = '{}.txt'.format(prebuilt)
-            notices_dir = os.path.join(self._install_dir,
-                                       utils.NOTICE_FILES_DIR_PATH)
-            notice_files = utils.find(notices_dir, [notice_file_name])
-            if len(notice_files) > 0:
-                notice = '{ind}notice: "{notice_file_path}",\n'.format(
+            if prebuilt in self._modules_with_notice:
+                notice = '{ind}notice: ":{notice_filegroup}",\n'.format(
                     ind=self.INDENT,
-                    notice_file_path=os.path.join(
-                        '..', utils.NOTICE_FILES_DIR_PATH, notice_files[0]))
+                    notice_filegroup=self._get_notice_filegroup_name(prebuilt))
             return notice
 
         def get_rel_install_path(prebuilt):
@@ -275,7 +406,7 @@
                                      .format(ind=self.INDENT, path=path))
             return rel_install_path
 
-        def get_arch_srcs(prebuilt, variant):
+        def get_arch_srcs(prebuilt, arch):
             """Returns build rule for arch specific srcs.
 
             e.g.,
@@ -290,38 +421,53 @@
 
             Args:
               prebuilt: string, name of prebuilt object
-              variant: string, VNDK snapshot variant (e.g. 'arm64')
+              arch: string, VNDK snapshot arch (e.g. 'arm64')
             """
             arch_srcs = '{ind}arch: {{\n'.format(ind=self.INDENT)
-            variant_path = os.path.join(self._install_dir, variant)
-            src_paths = utils.find(variant_path, [prebuilt])
+            src_paths = utils.find(src_root, [prebuilt])
+            # filter out paths under 'binder32' subdirectory
+            src_paths = filter(lambda src: not src.startswith(utils.BINDER32),
+                               src_paths)
+
             for src in sorted(src_paths):
                 arch_srcs += ('{ind}{ind}{arch}: {{\n'
                               '{ind}{ind}{ind}srcs: ["{src}"],\n'
                               '{ind}{ind}}},\n'.format(
                                   ind=self.INDENT,
-                                  arch=utils.arch_from_path(
-                                      os.path.join(variant, src)),
+                                  arch=utils.prebuilt_arch_from_path(
+                                      os.path.join(arch, src)),
                                   src=src))
             arch_srcs += '{ind}}},\n'.format(ind=self.INDENT)
             return arch_srcs
 
+        src_root = os.path.join(self._install_dir, arch)
+        # For O-MR1 snapshot (v27), 32-bit binder prebuilts are not
+        # isolated in separate 'binder32' subdirectory.
+        if is_binder32 and self._vndk_version >= 28:
+            src_root = os.path.join(src_root, utils.BINDER32)
+
         name = os.path.splitext(prebuilt)[0]
         vendor_available = str(
-            prebuilt not in self._vndk_private[variant]).lower()
+            prebuilt not in self._vndk_private[arch]).lower()
+
+        vndk_sp = ''
         if is_vndk_sp:
             vndk_sp = '{ind}{ind}support_system_process: true,\n'.format(
                 ind=self.INDENT)
-        else:
-            vndk_sp = ''
+
         notice = get_notice_file(prebuilt)
         rel_install_path = get_rel_install_path(prebuilt)
-        arch_srcs = get_arch_srcs(prebuilt, variant)
+        arch_srcs = get_arch_srcs(prebuilt, arch)
+
+        binder32bit = ''
+        if is_binder32:
+            binder32bit = '{ind}binder32bit: true,\n'.format(ind=self.INDENT)
 
         return ('vndk_prebuilt_shared {{\n'
                 '{ind}name: "{name}",\n'
                 '{ind}version: "{ver}",\n'
                 '{ind}target_arch: "{target_arch}",\n'
+                '{binder32bit}'
                 '{ind}vendor_available: {vendor_available},\n'
                 '{ind}vndk: {{\n'
                 '{ind}{ind}enabled: true,\n'
@@ -334,14 +480,30 @@
                     ind=self.INDENT,
                     name=name,
                     ver=self._vndk_version,
+                    target_arch=arch,
+                    binder32bit=binder32bit,
                     vendor_available=vendor_available,
-                    target_arch=variant,
                     vndk_sp=vndk_sp,
                     notice=notice,
                     rel_install_path=rel_install_path,
                     arch_srcs=arch_srcs))
 
 
+def get_args():
+    parser = argparse.ArgumentParser()
+    parser.add_argument(
+        'vndk_version',
+        type=int,
+        help='VNDK snapshot version to install, e.g. "27".')
+    parser.add_argument(
+        '-v',
+        '--verbose',
+        action='count',
+        default=0,
+        help='Increase output verbosity, e.g. "-v", "-vv".')
+    return parser.parse_args()
+
+
 def main():
     """For local testing purposes.
 
@@ -352,13 +514,22 @@
     PREBUILTS_VNDK_DIR = utils.join_realpath(ANDROID_BUILD_TOP,
                                              'prebuilts/vndk')
 
-    vndk_version = 27  # set appropriately
+    args = get_args()
+    vndk_version = args.vndk_version
     install_dir = os.path.join(PREBUILTS_VNDK_DIR, 'v{}'.format(vndk_version))
+    if not os.path.isdir(install_dir):
+        raise ValueError(
+            'Please provide valid VNDK version. {} does not exist.'
+            .format(install_dir))
+    utils.set_logging_config(args.verbose)
 
     buildfile_generator = GenBuildFile(install_dir, vndk_version)
-    buildfile_generator.generate_android_mk()
+    buildfile_generator.generate_root_android_bp()
+    buildfile_generator.generate_common_android_bp()
     buildfile_generator.generate_android_bp()
 
+    logging.info('Done.')
+
 
 if __name__ == '__main__':
     main()
diff --git a/vndk/snapshot/test.sh b/vndk/snapshot/test.sh
deleted file mode 100755
index d73ea74..0000000
--- a/vndk/snapshot/test.sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Test script for build/make/core/tasks/vndk.mk.
-# Makes sure VNDK snapshots include all required prebuilts and config files.
-#
-# Local usage:
-#   First, generate VNDK snapshots with development/vndk/snapshot/build.sh or
-#   fetch VNDK snapshot build artifacts to $DIST_DIR, then run this script.
-
-set -eo pipefail
-
-if [[ "$#" -ne 1 ]]; then
-    echo "Usage: \"$0 all\" to test all VNDK snapshot variants at once."
-    echo "       \"$0 \$TARGET_PRODUCT\" to test a specific VNDK snapshot."
-    exit 1
-fi
-
-if [[ "$1" == 'all' ]]; then
-    readonly TARGET_PRODUCTS=('aosp_arm' 'aosp_arm_ab' 'aosp_arm64' 'aosp_x86' 'aosp_x86_ab' 'aosp_x86_64')
-else
-    readonly TARGET_PRODUCTS=($1)
-fi
-
-script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-readonly ANDROID_BUILD_TOP=$(dirname $(dirname $(dirname "${script_dir}")))
-echo "ANDROID_BUILD_TOP: "${ANDROID_BUILD_TOP}""
-
-OUT_DIR=${OUT_DIR:-}
-DIST_DIR=${DIST_DIR:-}
-if [[ -z "${DIST_DIR}" ]]; then
-    if [[ -z "${OUT_DIR}" ]]; then
-        DIST_DIR="${ANDROID_BUILD_TOP}"/out/dist
-    else
-        DIST_DIR="${OUT_DIR}"/dist
-    fi
-fi
-
-# Get PLATFORM_VNDK_VERSION
-source ""${ANDROID_BUILD_TOP}"/build/envsetup.sh" >/dev/null
-readonly PLATFORM_VNDK_VERSION="$(get_build_var PLATFORM_VNDK_VERSION)"
-
-readonly TEMP_DIR="$(mktemp -d /tmp/"$(basename $0)"_XXXXXXXX)"
-readonly SNAPSHOT_TOP="${TEMP_DIR}"/android-vndk-snapshot
-readonly SNAPSHOT_TEMPFILE="${TEMP_DIR}"/snapshot_libs.txt
-readonly SYSTEM_TEMPFILE="${TEMP_DIR}"/system_libs.txt
-readonly BINDER_32_DIRNAME='binder32'
-
-readonly RED='\033[0;31m'
-readonly NC='\033[0m'
-readonly PASS="::: PASS :::"
-readonly FAIL=""${RED}"::: FAIL :::"${NC}""
-
-
-function set_vars() {
-    TARGET_PRODUCT="$1"
-    ARCH=''
-    PRODUCT_OUT=''
-    BITNESS_SUFFIX=''
-    BINDER_BITNESS_PATH=''
-    TARGET_2ND_ARCH=''
-    case "$1" in
-        aosp_arm64)
-            ARCH='arm64'
-            PRODUCT_OUT='generic_arm64'
-            BITNESS_SUFFIX='64'
-            TARGET_2ND_ARCH='arm'
-            ;;
-        aosp_arm)
-            ARCH='arm'
-            PRODUCT_OUT='generic'
-            ;;
-        aosp_arm_ab)
-            ARCH='arm'
-            PRODUCT_OUT='generic_arm_ab'
-            BINDER_BITNESS_PATH="${BINDER_32_DIRNAME}"
-            ;;
-        aosp_x86_64)
-            ARCH='x86_64'
-            PRODUCT_OUT='generic_x86_64'
-            BITNESS_SUFFIX='64'
-            TARGET_2ND_ARCH='x86'
-            ;;
-        aosp_x86)
-            ARCH='x86'
-            PRODUCT_OUT='generic_x86'
-            ;;
-        aosp_x86_ab)
-            ARCH='x86'
-            PRODUCT_OUT='generic_x86'
-            BINDER_BITNESS_PATH="${BINDER_32_DIRNAME}"
-            ;;
-        *)
-            echo "Unrecognized \$TARGET_PRODUCT: "$1""
-            exit 1
-            ;;
-    esac
-}
-
-
-function cleanup {
-    echo "[Cleanup]"
-    echo "Removing TEMP_DIR: "${TEMP_DIR}""
-    rm -rf ""${TEMP_DIR}""
-}
-trap cleanup EXIT
-
-
-#######################################
-# Compares the list of VNDK-core and VNDK-SP
-# libs included in the snapshot and installed
-# under $PRODUCT_OUT/system/lib*
-#
-# Arguments:
-#   $1: vndk_type: one of [vndk-core, vndk-sp]
-#######################################
-function compare_vndk_libs() {
-    local vndk_type="$1"
-    local vndk_dir_suffix
-    local system_vndk_dir
-    local snapshot_dir
-    local snapshot_dir_2nd
-    local system_lib_dir
-    local system_lib_dir_2nd
-
-    if [[ -z "${PLATFORM_VNDK_VERSION}" ]]; then
-        vndk_dir_suffix=""
-    else
-        vndk_dir_suffix="-${PLATFORM_VNDK_VERSION}"
-    fi
-
-    if [[ "${vndk_type}" == 'vndk-core' ]]; then
-        system_vndk_dir="vndk${vndk_dir_suffix}"
-    else
-        system_vndk_dir="vndk-sp${vndk_dir_suffix}"
-    fi
-
-    function diff_vndk_dirs() {
-        local snapshot="$1"
-        local system="$2"
-        local target_arch="$3"
-
-        ls -1 ${snapshot} > "${SNAPSHOT_TEMPFILE}"
-        find "${system}" -type f | xargs -n 1 -I file bash -c "basename file" | sort > "${SYSTEM_TEMPFILE}"
-
-        echo "Comparing libs for TARGET_PRODUCT="${TARGET_PRODUCT}", VNDK="${vndk_type}", ARCH="${target_arch}""
-        echo "Snapshot dir:" ${snapshot}
-        echo "System dir: "${system}""
-        (diff --old-line-format="Only found in VNDK snapshot: %L" \
-              --new-line-format="Only found in /system/lib*: %L" \
-              --unchanged-line-format="" \
-              "${SNAPSHOT_TEMPFILE}" "${SYSTEM_TEMPFILE}" && echo "${PASS}") \
-        || (echo -e "${FAIL}"; exit 1)
-    }
-
-    if [[ -n "${BINDER_BITNESS_PATH}" ]]; then
-        snapshot_dir="${SNAPSHOT_TOP}"/"${ARCH}"/"${BINDER_BITNESS_PATH}"/arch-"${ARCH}"-*/shared/"${vndk_type}"
-    else
-        snapshot_dir="${SNAPSHOT_TOP}"/"${ARCH}"/arch-"${ARCH}"-*/shared/"${vndk_type}"
-    fi
-
-    system_lib_dir="${ANDROID_BUILD_TOP}"/out/target/product/"${PRODUCT_OUT}"/system/lib"${BITNESS_SUFFIX}"/"${system_vndk_dir}"
-    diff_vndk_dirs "${snapshot_dir}" $system_lib_dir "${ARCH}"
-
-    if [[ -n "${TARGET_2ND_ARCH}" ]]; then
-        snapshot_dir_2nd="${SNAPSHOT_TOP}"/"${ARCH}"/arch-"${TARGET_2ND_ARCH}"-*/shared/"${vndk_type}"
-        system_lib_dir_2nd="${ANDROID_BUILD_TOP}"/out/target/product/"${PRODUCT_OUT}"/system/lib/"${system_vndk_dir}"
-        diff_vndk_dirs "${snapshot_dir_2nd}" "${system_lib_dir_2nd}" "${TARGET_2ND_ARCH}"
-    fi
-}
-
-
-#######################################
-# Executes tests against VNDK snapshot of
-# specified $TARGET_PRODUCT
-#
-# Arguments:
-#   $1: TARGET_PRODUCT
-#######################################
-function run_tests() {
-    set_vars "$1"
-    local snapshot_zip="${DIST_DIR}"/android-vndk-"${TARGET_PRODUCT}".zip
-    local snapshot_variant_top="${SNAPSHOT_TOP}"/"${ARCH}"
-
-    echo "[Setup] Unzipping \"android-vndk-"${TARGET_PRODUCT}".zip\""
-    unzip -qn "${snapshot_zip}" -d "${SNAPSHOT_TOP}"
-
-    echo "[Test] Comparing VNDK-core and VNDK-SP libs in snapshot vs /system/lib*"
-    compare_vndk_libs 'vndk-core'
-    compare_vndk_libs 'vndk-sp'
-
-    echo "[Test] Checking required config files are present"
-    if [[ -z "${PLATFORM_VNDK_VERSION}" ]]; then
-        config_file_suffix=""
-    else
-        config_file_suffix=".${PLATFORM_VNDK_VERSION}"
-    fi
-
-    config_files=(
-        "ld.config"${config_file_suffix}".txt"
-        "llndk.libraries"${config_file_suffix}".txt"
-        "vndksp.libraries"${config_file_suffix}".txt"
-        "vndkcore.libraries.txt"
-        "vndkprivate.libraries.txt"
-        "module_paths.txt")
-    for config_file in "${config_files[@]}"; do
-        config_file_abs_path="${snapshot_variant_top}"/configs/"${config_file}"
-        if [[ ! -e "${config_file_abs_path}" ]]; then
-            echo -e ""${FAIL}" The file \""${config_file_abs_path}"\" was not found in snapshot."
-            exit 1
-        else
-            echo ""${PASS}" Found "${config_file}""
-        fi
-    done
-
-    echo "[Test] Checking directory structure of snapshot"
-    directories=(
-        "configs/"
-        "NOTICE_FILES/")
-    for sub_dir in "${directories[@]}"; do
-        dir_abs_path="${snapshot_variant_top}"/"${sub_dir}"
-        if [[ ! -d "${dir_abs_path}" ]]; then
-            echo -e ""${FAIL}" The directory \""${dir_abs_path}"\" was not found in snapshot."
-            exit 1
-        else
-            echo ""${PASS}" Found "${sub_dir}""
-        fi
-    done
-}
-
-
-# Run tests for each target product
-for target_product in "${TARGET_PRODUCTS[@]}"; do
-    echo -e "\n::::::::: Running tests for TARGET_PRODUCT="${target_product}" :::::::::"
-    run_tests "${target_product}"
-done
-
-echo "Done. All tests passed!"
diff --git a/vndk/snapshot/update.py b/vndk/snapshot/update.py
index c74410f..2a8441e 100644
--- a/vndk/snapshot/update.py
+++ b/vndk/snapshot/update.py
@@ -33,28 +33,18 @@
 from gen_buildfiles import GenBuildFile
 
 ANDROID_BUILD_TOP = utils.get_android_build_top()
-DIST_DIR = utils.get_dist_dir(utils.get_out_dir(ANDROID_BUILD_TOP))
 PREBUILTS_VNDK_DIR = utils.join_realpath(ANDROID_BUILD_TOP, 'prebuilts/vndk')
 
 
-def logger():
-    return logging.getLogger(__name__)
-
-
-def check_call(cmd):
-    logger().debug('Running `{}`'.format(' '.join(cmd)))
-    subprocess.check_call(cmd)
-
-
 def start_branch(build):
     branch_name = 'update-' + (build or 'local')
-    logger().info('Creating branch {branch} in {dir}'.format(
+    logging.info('Creating branch {branch} in {dir}'.format(
         branch=branch_name, dir=os.getcwd()))
-    check_call(['repo', 'start', branch_name, '.'])
+    utils.check_call(['repo', 'start', branch_name, '.'])
 
 
 def remove_old_snapshot(install_dir):
-    logger().info('Removing any old files in {}'.format(install_dir))
+    logging.info('Removing any old files in {}'.format(install_dir))
     for file in glob.glob('{}/*'.format(install_dir)):
         try:
             if os.path.isfile(file):
@@ -62,19 +52,20 @@
             elif os.path.isdir(file):
                 shutil.rmtree(file)
         except Exception as error:
-            print error
+            logging.error('Error: {}'.format(error))
             sys.exit(1)
 
 
-def install_snapshot(branch, build, install_dir, temp_artifact_dir):
+def install_snapshot(branch, build, local_dir, install_dir, temp_artifact_dir):
     """Installs VNDK snapshot build artifacts to prebuilts/vndk/v{version}.
 
-    1) Fetch build artifacts from Android Build server or from local DIST_DIR
+    1) Fetch build artifacts from Android Build server or from local_dir
     2) Unzip build artifacts
 
     Args:
       branch: string or None, branch name of build artifacts
       build: string or None, build number of build artifacts
+      local_dir: string or None, local dir to pull artifacts from
       install_dir: string, directory to install VNDK snapshot
       temp_artifact_dir: string, temp directory to hold build artifacts fetched
         from Android Build server. For 'local' option, is set to None.
@@ -84,61 +75,66 @@
     if branch and build:
         artifact_dir = temp_artifact_dir
         os.chdir(temp_artifact_dir)
-        logger().info('Fetching {pattern} from {branch} (bid: {build})'.format(
+        logging.info('Fetching {pattern} from {branch} (bid: {build})'.format(
             pattern=artifact_pattern, branch=branch, build=build))
         utils.fetch_artifact(branch, build, artifact_pattern)
 
         manifest_pattern = 'manifest_{}.xml'.format(build)
-        logger().info('Fetching {file} from {branch} (bid: {build})'.format(
+        logging.info('Fetching {file} from {branch} (bid: {build})'.format(
             file=manifest_pattern, branch=branch, build=build))
         utils.fetch_artifact(branch, build, manifest_pattern,
                              utils.MANIFEST_FILE_NAME)
 
         os.chdir(install_dir)
-    else:
-        logger().info('Fetching local VNDK snapshot from {}'.format(DIST_DIR))
-        artifact_dir = DIST_DIR
+    elif local_dir:
+        logging.info('Fetching local VNDK snapshot from {}'.format(local_dir))
+        artifact_dir = local_dir
 
     artifacts = glob.glob(os.path.join(artifact_dir, artifact_pattern))
-    artifact_cnt = len(artifacts)
-    if artifact_cnt < 4:
-        raise RuntimeError(
-            'Expected four android-vndk-*.zip files in {path}. Instead '
-            'found {cnt}.'.format(path=artifact_dir, cnt=artifact_cnt))
     for artifact in artifacts:
-        logger().info('Unzipping VNDK snapshot: {}'.format(artifact))
-        check_call(['unzip', '-q', artifact, '-d', install_dir])
+        logging.info('Unzipping VNDK snapshot: {}'.format(artifact))
+        utils.check_call(['unzip', '-qn', artifact, '-d', install_dir])
 
 
 def gather_notice_files(install_dir):
     """Gathers all NOTICE files to a common NOTICE_FILES directory."""
 
     common_notices_dir = utils.NOTICE_FILES_DIR_PATH
-    logger().info('Creating {} directory...'.format(common_notices_dir))
+    logging.info('Creating {} directory to gather all NOTICE files...'.format(
+        common_notices_dir))
     os.makedirs(common_notices_dir)
-    for variant in utils.get_snapshot_variants(install_dir):
-        notices_dir_per_variant = os.path.join(variant,
-                                               utils.NOTICE_FILES_DIR_NAME)
-        if os.path.isdir(notices_dir_per_variant):
+    for arch in utils.get_snapshot_archs(install_dir):
+        notices_dir_per_arch = os.path.join(arch, utils.NOTICE_FILES_DIR_NAME)
+        if os.path.isdir(notices_dir_per_arch):
             for notice_file in glob.glob(
-                    '{}/*.txt'.format(notices_dir_per_variant)):
+                    '{}/*.txt'.format(notices_dir_per_arch)):
                 if not os.path.isfile(
                         os.path.join(common_notices_dir,
                                      os.path.basename(notice_file))):
                     shutil.copy(notice_file, common_notices_dir)
-            shutil.rmtree(notices_dir_per_variant)
+            shutil.rmtree(notices_dir_per_arch)
 
 
-def revise_ld_config_txt_if_needed(vndk_version):
+def post_processe_files_if_needed(vndk_version):
     """For O-MR1, replaces unversioned VNDK directories with versioned ones.
+    Also, renames ld.config.txt, llndk.libraries.txt and vndksp.libraries.txt
+    files to have version suffix.
 
     Unversioned VNDK directories: /system/${LIB}/vndk[-sp]
     Versioned VNDK directories: /system/${LIB}/vndk[-sp]-27
 
     Args:
-      vndk_version: string, version of VNDK snapshot
+      vndk_version: int, version of VNDK snapshot
     """
-    if vndk_version == '27':
+    def add_version_suffix(file_name):
+        logging.info('Rename {} to have version suffix'.format(vndk_version))
+        target_files = glob.glob(
+            os.path.join(utils.CONFIG_DIR_PATH_PATTERN, file_name))
+        for target_file in target_files:
+            name, ext = os.path.splitext(target_file)
+            os.rename(target_file, name + '.' + str(vndk_version) + ext)
+    if vndk_version == 27:
+        logging.info('Revising ld.config.txt for O-MR1...')
         re_pattern = '(system\/\${LIB}\/vndk(?:-sp)?)([:/]|$)'
         VNDK_INSTALL_DIR_RE = re.compile(re_pattern, flags=re.MULTILINE)
         ld_config_txt_paths = glob.glob(
@@ -149,12 +145,21 @@
             with open(ld_config_file, 'w') as file:
                 file.write(revised)
 
+        files_to_add_version_suffix = ('ld.config.txt',
+                                       'llndk.libraries.txt',
+                                       'vndksp.libraries.txt')
+        for file_to_rename in files_to_add_version_suffix:
+            add_version_suffix(file_to_rename)
+
 
 def update_buildfiles(buildfile_generator):
-    logger().info('Generating Android.mk file...')
-    buildfile_generator.generate_android_mk()
+    logging.info('Generating root Android.bp file...')
+    buildfile_generator.generate_root_android_bp()
 
-    logger().info('Generating Android.bp files...')
+    logging.info('Generating common/Android.bp file...')
+    buildfile_generator.generate_common_android_bp()
+
+    logging.info('Generating Android.bp files...')
     buildfile_generator.generate_android_bp()
 
 
@@ -162,37 +167,48 @@
     try:
         license_checker.check_gpl_projects()
     except ValueError as error:
-        print '***CANNOT INSTALL VNDK SNAPSHOT***', error
+        logging.error('***CANNOT INSTALL VNDK SNAPSHOT***: {}'.format(error))
         raise
 
 
 def commit(branch, build, version):
-    logger().info('Making commit...')
-    check_call(['git', 'add', '.'])
+    logging.info('Making commit...')
+    utils.check_call(['git', 'add', '.'])
     message = textwrap.dedent("""\
         Update VNDK snapshot v{version} to build {build}.
 
         Taken from branch {branch}.""").format(
         version=version, branch=branch, build=build)
-    check_call(['git', 'commit', '-m', message])
+    utils.check_call(['git', 'commit', '-m', message])
 
 
 def get_args():
     parser = argparse.ArgumentParser()
     parser.add_argument(
-        'vndk_version', type=int,
+        'vndk_version',
+        type=int,
         help='VNDK snapshot version to install, e.g. "27".')
     parser.add_argument('-b', '--branch', help='Branch to pull build from.')
     parser.add_argument('--build', help='Build number to pull.')
     parser.add_argument(
-        '--local', action='store_true',
-        help=('Fetch local VNDK snapshot artifacts from DIST_DIR instead of '
-              'Android Build server.'))
+        '--local',
+        help=('Fetch local VNDK snapshot artifacts from specified local '
+              'directory instead of Android Build server. '
+              'Example: --local=/path/to/local/dir'))
     parser.add_argument(
-        '--use-current-branch', action='store_true',
+        '--use-current-branch',
+        action='store_true',
         help='Perform the update in the current branch. Do not repo start.')
     parser.add_argument(
-        '-v', '--verbose', action='count', default=0,
+        '--remote',
+        default='aosp',
+        help=('Remote name to fetch and check if the revision of VNDK snapshot '
+              'is included in the source to conform GPL license. default=aosp'))
+    parser.add_argument(
+        '-v',
+        '--verbose',
+        action='count',
+        default=0,
         help='Increase output verbosity, e.g. "-v", "-vv".')
     return parser.parse_args()
 
@@ -201,22 +217,26 @@
     """Program entry point."""
     args = get_args()
 
+    local = None
     if args.local:
+        local = os.path.expanduser(args.local)
+
+    if local:
         if args.build or args.branch:
             raise ValueError(
                 'When --local option is set, --branch or --build cannot be '
                 'specified.')
-        elif not os.path.isdir(DIST_DIR):
+        elif not os.path.isdir(local):
             raise RuntimeError(
-                'The --local option is set, but DIST_DIR={} does not exist.'.
-                format(DIST_DIR))
+                'The specified local directory, {}, does not exist.'.format(
+                    local))
     else:
         if not (args.build and args.branch):
             raise ValueError(
                 'Please provide both --branch and --build or set --local '
                 'option.')
 
-    vndk_version = str(args.vndk_version)
+    vndk_version = args.vndk_version
 
     install_dir = os.path.join(PREBUILTS_VNDK_DIR, 'v{}'.format(vndk_version))
     if not os.path.isdir(install_dir):
@@ -225,9 +245,7 @@
             'Please request a new git project for prebuilts/vndk/v{ver} '
             'before installing new snapshot.'.format(ver=vndk_version))
 
-    verbose_map = (logging.WARNING, logging.INFO, logging.DEBUG)
-    verbosity = min(args.verbose, 2)
-    logging.basicConfig(level=verbose_map[verbosity])
+    utils.set_logging_config(args.verbose)
 
     os.chdir(install_dir)
 
@@ -238,34 +256,40 @@
     os.makedirs(utils.COMMON_DIR_PATH)
 
     temp_artifact_dir = None
-    if not args.local:
+    if not local:
         temp_artifact_dir = tempfile.mkdtemp()
 
-    install_status = True
     try:
-        install_snapshot(args.branch, args.build, install_dir,
+        install_snapshot(args.branch, args.build, local, install_dir,
                          temp_artifact_dir)
         gather_notice_files(install_dir)
-        revise_ld_config_txt_if_needed(vndk_version)
+        post_processe_files_if_needed(vndk_version)
 
         buildfile_generator = GenBuildFile(install_dir, vndk_version)
         update_buildfiles(buildfile_generator)
 
-        if not args.local:
+        if not local:
             license_checker = GPLChecker(install_dir, ANDROID_BUILD_TOP,
-                                         temp_artifact_dir)
+                                         temp_artifact_dir, args.remote)
             check_gpl_license(license_checker)
-    except:
-        logger().info('FAILED TO INSTALL SNAPSHOT')
-        install_status = False
+            logging.info(
+                'Successfully updated VNDK snapshot v{}'.format(vndk_version))
+    except Exception as error:
+        logging.error('FAILED TO INSTALL SNAPSHOT: {}'.format(error))
+        raise
     finally:
         if temp_artifact_dir:
-            logger().info(
+            logging.info(
                 'Deleting temp_artifact_dir: {}'.format(temp_artifact_dir))
             shutil.rmtree(temp_artifact_dir)
 
-    if not args.local and install_status:
+    if not local:
         commit(args.branch, args.build, vndk_version)
+        logging.info(
+            'Successfully created commit for VNDK snapshot v{}'.format(
+                vndk_version))
+
+    logging.info('Done.')
 
 
 if __name__ == '__main__':
diff --git a/vndk/snapshot/utils.py b/vndk/snapshot/utils.py
index 9190778..7fed128 100644
--- a/vndk/snapshot/utils.py
+++ b/vndk/snapshot/utils.py
@@ -17,6 +17,7 @@
 """Utility functions for VNDK snapshot."""
 
 import glob
+import logging
 import os
 import re
 import subprocess
@@ -24,14 +25,36 @@
 
 # Global Keys
 #   All paths are relative to install_dir: prebuilts/vndk/v{version}
+ROOT_BP_PATH = 'Android.bp'
 COMMON_DIR_NAME = 'common'
 COMMON_DIR_PATH = COMMON_DIR_NAME
-ANDROID_MK_PATH = os.path.join(COMMON_DIR_PATH, 'Android.mk')
+COMMON_BP_PATH = os.path.join(COMMON_DIR_PATH, 'Android.bp')
 CONFIG_DIR_PATH_PATTERN = '*/configs'
 MANIFEST_FILE_NAME = 'manifest.xml'
 MODULE_PATHS_FILE_NAME = 'module_paths.txt'
 NOTICE_FILES_DIR_NAME = 'NOTICE_FILES'
 NOTICE_FILES_DIR_PATH = os.path.join(COMMON_DIR_PATH, NOTICE_FILES_DIR_NAME)
+BINDER32 = 'binder32'
+
+
+def set_logging_config(verbose_level):
+    verbose_map = (logging.WARNING, logging.INFO, logging.DEBUG)
+    verbosity = min(verbose_level, 2)
+    logging.basicConfig(
+        format='%(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
+        level=verbose_map[verbosity])
+
+
+def check_call(cmd):
+    logging.debug('Running `{}`'.format(' '.join(cmd)))
+    subprocess.check_call(cmd)
+
+
+def check_output(cmd):
+    logging.debug('Running `{}`'.format(' '.join(cmd)))
+    output = subprocess.check_output(cmd)
+    logging.debug('Output: `{}`'.format(output))
+    return output
 
 
 def get_android_build_top():
@@ -60,21 +83,21 @@
     return _get_dir_from_env('DIST_DIR', join_realpath(out_dir, 'dist'))
 
 
-def get_snapshot_variants(install_dir):
-    """Returns a list of VNDK snapshot variants under install_dir.
+def get_snapshot_archs(install_dir):
+    """Returns a list of VNDK snapshot arch flavors under install_dir.
 
     Args:
       install_dir: string, absolute path of prebuilts/vndk/v{version}
     """
-    variants = []
+    archs = []
     for file in glob.glob('{}/*'.format(install_dir)):
         basename = os.path.basename(file)
         if os.path.isdir(file) and basename != COMMON_DIR_NAME:
-            variants.append(basename)
-    return variants
+            archs.append(basename)
+    return archs
 
 
-def arch_from_path(path):
+def prebuilt_arch_from_path(path):
     """Extracts arch of prebuilts from path relative to install_dir.
 
     Args:
@@ -86,14 +109,14 @@
     return path.split('/')[1].split('-')[1]
 
 
-def variant_from_path(path):
-    """Extracts VNDK snapshot variant from path relative to install_dir.
+def snapshot_arch_from_path(path):
+    """Extracts VNDK snapshot arch from path relative to install_dir.
 
     Args:
       path: string, path relative to prebuilts/vndk/v{version}
 
     Returns:
-      string, VNDK snapshot variant (e.g. 'arm64')
+      string, VNDK snapshot arch (e.g. 'arm64')
     """
     return path.split('/')[0]
 
@@ -129,5 +152,4 @@
         fetch_artifact_path, '--branch', branch, '--target=vndk', '--bid',
         build, pattern, destination
     ]
-    print 'Running `{}`'.format(' '.join(cmd))
-    subprocess.check_call(cmd)
+    check_call(cmd)
diff --git a/vndk/tools/OWNERS b/vndk/tools/OWNERS
new file mode 100644
index 0000000..85cea27
--- /dev/null
+++ b/vndk/tools/OWNERS
@@ -0,0 +1,2 @@
+per-file * = andrewhsieh@google.com, loganchien@google.com
+per-file build_mixed = jaeshin@google.com, schwartzmi@google.com, justinyun@google.com
diff --git a/vndk/tools/build_mixed b/vndk/tools/build_mixed
index 5ff36d4..09d9292 100755
--- a/vndk/tools/build_mixed
+++ b/vndk/tools/build_mixed
@@ -2,18 +2,27 @@
 usage () {
     echo "Create a Mixed Build archive with the given system and device archives."
     echo
-    echo "Usage: $0 [-v <vendor_version>] [-m <modify_system_image_path>] [-p <override_vbmeta_image_path>]"
-    echo "    system_build_dir device_build_dir out_dir [check_tool]"
+    echo "Usage: $0 [-v <vendor_version>] [-m <modify_system_image_path>]"
+    echo "    [-t <prebuilt_otatools_path>] [-p <override_vbmeta_image_path>]"
+    echo "    [-s] system_build_dir device_build_dir out_dir [check_tool]"
     echo
-    echo "Options -v, -m, -p must precede positional arguments."
+    echo "Options -v, -m, -t, -p, -s must precede positional arguments."
     echo
-    echo "vendor_version is the version of the vendor image when the mixed"
-    echo "    build is inter branch. Optional."
+    echo "vendor_version is the version of the vendor image when Keymaster v3"
+    echo "    related modifications to the system image is necessary. Optional."
     echo "    eg. 8.1.0 for a mixed build of GSI and O-MR1 vendor image."
     echo "modify_system_image_path is the path to the script that modifies the"
-    echo "    system image for an inter branch build target. Optional."
+    echo "    system image, needed for Keymaster v3. Optional."
+    echo "prebuilt_otatools_path is the path to otatools.zip file that has all"
+    echo "    required host binaries to modify system image. Optional."
     echo "override_vbmeta_image_path is the path to a vbmeta.img to use"
     echo "    to override the existing vbmeta.img of device. Optional."
+    echo "-s is used to fetch and flash both product.img and system.img from"
+    echo "    the system_build_dir for devices with a product partition."
+    echo "    product.img will be removed if system_build_dir does not have"
+    echo "    product.img when -s option is declared."
+    echo "    By default, only system.img is flashed to the target device for"
+    echo "    independent system update. No parameter required. Optional"
     echo "system_build_dir is the path to the system build"
     echo "    eg. aosp_arm64_ab-userdebug."
     echo "device_build_dir is the path to the device build"
@@ -41,7 +50,7 @@
 
 trap cleanup_and_exit EXIT
 
-while getopts :v:m:p: opt; do
+while getopts :v:m:p:t:s opt; do
     case "$opt" in
         v)
             readonly VENDOR_VERSION="$OPTARG"
@@ -52,6 +61,12 @@
         p)
             readonly OVERRIDE_VBMETA_IMAGE_PATH="$OPTARG"
             ;;
+        t)
+            readonly OTATOOLS_ZIP="$OPTARG"
+            ;;
+        s)
+            readonly INCLUDE_PRODUCT=true
+            ;;
         \?)
             exit_badparam "Invalid options: -"$OPTARG""
             ;;
@@ -67,14 +82,6 @@
 
 shift "$((OPTIND-1))"
 
-if [[ ! -z "${MODIFY_SYSTEM_SCRIPT+x}" && ! -f "$MODIFY_SYSTEM_SCRIPT" ]]; then
-    exit_badparam "Script not found: "$MODIFY_SYSTEM_SCRIPT""
-fi
-
-if [[ ! -z "${OVERRIDE_VBMETA_IMAGE_PATH+x}" && ! -f "$OVERRIDE_VBMETA_IMAGE_PATH" ]]; then
-    exit_badparam "Specified vbmeta.img not found: "$OVERRIDE_VBMETA_IMAGE_PATH""
-fi
-
 if [[ $# -lt 3 ]]; then
     exit_badparam "Unexpected number of arguments"
 fi
@@ -96,25 +103,47 @@
 fi
 
 readonly DEVICE_TARGET_FILES_ARCHIVE="$(find "$DEVICE_DIR" -name "*-target_files-*.zip" -print)"
-if [[ ! -f "$DEVICE_ARCHIVE" ]]; then
+if [[ ! -f "$DEVICE_TARGET_FILES_ARCHIVE" ]]; then
     exit_badparam "Could not find device target_files archive in $DEVICE_DIR."
 fi
 
+if [[ ! -z "${MODIFY_SYSTEM_SCRIPT+x}" && ! -f "$MODIFY_SYSTEM_SCRIPT" ]]; then
+    exit_badparam "Script not found: "$MODIFY_SYSTEM_SCRIPT""
+fi
+
+if [[ ! -z "${OVERRIDE_VBMETA_IMAGE_PATH+x}" && ! -f "$OVERRIDE_VBMETA_IMAGE_PATH" ]]; then
+    exit_badparam "Specified vbmeta.img not found: "$OVERRIDE_VBMETA_IMAGE_PATH""
+fi
+
 readonly DEVICE_ARTIFACTS_DIR="$TEMP_DIR"/device_archive_artifacts
 readonly DEVICE_IMAGES_DIR="$DEVICE_ARTIFACTS_DIR"/IMAGES
 readonly SYSTEM_ARTIFACTS_DIR="$TEMP_DIR"/system_artifacts
 readonly SYSTEM_IMAGES_DIR="$SYSTEM_ARTIFACTS_DIR"/IMAGES
+readonly OTATOOLS_DIR="$TEMP_DIR"/otatools
 
 readonly SPL_PROPERTY_NAME="ro.build.version.security_patch"
 readonly SYSTEM_BUILD_PROP="SYSTEM/build.prop"
 
 ###
 # Uncompress the archives.
+declare -a EXTRACT_FILE_LIST
+EXTRACT_FILE_LIST=(
+    IMAGES/system.img \
+    IMAGES/vbmeta.img \
+    META/system_matrix.xml \
+    META/system_manifest.xml \
+    "$SYSTEM_BUILD_PROP" \
+)
+
+if [[ "$INCLUDE_PRODUCT" == true ]]; then
+  unzip -l "$SYSTEM_TARGET_FILES_ARCHIVE" | grep -q IMAGES/product.img &&
+  EXTRACT_FILE_LIST+=(IMAGES/product.img)
+fi
+
 mkdir -p "$SYSTEM_ARTIFACTS_DIR"
 # Get the system images and meta data.
-unzip "$SYSTEM_TARGET_FILES_ARCHIVE" \
-  IMAGES/system.img IMAGES/vbmeta.img META/system_matrix.xml META/system_manifest.xml "$SYSTEM_BUILD_PROP" \
-  -d "$SYSTEM_ARTIFACTS_DIR"
+# ${EXTRACT_FILE_LIST[*]} cannot be quoted to list each file for unzipping
+unzip "$SYSTEM_TARGET_FILES_ARCHIVE" ${EXTRACT_FILE_LIST[*]} -d "$SYSTEM_ARTIFACTS_DIR"
 
 mkdir -p "$DEVICE_IMAGES_DIR"
 # Get the device images.
@@ -124,6 +153,15 @@
   META/vendor_matrix.xml META/vendor_manifest.xml "$SYSTEM_BUILD_PROP" \
   -d "$DEVICE_ARTIFACTS_DIR"
 
+if [[ -f "$OTATOOLS_ZIP" ]]; then
+    # Uncompress otatools
+    mkdir -p "$OTATOOLS_DIR"
+    unzip "$OTATOOLS_ZIP" bin/* lib64/* -d "$OTATOOLS_DIR"
+    # Set paths for using prebuilt host binaries.
+    export PATH="$OTATOOLS_DIR"/bin:"$PATH"
+    export LD_LIBRARY_PATH="$OTATOOLS_DIR"/lib64:"$LD_LIBRARY_PATH"
+fi
+
 ###
 # Check compatibility between the system and device.
 if [[ -f "$CHECK_TOOL" ]]; then
@@ -164,6 +202,15 @@
 ###
 # Overwrite artifacts in the device archive to create the Mixed Build artifacts.
 cp "$SYSTEM_IMAGES_DIR"/system.img "$DEVICE_IMAGES_DIR"/
+if [[ "$INCLUDE_PRODUCT" == true ]]; then
+  if [[ -f "$SYSTEM_IMAGES_DIR"/product.img ]]; then
+    cp "$SYSTEM_IMAGES_DIR"/product.img "$DEVICE_IMAGES_DIR"/
+  else
+    rm -f "$DEVICE_IMAGES_DIR"/product.img
+    # Removed product partition from required partition list
+    sed -i "/partition-exists=product$/d" "$DEVICE_IMAGES_DIR"/android-info.txt
+  fi
+fi
 
 # Only override vbmeta if it is already present since fastboot update will try
 # to flash whatever is in the archive.
@@ -190,3 +237,5 @@
 # Overwrite the image archive with the Mixed Build archive.
 OUT_ARCHIVE="$DIST_DIR"/"$(basename $DEVICE_ARCHIVE)"
 cp "$DEVICE_IMAGES_DIR"/mixed.zip "$OUT_ARCHIVE"
+# Overwrite android-info.txt with the updated one.
+cp "$DEVICE_IMAGES_DIR"/android-info.txt "$DIST_DIR"/
diff --git a/vndk/tools/definition-tool/.pylintrc b/vndk/tools/definition-tool/.pylintrc
new file mode 100644
index 0000000..528ac1c
--- /dev/null
+++ b/vndk/tools/definition-tool/.pylintrc
@@ -0,0 +1,8 @@
+[MESSAGES CONTROL]
+
+disable=
+    fixme,
+    invalid-name,
+    missing-docstring,
+    ungrouped-imports,
+    useless-object-inheritance,
diff --git a/vndk/tools/definition-tool/OWNERS b/vndk/tools/definition-tool/OWNERS
new file mode 100644
index 0000000..402c928
--- /dev/null
+++ b/vndk/tools/definition-tool/OWNERS
@@ -0,0 +1,2 @@
+andrewhsieh@google.com
+loganchien@google.com
diff --git a/vndk/tools/definition-tool/datasets/vndk-lib-extra-list-current.txt b/vndk/tools/definition-tool/datasets/vndk-lib-extra-list-current.txt
new file mode 100644
index 0000000..370301f
--- /dev/null
+++ b/vndk/tools/definition-tool/datasets/vndk-lib-extra-list-current.txt
@@ -0,0 +1,49 @@
+FWK-ONLY-RS: libft2.so
+FWK-ONLY-RS: libmediandk.so
+
+LLNDK: libclang_rt.asan-aarch64-android.so
+LLNDK: libclang_rt.asan-arm-android.so
+LLNDK: libclang_rt.asan-i686-android.so
+LLNDK: libclang_rt.asan-mips-android.so
+LLNDK: libclang_rt.asan-mips64-android.so
+LLNDK: libclang_rt.asan-x86_64-android.so
+
+VNDK-core: libclang_rt.scudo-aarch64-android.so
+VNDK-core: libclang_rt.scudo-arm-android.so
+VNDK-core: libclang_rt.scudo-i686-android.so
+VNDK-core: libclang_rt.scudo-x86_64-android.so
+
+VNDK-core: libclang_rt.scudo_minimal-aarch64-android.so
+VNDK-core: libclang_rt.scudo_minimal-arm-android.so
+VNDK-core: libclang_rt.scudo_minimal-i686-android.so
+VNDK-core: libclang_rt.scudo_minimal-x86_64-android.so
+
+VNDK-core: libclang_rt.ubsan_standalone-aarch64-android.so
+VNDK-core: libclang_rt.ubsan_standalone-arm-android.so
+VNDK-core: libclang_rt.ubsan_standalone-i686-android.so
+VNDK-core: libclang_rt.ubsan_standalone-mips-android.so
+VNDK-core: libclang_rt.ubsan_standalone-mips64-android.so
+VNDK-core: libclang_rt.ubsan_standalone-x86_64-android.so
+
+LLNDK-private: ld-android.so
+LLNDK-private: libc_malloc_debug.so
+LLNDK-private: libnetd_client.so
+LLNDK-private: libtextclassifier_hash.so
+
+# Same-Process HAL implementations
+SP-HAL: [regex]^.*/android\.hardware\.graphics\.mapper@\d+\.\d+-impl\.so$
+SP-HAL: [regex]^.*/android\.hardware\.renderscript@1\.0-impl\.so$
+SP-HAL: [regex]^.*/gralloc\..*\.so$
+SP-HAL: [regex]^/vendor/.*/libEGL_.*\.so$
+SP-HAL: [regex]^/vendor/.*/libGLES_.*\.so$
+SP-HAL: [regex]^/vendor/.*/libGLESv1_CM_.*\.so$
+SP-HAL: [regex]^/vendor/.*/libGLESv2_.*\.so$
+SP-HAL: [regex]^/vendor/.*/libGLESv3_.*\.so$
+SP-HAL: [regex]^/vendor/.*/libPVRRS\.so$
+SP-HAL: [regex]^/vendor/.*/libRSDriver.*\.so$
+SP-HAL: [regex]^/vendor/.*/vulkan.*\.so$
+
+# Workaround for degenerated VDNK
+VNDK-SP-private: libartbase.so
+VNDK-SP-private: libdexfile.so
+VNDK-SP-private: libziparchive.so
diff --git a/vndk/tools/definition-tool/templates/vndk.txt b/vndk/tools/definition-tool/templates/vndk.txt
index 0a66671..dd4eb28 100644
--- a/vndk/tools/definition-tool/templates/vndk.txt
+++ b/vndk/tools/definition-tool/templates/vndk.txt
@@ -7,10 +7,21 @@
 
 EXTRA_VENDOR_LIBRARIES := ##_EXTRA_VENDOR_LIBS_##
 
+# FIXME: Generate INSTALL_IN_HW_SUBDIR automatically
+INSTALL_IN_HW_SUBDIR := android.hidl.memory@1.0-impl
+
 
 #-------------------------------------------------------------------------------
 # VNDK Modules
 #-------------------------------------------------------------------------------
+
+# Start from Android P, VNDK directory will always be versioned.
+ifdef PLATFORM_VNDK_VERSION
+VNDK_SP_DIR := vndk-sp-$(PLATFORM_VNDK_VERSION)
+else
+VNDK_SP_DIR := vndk-sp
+endif
+
 LOCAL_PATH := $(call my-dir)
 
 define define-vndk-lib
@@ -23,7 +34,7 @@
 LOCAL_MODULE_TAGS := optional
 LOCAL_INSTALLED_MODULE_STEM := $1.so
 LOCAL_MODULE_SUFFIX := .so
-LOCAL_MODULE_RELATIVE_PATH := $3
+LOCAL_MODULE_RELATIVE_PATH := $3$(if $(filter $1,$(INSTALL_IN_HW_SUBDIR)),/hw)
 LOCAL_VENDOR_MODULE := $4
 include $$(BUILD_PREBUILT)
 
@@ -38,7 +49,7 @@
 LOCAL_MODULE_TAGS := optional
 LOCAL_INSTALLED_MODULE_STEM := $1.so
 LOCAL_MODULE_SUFFIX := .so
-LOCAL_MODULE_RELATIVE_PATH := $3
+LOCAL_MODULE_RELATIVE_PATH := $3$(if $(filter $1,$(INSTALL_IN_HW_SUBDIR)),/hw)
 LOCAL_VENDOR_MODULE := $4
 include $$(BUILD_PREBUILT)
 endif  # TARGET_TRANSLATE_2ND_ARCH is not true
@@ -46,12 +57,14 @@
 endef
 
 $(foreach lib,$(VNDK_SP_LIBRARIES),\
-    $(eval $(call define-vndk-lib,$(lib),vndk-sp-gen,vndk-sp,)))
+    $(eval $(call define-vndk-lib,$(lib),vndk-sp-gen,$(VNDK_SP_DIR),)))
 $(foreach lib,$(VNDK_SP_EXT_LIBRARIES),\
-    $(eval $(call define-vndk-lib,$(lib),vndk-sp-ext-gen,vndk-sp,true)))
+    $(eval $(call define-vndk-lib,$(lib),vndk-sp-ext-gen,$(VNDK_SP_DIR),true)))
 $(foreach lib,$(EXTRA_VENDOR_LIBRARIES),\
     $(eval $(call define-vndk-lib,$(lib),vndk-ext-gen,,true)))
 
+VNDK_SP_DIR :=
+
 
 #-------------------------------------------------------------------------------
 # Phony Package
@@ -66,4 +79,10 @@
     $(addsuffix .vndk-ext-gen,$(EXTRA_VENDOR_LIBRARIES))
 include $(BUILD_PHONY_PACKAGE)
 
+# Unset variables
+VNDK_SP_LIBRARIES :=
+VNDK_SP_EXT_LIBRARIES :=
+EXTRA_VENDOR_LIBRARIES :=
+INSTALL_IN_HW_SUBDIR :=
+
 endif  # ifneq ($(filter $(YOUR_DEVICE_NAME),$(TARGET_DEVICE)),)
diff --git a/vndk/tools/definition-tool/tests/compat.py b/vndk/tools/definition-tool/tests/compat.py
index 9f41853..8981237 100644
--- a/vndk/tools/definition-tool/tests/compat.py
+++ b/vndk/tools/definition-tool/tests/compat.py
@@ -1,39 +1,52 @@
 #!/usr/bin/env python3
 
-import os
+# pylint: disable=unused-import,import-error
+
 import sys
 
+
 try:
     from tempfile import TemporaryDirectory
 except ImportError:
     import shutil
     import tempfile
 
+
     class TemporaryDirectory(object):
         def __init__(self, suffix='', prefix='tmp', dir=None):
+            # pylint: disable=redefined-builtin
             self.name = tempfile.mkdtemp(suffix, prefix, dir)
 
+
         def __del__(self):
             self.cleanup()
 
+
         def __enter__(self):
             return self.name
 
+
         def __exit__(self, exc, value, tb):
             self.cleanup()
 
+
         def cleanup(self):
             if self.name:
                 shutil.rmtree(self.name)
                 self.name = None
 
+
 if sys.version_info >= (3, 0):
     from os import makedirs
 else:
+    import os
+
+
     def makedirs(path, exist_ok):
         if exist_ok and os.path.exists(path):
             return
-        return os.makedirs(path)
+        os.makedirs(path)
+
 
 if sys.version_info >= (3, 0):
     from io import StringIO
@@ -45,6 +58,8 @@
     from unittest.mock import patch
 except ImportError:
     import contextlib
+
+
     @contextlib.contextmanager
     def patch(target, mock):
         obj, attr = target.rsplit('.')
@@ -55,3 +70,20 @@
             yield
         finally:
             setattr(obj, attr, original_value)
+
+
+if sys.version_info >= (3, 2):
+    from unittest import TestCase
+else:
+    import unittest
+
+
+    class TestCase(unittest.TestCase):
+        def assertRegex(self, text, expected_regex, msg=None):
+            # pylint: disable=deprecated-method
+            self.assertRegexpMatches(text, expected_regex, msg)
+
+
+        def assertNotRegex(self, text, unexpected_regex, msg=None):
+            # pylint: disable=deprecated-method
+            self.assertNotRegexpMatches(text, unexpected_regex, msg)
diff --git a/vndk/tools/definition-tool/tests/ndk_toolchain.py b/vndk/tools/definition-tool/tests/ndk_toolchain.py
old mode 100755
new mode 100644
index 8ad9144..e040787
--- a/vndk/tools/definition-tool/tests/ndk_toolchain.py
+++ b/vndk/tools/definition-tool/tests/ndk_toolchain.py
@@ -2,13 +2,13 @@
 
 from __future__ import print_function
 
-import argparse
 import collections
 import os
 import re
 import subprocess
 import sys
 
+
 def detect_ndk_dir():
     ndk_dir = os.getenv('NDK')
     if not ndk_dir:
@@ -28,6 +28,7 @@
 
     return ndk_dir
 
+
 def detect_api_level(ndk_dir):
     try:
         apis = []
@@ -42,6 +43,7 @@
     except IOError:
         raise ValueError('failed to find latest api')
 
+
 def detect_host():
     if sys.platform.startswith('linux'):
         return 'linux-x86_64'
@@ -49,15 +51,19 @@
         return 'darwin-x86_64'
     raise NotImplementedError('unknown host platform')
 
+
 def get_gcc_dir(ndk_dir, arch, host):
     return os.path.join(ndk_dir, 'toolchains', arch, 'prebuilt', host)
 
+
 def get_clang_dir(ndk_dir, host):
     return os.path.join(ndk_dir, 'toolchains', 'llvm', 'prebuilt', host)
 
+
 def get_platform_dir(ndk_dir, api, subdirs):
     return os.path.join(ndk_dir, 'platforms', api, *subdirs)
 
+
 class Target(object):
     def __init__(self, name, triple, cflags, ldflags, gcc_toolchain_dir,
                  clang_dir, ndk_include, ndk_lib):
@@ -71,6 +77,7 @@
         self.ndk_include = ndk_include
         self.ndk_lib = ndk_lib
 
+
     def check_paths(self):
         def check_path(path):
             if os.path.exists(path):
@@ -79,7 +86,7 @@
             return False
 
         ld_exeutable = os.path.join(
-                self.gcc_toolchain_dir, 'bin', self.target_triple + '-ld')
+            self.gcc_toolchain_dir, 'bin', self.target_triple + '-ld')
 
         success = check_path(self.gcc_toolchain_dir)
         success &= check_path(ld_exeutable)
@@ -88,6 +95,7 @@
         success &= check_path(self.ndk_lib)
         return success
 
+
     def compile(self, obj_file, src_file, cflags):
         clang = os.path.join(self.clang_dir, 'bin', 'clang')
 
@@ -100,6 +108,7 @@
         cmd.extend(self.target_cflags)
         subprocess.check_call(cmd)
 
+
     def link(self, out_file, obj_files, ldflags):
         if '-shared' in ldflags:
             crtbegin = os.path.join(self.ndk_lib, 'crtbegin_so.o')
@@ -124,6 +133,7 @@
             cmd.append('-Wl,-pie')
         subprocess.check_call(cmd)
 
+
 def create_targets(ndk_dir=None, api=None, host=None):
     if ndk_dir is None:
         ndk_dir = detect_ndk_dir()
@@ -135,68 +145,47 @@
     targets = collections.OrderedDict()
 
     targets['arm'] = Target(
-            'arm', 'arm-linux-androideabi', [],[],
-            get_gcc_dir(ndk_dir, 'arm-linux-androideabi-4.9', host),
-            get_clang_dir(ndk_dir, host),
-            get_platform_dir(ndk_dir, api, ['arch-arm', 'usr', 'include']),
-            get_platform_dir(ndk_dir, api, ['arch-arm', 'usr', 'lib']))
+        'arm', 'arm-linux-androideabi', [], [],
+        get_gcc_dir(ndk_dir, 'arm-linux-androideabi-4.9', host),
+        get_clang_dir(ndk_dir, host),
+        get_platform_dir(ndk_dir, api, ['arch-arm', 'usr', 'include']),
+        get_platform_dir(ndk_dir, api, ['arch-arm', 'usr', 'lib']))
 
     targets['arm64'] = Target(
-            'arm64', 'aarch64-linux-android', [], [],
-            get_gcc_dir(ndk_dir, 'aarch64-linux-android-4.9', host),
-            get_clang_dir(ndk_dir, host),
-            get_platform_dir(ndk_dir, api, ['arch-arm64', 'usr', 'include']),
-            get_platform_dir(ndk_dir, api, ['arch-arm64', 'usr', 'lib']))
+        'arm64', 'aarch64-linux-android', [], [],
+        get_gcc_dir(ndk_dir, 'aarch64-linux-android-4.9', host),
+        get_clang_dir(ndk_dir, host),
+        get_platform_dir(ndk_dir, api, ['arch-arm64', 'usr', 'include']),
+        get_platform_dir(ndk_dir, api, ['arch-arm64', 'usr', 'lib']))
 
     targets['x86'] = Target(
-            'x86', 'i686-linux-android', ['-m32'], ['-m32'],
-            get_gcc_dir(ndk_dir, 'x86-4.9', host),
-            get_clang_dir(ndk_dir, host),
-            get_platform_dir(ndk_dir, api, ['arch-x86', 'usr', 'include']),
-            get_platform_dir(ndk_dir, api, ['arch-x86', 'usr', 'lib']))
+        'x86', 'i686-linux-android', ['-m32'], ['-m32'],
+        get_gcc_dir(ndk_dir, 'x86-4.9', host),
+        get_clang_dir(ndk_dir, host),
+        get_platform_dir(ndk_dir, api, ['arch-x86', 'usr', 'include']),
+        get_platform_dir(ndk_dir, api, ['arch-x86', 'usr', 'lib']))
 
     targets['x86_64'] = Target(
-            'x86_64', 'x86_64-linux-android', ['-m64'], ['-m64'],
-            get_gcc_dir(ndk_dir, 'x86_64-4.9', host),
-            get_clang_dir(ndk_dir, host),
-            get_platform_dir(ndk_dir, api, ['arch-x86_64', 'usr', 'include']),
-            get_platform_dir(ndk_dir, api, ['arch-x86_64', 'usr', 'lib64']))
+        'x86_64', 'x86_64-linux-android', ['-m64'], ['-m64'],
+        get_gcc_dir(ndk_dir, 'x86_64-4.9', host),
+        get_clang_dir(ndk_dir, host),
+        get_platform_dir(ndk_dir, api, ['arch-x86_64', 'usr', 'include']),
+        get_platform_dir(ndk_dir, api, ['arch-x86_64', 'usr', 'lib64']))
 
     targets['mips'] = Target(
-            'mips', 'mipsel-linux-android', [], [],
-            get_gcc_dir(ndk_dir, 'mipsel-linux-android-4.9', host),
-            get_clang_dir(ndk_dir, host),
-            get_platform_dir(ndk_dir, api, ['arch-mips', 'usr', 'include']),
-            get_platform_dir(ndk_dir, api, ['arch-mips', 'usr', 'lib']))
+        'mips', 'mipsel-linux-android', [], [],
+        get_gcc_dir(ndk_dir, 'mipsel-linux-android-4.9', host),
+        get_clang_dir(ndk_dir, host),
+        get_platform_dir(ndk_dir, api, ['arch-mips', 'usr', 'include']),
+        get_platform_dir(ndk_dir, api, ['arch-mips', 'usr', 'lib']))
 
     targets['mips64'] = Target(
-            'mips64', 'mips64el-linux-android',
-            ['-march=mips64el', '-mcpu=mips64r6'],
-            ['-march=mips64el', '-mcpu=mips64r6'],
-            get_gcc_dir(ndk_dir, 'mips64el-linux-android-4.9', host),
-            get_clang_dir(ndk_dir, host),
-            get_platform_dir(ndk_dir, api, ['arch-mips64', 'usr', 'include']),
-            get_platform_dir(ndk_dir, api, ['arch-mips64', 'usr', 'lib64']))
+        'mips64', 'mips64el-linux-android',
+        ['-march=mips64el', '-mcpu=mips64r6'],
+        ['-march=mips64el', '-mcpu=mips64r6'],
+        get_gcc_dir(ndk_dir, 'mips64el-linux-android-4.9', host),
+        get_clang_dir(ndk_dir, host),
+        get_platform_dir(ndk_dir, api, ['arch-mips64', 'usr', 'include']),
+        get_platform_dir(ndk_dir, api, ['arch-mips64', 'usr', 'lib64']))
 
     return targets
-
-def main():
-    parser = argparse.ArgumentParser(
-            description='Dry-run NDK toolchain detection')
-    parser.add_argument('--ndk-dir')
-    parser.add_argument('--api-level')
-    parser.add_argument('--host')
-    args = parser.parse_args()
-
-    targets = create_targets(args.ndk_dir, args.api_level, args.host)
-
-    success = True
-    for name, target in targets.items():
-        success &= target.check_paths()
-    if not success:
-        sys.exit(1)
-
-    print('succeed')
-
-if __name__ == '__main__':
-    main()
diff --git a/vndk/tools/definition-tool/tests/run.py b/vndk/tools/definition-tool/tests/run.py
deleted file mode 100755
index 2d2352b..0000000
--- a/vndk/tools/definition-tool/tests/run.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python3
-
-import argparse
-import os
-import unittest
-
-def main():
-    parser = argparse.ArgumentParser()
-    parser.add_argument('--verbose', '-v', action='store_true')
-    args = parser.parse_args()
-
-    verbosity = 2 if args.verbose else 1
-
-    loader = unittest.TestLoader()
-    tests = loader.discover(os.path.dirname(__file__), 'test_*.py')
-    runner = unittest.runner.TextTestRunner(verbosity=verbosity)
-    runner.run(tests)
-
-if __name__ == '__main__':
-    main()
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh b/vndk/tools/definition-tool/tests/run.sh
similarity index 95%
copy from vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
copy to vndk/tools/definition-tool/tests/run.sh
index bc94afc..3a31145 100755
--- a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
+++ b/vndk/tools/definition-tool/tests/run.sh
@@ -16,5 +16,7 @@
 # limitations under the License.
 #
 
+cd "$(dirname "$0")/.."
+
 python3 -m unittest discover "$@"
 python -m unittest discover "$@"
diff --git a/vndk/tools/definition-tool/tests/test_command_deps_insight.py b/vndk/tools/definition-tool/tests/test_command_deps_insight.py
old mode 100755
new mode 100644
index d0b0bb1..37e7b4e
--- a/vndk/tools/definition-tool/tests/test_command_deps_insight.py
+++ b/vndk/tools/definition-tool/tests/test_command_deps_insight.py
@@ -2,16 +2,13 @@
 
 from __future__ import print_function
 
-import os
-import sys
 import unittest
 
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-from compat import StringIO, patch
 from vndk_definition_tool import (
     DepsInsightCommand, ModuleInfo, PT_SYSTEM, PT_VENDOR)
-from utils import GraphBuilder
+
+from .compat import StringIO, patch
+from .utils import GraphBuilder
 
 
 class DepsInsightCommandTest(unittest.TestCase):
@@ -48,41 +45,63 @@
 
 
     def test_serialize_data_with_all_deps(self):
-        """compute_degenerated_vndk() should not remove bad dependencies from
-        the output of deps-insight.  This test checks the existance of bad
-        dependencies."""
+        # compute_degenerated_vndk() should not remove bad dependencies from
+        # the output of deps-insight.  This test checks the existance of bad
+        # dependencies.
 
         gb = GraphBuilder()
-        libfwk = gb.add_lib32(PT_SYSTEM, 'libfwk')
-        libvndk = gb.add_lib32(PT_SYSTEM, 'libvndk',
-                               dt_needed=['libvnd_bad.so'], extra_dir='vndk')
-        libvndk_sp = gb.add_lib32(PT_SYSTEM, 'libutils',
-                                  dt_needed=['libvnd_bad.so'],
-                                  extra_dir='vndk-sp')
-        libvnd = gb.add_lib32(PT_VENDOR, 'libvnd',
-                              dt_needed=['libvndk.so', 'libutils.so'])
-        libvnd_bad = gb.add_lib32(PT_VENDOR, 'libvnd_bad', extra_dir='vndk-sp')
+
+        libsystem = gb.add_lib32(PT_SYSTEM, 'libsystem')
+
+        libsystem2 = gb.add_lib32(
+            PT_SYSTEM, 'libsystem2', dt_needed=['libsystem.so'])
+
+        libvndk = gb.add_lib32(
+            PT_SYSTEM, 'libvndk', dt_needed=['libvendor_bad.so'],
+            extra_dir='vndk')
+
+        libvendor = gb.add_lib32(
+            PT_VENDOR, 'libvendor', dt_needed=['libvndk.so'])
+
+        libvendor_bad = gb.add_lib32(
+            PT_VENDOR, 'libvendor_bad', extra_dir='vndk')
+
         gb.resolve()
 
         with patch('sys.stderr', StringIO()):
             vndk_sets = gb.graph.compute_degenerated_vndk(set(), None)
 
-        self.assertNotIn(libvnd_bad, libvndk.deps_good)
-        self.assertNotIn(libvnd_bad, libvndk_sp.deps_good)
+        self.assertNotIn(libvendor_bad, libvndk.deps_good)
 
         strs, mods = DepsInsightCommand.serialize_data(
-                list(gb.graph.all_libs()), vndk_sets, ModuleInfo())
+            list(gb.graph.all_libs()), vndk_sets, ModuleInfo())
 
+        # libsystem
+        deps = self._get_module_deps(strs, mods, libsystem.path)
+        self.assertFalse(deps)
+        users = self._get_module_users(strs, mods, libsystem.path)
+        self.assertIn(libsystem2.path, users)
+
+        # libsystem2
+        deps = self._get_module_deps(strs, mods, libsystem2.path)
+        self.assertIn(libsystem.path, deps)
+        users = self._get_module_users(strs, mods, libsystem2.path)
+        self.assertFalse(users)
+
+        # libvndk
         deps = self._get_module_deps(strs, mods, libvndk.path)
-        self.assertIn(libvnd_bad.path, deps)
+        self.assertIn(libvendor_bad.path, deps)
+        users = self._get_module_users(strs, mods, libvndk.path)
+        self.assertIn(libvendor.path, users)
 
-        deps = self._get_module_deps(strs, mods, libvndk_sp.path)
-        self.assertIn(libvnd_bad.path, deps)
+        # libvendor
+        deps = self._get_module_deps(strs, mods, libvendor.path)
+        self.assertIn(libvndk.path, deps)
+        users = self._get_module_users(strs, mods, libvendor.path)
+        self.assertFalse(users)
 
-        users = self._get_module_users(strs, mods, libvnd_bad.path)
+        # libvendor_bad
+        deps = self._get_module_deps(strs, mods, libvendor_bad.path)
+        self.assertFalse(deps)
+        users = self._get_module_users(strs, mods, libvendor_bad.path)
         self.assertIn(libvndk.path, users)
-        self.assertIn(libvndk_sp.path, users)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/definition-tool/tests/test_dex_file.py b/vndk/tools/definition-tool/tests/test_dex_file.py
old mode 100755
new mode 100644
index d8a4fba..9c09ced
--- a/vndk/tools/definition-tool/tests/test_dex_file.py
+++ b/vndk/tools/definition-tool/tests/test_dex_file.py
@@ -4,14 +4,12 @@
 
 import os
 import subprocess
-import sys
 import unittest
 import zipfile
 
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from vndk_definition_tool import DexFileReader, UnicodeSurrogateDecodeError
 
-from compat import TemporaryDirectory
-from vndk_definition_tool import DexFileReader
+from .compat import TemporaryDirectory
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
 INPUT_DIR = os.path.join(SCRIPT_DIR, 'testdata', 'test_dex_file')
@@ -42,6 +40,28 @@
                          b'\xed\xa0\x81\xed\xb0\x80'.decode('mutf-8'))
 
 
+    def test_decode_exception(self):
+        # Low surrogate does not come after high surrogate
+        with self.assertRaises(UnicodeSurrogateDecodeError):
+            b'\xed\xa0\x81\x40'.decode('mutf-8')
+
+        # Low surrogate without prior high surrogate
+        with self.assertRaises(UnicodeSurrogateDecodeError):
+            b'\xed\xb0\x80\x40'.decode('mutf-8')
+
+        # Unexpected end after high surrogate
+        with self.assertRaises(UnicodeSurrogateDecodeError):
+            b'\xed\xa0\x81'.decode('mutf-8')
+
+        # Unexpected end after low surrogate
+        with self.assertRaises(UnicodeSurrogateDecodeError):
+            b'\xed\xb0\x80'.decode('mutf-8')
+
+        # Out-of-order surrogate
+        with self.assertRaises(UnicodeSurrogateDecodeError):
+            b'\xed\xb0\x80\xed\xa0\x81'.decode('mutf-8')
+
+
 class DexFileTest(unittest.TestCase):
     def _assemble_smali(self, dest, source):
         """Assemble a smali source file.  Skip the test if the smali command is
@@ -77,8 +97,8 @@
 
             strs = set(DexFileReader.enumerate_dex_strings_buf(buf))
 
-            self.assertIn('hello', strs)
-            self.assertIn('world', strs)
+            self.assertIn(b'hello', strs)
+            self.assertIn(b'world', strs)
 
 
     def test_enumerate_dex_strings_apk(self):
@@ -96,11 +116,7 @@
 
             strs = set(DexFileReader.enumerate_dex_strings_apk(zip_file))
 
-            self.assertIn('hello', strs)
-            self.assertIn('world', strs)
-            self.assertIn('foo', strs)
-            self.assertIn('bar', strs)
-
-
-if __name__ == '__main__':
-    unittest.main()
+            self.assertIn(b'hello', strs)
+            self.assertIn(b'world', strs)
+            self.assertIn(b'foo', strs)
+            self.assertIn(b'bar', strs)
diff --git a/vndk/tools/definition-tool/tests/test_elf.py b/vndk/tools/definition-tool/tests/test_elf.py
old mode 100755
new mode 100644
index a45fb58..035a1af
--- a/vndk/tools/definition-tool/tests/test_elf.py
+++ b/vndk/tools/definition-tool/tests/test_elf.py
@@ -2,16 +2,14 @@
 
 from __future__ import print_function
 
-import os
-import sys
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
 import tempfile
 import unittest
 
-from compat import StringIO
 from vndk_definition_tool import Elf_Sym, ELF
 
+from .compat import StringIO
+
+
 class ElfSymTest(unittest.TestCase):
     def setUp(self):
         self.sym_local = Elf_Sym(0, 0, 4, 0, 0, 1)
@@ -19,21 +17,25 @@
         self.sym_weak = Elf_Sym(0, 0, 4, 33, 0, 1)
         self.sym_undef = Elf_Sym(0, 0, 4, 16, 0, 0)
 
+
     def test_is_local(self):
         self.assertTrue(self.sym_local.is_local)
         self.assertFalse(self.sym_global.is_local)
         self.assertFalse(self.sym_weak.is_local)
 
+
     def test_is_global(self):
         self.assertFalse(self.sym_local.is_global)
         self.assertTrue(self.sym_global.is_global)
         self.assertFalse(self.sym_weak.is_global)
 
+
     def test_is_weak(self):
         self.assertFalse(self.sym_local.is_weak)
         self.assertFalse(self.sym_global.is_weak)
         self.assertTrue(self.sym_weak.is_weak)
 
+
     def test_is_undef(self):
         self.assertFalse(self.sym_global.is_undef)
         self.assertTrue(self.sym_undef.is_undef)
@@ -44,12 +46,14 @@
         self.assertEqual(ELF.ELFCLASS32, ELF.get_ei_class_from_name('32'))
         self.assertEqual(ELF.ELFCLASS64, ELF.get_ei_class_from_name('64'))
 
+
     def test_get_ei_data_from_name(self):
         self.assertEqual(ELF.ELFDATA2LSB,
                          ELF.get_ei_data_from_name('Little-Endian'))
         self.assertEqual(ELF.ELFDATA2MSB,
                          ELF.get_ei_data_from_name('Big-Endian'))
 
+
     def test_get_e_machine_from_name(self):
         self.assertEqual(0, ELF.get_e_machine_from_name('EM_NONE'))
         self.assertEqual(3, ELF.get_e_machine_from_name('EM_386'))
@@ -58,6 +62,7 @@
         self.assertEqual(62, ELF.get_e_machine_from_name('EM_X86_64'))
         self.assertEqual(183, ELF.get_e_machine_from_name('EM_AARCH64'))
 
+
     def test_repr(self):
         elf = ELF()
         self.assertEqual(elf, eval(repr(elf)))
@@ -67,6 +72,7 @@
                   dt_needed=['c', 'd'], exported_symbols={'e', 'f', 'g'})
         self.assertEqual(elf, eval(repr(elf)))
 
+
     def test_class_name(self):
         self.assertEqual('None', ELF().elf_class_name)
 
@@ -80,6 +86,7 @@
         self.assertFalse(elf.is_32bit)
         self.assertTrue(elf.is_64bit)
 
+
     def test_endianness(self):
         self.assertEqual('None', ELF().elf_data_name)
         self.assertEqual('Little-Endian',
@@ -87,6 +94,7 @@
         self.assertEqual('Big-Endian',
                          ELF(None, ELF.ELFDATA2MSB).elf_data_name)
 
+
     def test_machine_name(self):
         self.assertEqual('EM_NONE', ELF(e_machine=0).elf_machine_name)
         self.assertEqual('EM_386', ELF(e_machine=3).elf_machine_name)
@@ -95,6 +103,7 @@
         self.assertEqual('EM_X86_64', ELF(e_machine=62).elf_machine_name)
         self.assertEqual('EM_AARCH64', ELF(e_machine=183).elf_machine_name)
 
+
     def test_dt_rpath_runpath(self):
         elf = ELF()
         self.assertEqual([], elf.dt_rpath)
@@ -104,6 +113,7 @@
         self.assertEqual(['a'], elf.dt_rpath)
         self.assertEqual(['b'], elf.dt_runpath)
 
+
     def test_dump(self):
         elf = ELF(ELF.ELFCLASS32, ELF.ELFDATA2LSB, 183, ['a'], ['b'],
                   ['libc.so', 'libm.so'], {'hello', 'world'}, {'d', 'e'})
@@ -130,6 +140,7 @@
                          'IMP_SYMBOL\te\n',
                          actual_output)
 
+
     def test_parse_dump_file(self):
         data = ('EI_CLASS\t64\n'
                 'EI_DATA\t\tLittle-Endian\n'
@@ -190,6 +201,7 @@
         elf = ELF(dt_needed=['libc.so'])
         self.assertFalse(elf.is_jni_lib())
 
+
     def test_jni_symbols(self):
         elf = ELF(imported_symbols={'JNI_CreateJavaVM'})
         self.assertTrue(elf.is_jni_lib())
@@ -208,7 +220,3 @@
 
         elf = ELF(exported_symbols={'printf'})
         self.assertFalse(elf.is_jni_lib())
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/definition-tool/tests/test_elf_link_data.py b/vndk/tools/definition-tool/tests/test_elf_link_data.py
old mode 100755
new mode 100644
index e850307..7191919
--- a/vndk/tools/definition-tool/tests/test_elf_link_data.py
+++ b/vndk/tools/definition-tool/tests/test_elf_link_data.py
@@ -2,10 +2,6 @@
 
 from __future__ import print_function
 
-import os
-import sys
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
 import unittest
 
 from vndk_definition_tool import ELFLinkData, PT_SYSTEM, PT_VENDOR
@@ -25,6 +21,7 @@
         self.z.add_needed_dep(self.w)
         self.z.add_dlopen_dep(self.w)
 
+
     def test_add_dep_and_accessors(self):
         self.assertIn(self.y, self.x.deps_needed_all)
         self.assertIn(self.x, self.y.users_needed_all)
@@ -36,6 +33,7 @@
         self.assertNotIn(self.z, self.x.deps_needed_all)
         self.assertNotIn(self.x, self.z.users_needed_all)
 
+
     def test_remove_dep(self):
         self.assertIn(self.y, self.x.deps_needed_all)
         self.assertIn(self.x, self.y.users_needed_all)
@@ -51,6 +49,7 @@
         self.assertNotIn(self.y, self.x.deps_needed)
         self.assertNotIn(self.x, self.y.users_needed)
 
+
     def test_num_deps(self):
         self.assertEqual(2, self.x.num_deps)
         self.assertEqual(0, self.y.num_deps)
@@ -60,6 +59,7 @@
         # NEEDED and DLOPEN are counted twice.
         self.assertEqual(2, self.z.num_deps)
 
+
     def test_num_users(self):
         self.assertEqual(0, self.x.num_users)
         self.assertEqual(1, self.y.num_users)
@@ -69,22 +69,26 @@
         # NEEDED and DLOPEN are counted twice.
         self.assertEqual(2, self.w.num_users)
 
+
     def test_has_dep(self):
         self.assertTrue(self.x.has_dep(self.y))
         self.assertTrue(self.x.has_dep(self.z))
         self.assertFalse(self.x.has_dep(self.x))
         self.assertFalse(self.x.has_dep(self.w))
 
+
     def test_has_user(self):
         self.assertTrue(self.y.has_user(self.x))
         self.assertTrue(self.z.has_user(self.x))
         self.assertFalse(self.x.has_user(self.x))
         self.assertFalse(self.w.has_user(self.x))
 
+
     def test_is_system_lib(self):
         self.assertTrue(self.x.is_system_lib())
         self.assertFalse(self.v.is_system_lib())
 
+
     def test_get_dep_linked_symbols(self):
         self.x.linked_symbols['c'] = self.y
         self.x.linked_symbols['b'] = self.y
@@ -100,7 +104,3 @@
 
         self.assertEqual(['w', 'x', 'y', 'z'],
                          self.x.get_dep_linked_symbols(self.z))
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/definition-tool/tests/test_elf_linker.py b/vndk/tools/definition-tool/tests/test_elf_linker.py
old mode 100755
new mode 100644
index 01038a0..ba2c9a8
--- a/vndk/tools/definition-tool/tests/test_elf_linker.py
+++ b/vndk/tools/definition-tool/tests/test_elf_linker.py
@@ -1,23 +1,16 @@
 #!/usr/bin/env python3
 
-import os
 import re
-import sys
 import tempfile
-import unittest
 
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-from compat import StringIO, patch
-from utils import GraphBuilder
 from vndk_definition_tool import (
-    ELF, ELFLinker, GenericRefs, PT_SYSTEM, PT_VENDOR, VNDKLibDir)
+    ELF, GenericRefs, PT_SYSTEM, PT_VENDOR, VNDKLibDir)
+
+from .compat import StringIO, TestCase, patch
+from .utils import GraphBuilder
 
 
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-
-
-class ELFLinkerTest(unittest.TestCase):
+class ELFLinkerTest(TestCase):
     def _create_normal_graph(self):
         gb = GraphBuilder()
 
@@ -102,7 +95,6 @@
 
     def test_deps(self):
         gb = self._create_normal_graph()
-        graph = gb.graph
 
         # Check the dependencies of libc.so.
         node = gb.graph.get_lib('/system/lib/libc.so')
@@ -323,6 +315,7 @@
 
         # Create generic reference.
         class MockGenericRefs(object):
+            # pylint: disable=too-few-public-methods
             def classify_lib(self, lib):
                 if 'libllvm_vendor' in lib.path:
                     return GenericRefs.NEW_LIB
@@ -393,36 +386,36 @@
         libc_32, libc_64 = gb.add_multilib(PT_SYSTEM, 'libc')
 
         libvndk_a_32, libvndk_a_64 = gb.add_multilib(
-                PT_SYSTEM, 'libvndk_a', extra_dir='vndk-28',
-                dt_needed=['libc.so', 'libvndk_b.so', 'libvndk_sp_b.so'])
+            PT_SYSTEM, 'libvndk_a', extra_dir='vndk-28',
+            dt_needed=['libc.so', 'libvndk_b.so', 'libvndk_sp_b.so'])
 
         libvndk_b_32, libvndk_b_64 = gb.add_multilib(
-                PT_SYSTEM, 'libvndk_b', extra_dir='vndk-28',
-                dt_needed=['libc.so', 'libvndk_sp_b.so'])
+            PT_SYSTEM, 'libvndk_b', extra_dir='vndk-28',
+            dt_needed=['libc.so', 'libvndk_sp_b.so'])
 
         libvndk_c_32, libvndk_c_64 = gb.add_multilib(
-                PT_VENDOR, 'libvndk_c', extra_dir='vndk-28',
-                dt_needed=['libc.so', 'libvndk_d.so', 'libvndk_sp_d.so'])
+            PT_VENDOR, 'libvndk_c', extra_dir='vndk-28',
+            dt_needed=['libc.so', 'libvndk_d.so', 'libvndk_sp_d.so'])
 
         libvndk_d_32, libvndk_d_64 = gb.add_multilib(
-                PT_VENDOR, 'libvndk_d', extra_dir='vndk-28',
-                dt_needed=['libc.so', 'libvndk_sp_d.so'])
+            PT_VENDOR, 'libvndk_d', extra_dir='vndk-28',
+            dt_needed=['libc.so', 'libvndk_sp_d.so'])
 
         libvndk_sp_a_32, libvndk_sp_a_64 = gb.add_multilib(
-                PT_SYSTEM, 'libvndk_sp_a', extra_dir='vndk-sp-28',
-                dt_needed=['libc.so', 'libvndk_sp_b.so'])
+            PT_SYSTEM, 'libvndk_sp_a', extra_dir='vndk-sp-28',
+            dt_needed=['libc.so', 'libvndk_sp_b.so'])
 
         libvndk_sp_b_32, libvndk_sp_b_64 = gb.add_multilib(
-                PT_SYSTEM, 'libvndk_sp_b', extra_dir='vndk-sp-28',
-                dt_needed=['libc.so'])
+            PT_SYSTEM, 'libvndk_sp_b', extra_dir='vndk-sp-28',
+            dt_needed=['libc.so'])
 
         libvndk_sp_c_32, libvndk_sp_c_64 = gb.add_multilib(
-                PT_VENDOR, 'libvndk_sp_c', extra_dir='vndk-sp-28',
-                dt_needed=['libc.so', 'libvndk_sp_d.so'])
+            PT_VENDOR, 'libvndk_sp_c', extra_dir='vndk-sp-28',
+            dt_needed=['libc.so', 'libvndk_sp_d.so'])
 
         libvndk_sp_d_32, libvndk_sp_d_64 = gb.add_multilib(
-                PT_VENDOR, 'libvndk_sp_d', extra_dir='vndk-sp-28',
-                dt_needed=['libc.so'])
+            PT_VENDOR, 'libvndk_sp_d', extra_dir='vndk-sp-28',
+            dt_needed=['libc.so'])
 
         gb.resolve(VNDKLibDir.create_from_version('28'), '28')
 
@@ -467,7 +460,7 @@
         self.assertIn(libvndk_sp_d_64, libvndk_sp_c_64.deps_all)
 
 
-class ELFLinkerDlopenDepsTest(unittest.TestCase):
+class ELFLinkerDlopenDepsTest(TestCase):
     def test_add_dlopen_deps(self):
         gb = GraphBuilder()
         liba = gb.add_lib32(PT_SYSTEM, 'liba')
@@ -548,8 +541,8 @@
 
     def test_add_dlopen_deps_error(self):
         gb = GraphBuilder()
-        liba = gb.add_lib32(PT_SYSTEM, 'liba')
-        libb = gb.add_lib32(PT_SYSTEM, 'libb')
+        gb.add_lib32(PT_SYSTEM, 'liba')
+        gb.add_lib32(PT_SYSTEM, 'libb')
         gb.resolve()
 
         with tempfile.NamedTemporaryFile(mode='w') as tmp_file:
@@ -560,11 +553,7 @@
             with patch('sys.stderr', stderr):
                 gb.graph.add_dlopen_deps(tmp_file.name)
 
-            self.assertRegexpMatches(
-                    stderr.getvalue(),
-                    'error:' + re.escape(tmp_file.name) + ':1: ' +
-                    'Failed to add dlopen dependency from .* to .*\\.\n')
-
-
-if __name__ == '__main__':
-    unittest.main()
+            self.assertRegex(
+                stderr.getvalue(),
+                'error:' + re.escape(tmp_file.name) + ':1: ' +
+                'Failed to add dlopen dependency from .* to .*\\.\n')
diff --git a/vndk/tools/definition-tool/tests/test_elf_resolver.py b/vndk/tools/definition-tool/tests/test_elf_resolver.py
old mode 100755
new mode 100644
index 020ba5c..f6257f5
--- a/vndk/tools/definition-tool/tests/test_elf_resolver.py
+++ b/vndk/tools/definition-tool/tests/test_elf_resolver.py
@@ -2,14 +2,11 @@
 
 from __future__ import print_function
 
-import os
-import sys
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
 import unittest
 
 from vndk_definition_tool import ELFResolver
 
+
 class ELFResolverTest(unittest.TestCase):
     def setUp(self):
         lib_set = {
@@ -24,49 +21,72 @@
 
         self.resolver = ELFResolver(lib_set, ['/system/lib', '/vendor/lib'])
 
+
     def test_get_candidates(self):
         r = self.resolver
 
         self.assertEqual(
-                ['/system/lib/libx.so', '/vendor/lib/libx.so'],
-                list(r.get_candidates('libx.so')))
+            ['/system/lib/libx.so', '/vendor/lib/libx.so'],
+            list(r.get_candidates('/system/lib/libreq.so', 'libx.so')))
 
         self.assertEqual(
-                ['/C/libx.so', '/system/lib/libx.so', '/vendor/lib/libx.so'],
-                list(r.get_candidates('libx.so', ['/C'])))
+            ['/C/libx.so', '/system/lib/libx.so', '/vendor/lib/libx.so'],
+            list(r.get_candidates('/system/lib/libreq.so', 'libx.so', ['/C'])))
 
         self.assertEqual(
-                ['/C/libx.so', '/D/libx.so', '/system/lib/libx.so',
-                 '/vendor/lib/libx.so'],
-                list(r.get_candidates('libx.so', ['/C', '/D'])))
+            ['/C/libx.so', '/D/libx.so', '/system/lib/libx.so',
+             '/vendor/lib/libx.so'],
+            list(r.get_candidates('/system/lib/libreq.so', 'libx.so',
+                                  ['/C', '/D'])))
 
         self.assertEqual(
-                ['/E/libx.so', '/system/lib/libx.so', '/vendor/lib/libx.so'],
-                list(r.get_candidates('libx.so', None, ['/E'])))
+            ['/E/libx.so', '/system/lib/libx.so', '/vendor/lib/libx.so'],
+            list(r.get_candidates('/system/lib/libreq.so', 'libx.so', None,
+                                  ['/E'])))
 
         self.assertEqual(
-                ['/E/libx.so', '/F/libx.so', '/system/lib/libx.so',
-                 '/vendor/lib/libx.so'],
-                list(r.get_candidates('libx.so', None, ['/E', '/F'])))
+            ['/E/libx.so', '/F/libx.so', '/system/lib/libx.so',
+             '/vendor/lib/libx.so'],
+            list(r.get_candidates('/system/lib/libreq.so', 'libx.so', None,
+                                  ['/E', '/F'])))
 
         self.assertEqual(
-                ['/C/libx.so', '/D/libx.so', '/E/libx.so', '/F/libx.so',
-                 '/system/lib/libx.so', '/vendor/lib/libx.so'],
-                list(r.get_candidates('libx.so', ['/C', '/D'], ['/E', '/F'])))
+            ['/C/libx.so', '/D/libx.so', '/E/libx.so', '/F/libx.so',
+             '/system/lib/libx.so', '/vendor/lib/libx.so'],
+            list(r.get_candidates('/system/lib/libreq.so', 'libx.so',
+                                  ['/C', '/D'], ['/E', '/F'])))
+
+        # Test app-specific search paths.
+        self.assertEqual(
+            ['/system/app/example/lib/armeabi-v7a/libx.so',
+             '/C/libx.so', '/D/libx.so', '/E/libx.so', '/F/libx.so',
+             '/system/lib/libx.so', '/vendor/lib/libx.so'],
+            list(r.get_candidates(
+                '/system/app/example/lib/armeabi-v7a/libreq.so',
+                'libx.so',
+                ['/C', '/D'], ['/E', '/F'])))
+
 
     def test_resolve(self):
         r = self.resolver
-        self.assertEqual('a', r.resolve('liba.so'))
-        self.assertEqual('c', r.resolve('libc.so'))
+        self.assertEqual('a', r.resolve('/system/lib/libreq.so', 'liba.so'))
+        self.assertEqual('c', r.resolve('/system/lib/libreq.so', 'libc.so'))
 
-        self.assertEqual(None, r.resolve('libe.so'))
-        self.assertEqual('e', r.resolve('libe.so', dt_rpath=['/system/lib/hw']))
+        self.assertEqual(None, r.resolve('/system/lib/libreq.so', 'libe.so'))
         self.assertEqual(
-                'e', r.resolve('libe.so', dt_runpath=['/system/lib/hw']))
+            'e',
+            r.resolve('/system/lib/libreq.so', 'libe.so',
+                      dt_rpath=['/system/lib/hw']))
+        self.assertEqual(
+            'e',
+            r.resolve('/system/lib/libreq.so', 'libe.so',
+                      dt_runpath=['/system/lib/hw']))
 
-        self.assertEqual('a2', r.resolve('liba.so', dt_rpath=['/vendor/lib']))
-        self.assertEqual('a2', r.resolve('liba.so', dt_runpath=['/vendor/lib']))
-
-
-if __name__ == '__main__':
-    unittest.main()
+        self.assertEqual(
+            'a2',
+            r.resolve('/system/lib/libreq.so', 'liba.so',
+                      dt_rpath=['/vendor/lib']))
+        self.assertEqual(
+            'a2',
+            r.resolve('/system/lib/libreq.so', 'liba.so',
+                      dt_runpath=['/vendor/lib']))
diff --git a/vndk/tools/definition-tool/tests/test_elfdump.py b/vndk/tools/definition-tool/tests/test_elfdump.py
old mode 100755
new mode 100644
index 2c0b230..18db2fd
--- a/vndk/tools/definition-tool/tests/test_elfdump.py
+++ b/vndk/tools/definition-tool/tests/test_elfdump.py
@@ -2,23 +2,20 @@
 
 from __future__ import print_function
 
-import argparse
-import collections
-import difflib
 import os
 import re
 import subprocess
 import sys
 import unittest
 
-from compat import TemporaryDirectory, makedirs
-import ndk_toolchain
+from .compat import TemporaryDirectory, makedirs
+from .ndk_toolchain import create_targets
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
 VNDK_DEF_TOOL = os.path.join(SCRIPT_DIR, '..', 'vndk_definition_tool.py')
 
-INPUT_DIR = os.path.join(SCRIPT_DIR ,'testdata', 'test_elfdump', 'input')
+INPUT_DIR = os.path.join(SCRIPT_DIR, 'testdata', 'test_elfdump', 'input')
 EXPECTED_DIR = os.path.join(SCRIPT_DIR, 'testdata', 'test_elfdump', 'expected')
 test_dir_base = None
 
@@ -31,7 +28,7 @@
 class ELFDumpTest(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
-        cls.targets = ndk_toolchain.create_targets()
+        cls.targets = create_targets()
 
         if test_dir_base:
             cls.test_dir_base = test_dir_base
@@ -41,11 +38,13 @@
 
         cls._build_fixtures(cls.target_name)
 
+
     @classmethod
     def tearDownClass(cls):
         if not test_dir_base:
             cls.tmp_dir.cleanup()
 
+
     @classmethod
     def _build_fixtures(cls, target_name):
         target = cls.targets[target_name]
@@ -97,6 +96,7 @@
                     ['-shared', '-lc', '-Wl,-rpath,/system/lib:/vendor/lib',
                      '-Wl,--enable-new-dtags'])
 
+
     def _remove_size_lines(self, lines):
         """Remove file size information because they may vary."""
         prefixes = (
@@ -109,6 +109,7 @@
         patt = re.compile('|'.join('(?:' + re.escape(x) +')' for x in prefixes))
         return [line for line in lines if not patt.match(line)]
 
+
     def _assert_equal_to_file(self, expected_file_name, actual):
         actual = actual.splitlines(True)
         expected_file_path = os.path.join(self.expected_dir, expected_file_name)
@@ -117,10 +118,12 @@
         self.assertEqual(self._remove_size_lines(expected),
                          self._remove_size_lines(actual))
 
+
     def _test_main_out(self):
         out_file = os.path.join(self.test_dir, 'main.out')
         self._assert_equal_to_file('main.out.txt', run_elf_dump(out_file))
 
+
     def _test_libtest(self, expected_file_name, lib_name):
         lib_file = os.path.join(self.test_dir, lib_name)
         self._assert_equal_to_file(expected_file_name, run_elf_dump(lib_file))
@@ -149,38 +152,15 @@
 
     class_name = 'ELFDumpTest_' + target_name
     globals()[class_name] = type(
-            class_name, (ELFDumpTest,),
-            dict(test_main=test_main,
-                 test_libtest=test_libtest,
-                 test_libtest_rpath=test_libtest_rpath,
-                 test_libtest_rpath_multi=test_libtest_rpath_multi,
-                 test_libtest_runpath=test_libtest_runpath,
-                 test_libtest_runpath_multi=test_libtest_runpath_multi,
-                 target_name=target_name))
+        class_name, (ELFDumpTest,),
+        dict(test_main=test_main,
+             test_libtest=test_libtest,
+             test_libtest_rpath=test_libtest_rpath,
+             test_libtest_rpath_multi=test_libtest_rpath_multi,
+             test_libtest_runpath=test_libtest_runpath,
+             test_libtest_runpath_multi=test_libtest_runpath_multi,
+             target_name=target_name))
 
 
 for target in ('arm', 'arm64', 'mips', 'mips64', 'x86', 'x86_64'):
     create_target_test(target)
-
-
-def main():
-    # Parse command line arguments.
-    parser = argparse.ArgumentParser()
-    parser.add_argument('--test-dir', help='directory for temporary files')
-    parser.add_argument('--expected-dir', help='directory with expected output')
-    args, unittest_args = parser.parse_known_args()
-
-    # Convert command line options.
-    global expected_dir
-    global test_dir_base
-
-    if args.expected_dir:
-        expected_dir = args.expected_dir
-    if args.test_dir:
-        test_dir_base = args.test_dir
-
-    # Run unit test.
-    unittest.main(argv=[sys.argv[0]] + unittest_args)
-
-if __name__ == '__main__':
-    main()
diff --git a/vndk/tools/definition-tool/tests/test_generic_refs.py b/vndk/tools/definition-tool/tests/test_generic_refs.py
old mode 100755
new mode 100644
index c887d19..2448169
--- a/vndk/tools/definition-tool/tests/test_generic_refs.py
+++ b/vndk/tools/definition-tool/tests/test_generic_refs.py
@@ -3,13 +3,8 @@
 from __future__ import print_function
 
 import os
-import sys
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-import argparse
 import unittest
 
-from compat import TemporaryDirectory, makedirs
 from vndk_definition_tool import GenericRefs
 
 
@@ -17,11 +12,13 @@
 
 
 class MockELF(object):
+    # pylint: disable=too-few-public-methods
     def __init__(self, exported_symbols):
         self.exported_symbols = exported_symbols
 
 
 class MockLib(object):
+    # pylint: disable=too-few-public-methods
     def __init__(self, path, exported_symbols):
         self.path = path
         self.elf = MockELF(exported_symbols)
@@ -39,6 +36,7 @@
         self.ref.add('/system/lib64/libm.so',
                      MockELF({'cos', 'sin', 'tan'}))
 
+
     def test_create_from_sym_dir(self):
         input_dir = os.path.join(SCRIPT_DIR, 'testdata', 'test_generic_refs')
 
@@ -60,6 +58,7 @@
         self.assertEqual({'cos', 'sin', 'tan'},
                          g.refs['/system/lib64/libm.so'].exported_symbols)
 
+
     def test_classify_lib(self):
         libc_sub = MockLib('/system/lib/libc.so', {'fclose', 'fopen', 'fread'})
         libc_sup = MockLib('/system/lib/libc.so',
@@ -75,6 +74,7 @@
                          self.ref.classify_lib(libc_eq))
         self.assertEqual(GenericRefs.NEW_LIB, self.ref.classify_lib(libfoo))
 
+
     def test_is_equivalent_lib(self):
         libc_sub = MockLib('/system/lib/libc.so', {'fclose', 'fopen', 'fread'})
         libc_sup = MockLib('/system/lib/libc.so',
@@ -87,12 +87,9 @@
 
         self.assertTrue(self.ref.is_equivalent_lib(libc_eq))
 
+
     def test_has_same_name_lib(self):
         self.assertTrue(self.ref.has_same_name_lib(
             MockLib('/vendor/lib/libc.so', {})))
         self.assertFalse(self.ref.has_same_name_lib(
             MockLib('/vendor/lib/lib_does_not_exist.so', {})))
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/definition-tool/tests/test_module_info.py b/vndk/tools/definition-tool/tests/test_module_info.py
old mode 100755
new mode 100644
index 2da17b4..b9a7cdd
--- a/vndk/tools/definition-tool/tests/test_module_info.py
+++ b/vndk/tools/definition-tool/tests/test_module_info.py
@@ -3,9 +3,6 @@
 from __future__ import print_function
 
 import os
-import sys
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
 import unittest
 
 from vndk_definition_tool import ModuleInfo
@@ -18,6 +15,7 @@
         m = ModuleInfo.load_from_path_or_default(None)
         self.assertEqual([], m.get_module_path('/system/lib64/libA.so'))
 
+
     def test_get_module_path(self):
         json_path = os.path.join(SCRIPT_DIR, 'testdata', 'test_module_info',
                                  'module-info.json')
@@ -33,8 +31,4 @@
                          m.get_module_path('/system/lib64/hw/libC.so'))
 
         self.assertEqual(
-                [], m.get_module_path('/system/lib64/libdoes_not_exist.so'))
-
-
-if __name__ == '__main__':
-    unittest.main()
+            [], m.get_module_path('/system/lib64/libdoes_not_exist.so'))
diff --git a/vndk/tools/definition-tool/tests/test_tagged_dict.py b/vndk/tools/definition-tool/tests/test_tagged_dict.py
old mode 100755
new mode 100644
index 58ec396..1dce19b
--- a/vndk/tools/definition-tool/tests/test_tagged_dict.py
+++ b/vndk/tools/definition-tool/tests/test_tagged_dict.py
@@ -2,17 +2,14 @@
 
 from __future__ import print_function
 
-import os
-import sys
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
 import tempfile
 import unittest
 
-from compat import StringIO
 from vndk_definition_tool import TaggedDict, TaggedPathDict, TaggedLibDict, \
                                  NUM_PARTITIONS, PT_SYSTEM, PT_VENDOR
 
+from .compat import StringIO
+
 
 _TEST_DATA = '''Path,Tag
 /system/lib/lib_ll_ndk.so,ll-ndk
@@ -103,37 +100,38 @@
         tagged_paths = TaggedPathDict()
 
         self.assertEqual(
-                ['/system/lib/libc.so'],
-                list(tagged_paths._enumerate_paths('/system/lib/libc.so')))
+            ['/system/lib/libc.so'],
+            list(tagged_paths._enumerate_paths('/system/lib/libc.so')))
 
         self.assertEqual(
-                ['/system/lib/libc.so', '/system/lib64/libc.so'],
-                list(tagged_paths._enumerate_paths('/system/${LIB}/libc.so')))
+            ['/system/lib/libc.so', '/system/lib64/libc.so'],
+            list(tagged_paths._enumerate_paths('/system/${LIB}/libc.so')))
 
         self.assertEqual(
-                ['/system/lib/vndk/libutils.so',
-                 '/system/lib64/vndk/libutils.so'],
-                list(tagged_paths._enumerate_paths(
-                    '/system/${LIB}/vndk${VNDK_VER}/libutils.so')))
+            ['/system/lib/vndk/libutils.so',
+             '/system/lib64/vndk/libutils.so'],
+            list(tagged_paths._enumerate_paths(
+                '/system/${LIB}/vndk${VNDK_VER}/libutils.so')))
 
         tagged_paths = TaggedPathDict(['current', '27', '28'])
 
         self.assertEqual(
-                ['/system/lib/vndk/libutils.so',
-                 '/system/lib64/vndk/libutils.so',
-                 '/system/lib/vndk-27/libutils.so',
-                 '/system/lib64/vndk-27/libutils.so',
-                 '/system/lib/vndk-28/libutils.so',
-                 '/system/lib64/vndk-28/libutils.so'],
-                list(tagged_paths._enumerate_paths(
-                    '/system/${LIB}/vndk${VNDK_VER}/libutils.so')))
+            ['/system/lib/vndk/libutils.so',
+             '/system/lib64/vndk/libutils.so',
+             '/system/lib/vndk-27/libutils.so',
+             '/system/lib64/vndk-27/libutils.so',
+             '/system/lib/vndk-28/libutils.so',
+             '/system/lib64/vndk-28/libutils.so'],
+            list(tagged_paths._enumerate_paths(
+                '/system/${LIB}/vndk${VNDK_VER}/libutils.so')))
 
         self.assertEqual(
-                ['/system/lib/vndk/libutils.so',
-                 '/system/lib/vndk-27/libutils.so',
-                 '/system/lib/vndk-28/libutils.so'],
-                list(tagged_paths._enumerate_paths(
-                    '/system/lib/vndk${VNDK_VER}/libutils.so')))
+            ['/system/lib/vndk/libutils.so',
+             '/system/lib/vndk-27/libutils.so',
+             '/system/lib/vndk-28/libutils.so'],
+            list(tagged_paths._enumerate_paths(
+                '/system/lib/vndk${VNDK_VER}/libutils.so')))
+
 
     def test_load_from_csv_empty(self):
         try:
@@ -218,8 +216,8 @@
         self.assertEqual('vndk_sp_indirect',
                          d.get_path_tag('/system/lib/lib_vndk_sp_indirect.so'))
         self.assertEqual(
-                'vndk_sp_indirect_private',
-                d.get_path_tag('/system/lib/lib_vndk_sp_indirect_private.so'))
+            'vndk_sp_indirect_private',
+            d.get_path_tag('/system/lib/lib_vndk_sp_indirect_private.so'))
         self.assertEqual('vndk', d.get_path_tag('/system/lib/lib_vndk.so'))
         self.assertEqual('fwk_only',
                          d.get_path_tag('/system/lib/lib_fwk_only.so'))
@@ -368,17 +366,19 @@
     def __init__(self):
         self.lib_pt = [dict() for i in range(NUM_PARTITIONS)]
 
+
     def add(self, path):
         partition = PT_VENDOR if path.startswith('/vendor') else PT_SYSTEM
         lib = MockELFLinkData(path)
         self.lib_pt[partition][path] = lib
         return lib
 
+
     def compute_sp_lib(self, generic_refs=None):
         vendor_libs = self.lib_pt[PT_VENDOR].values()
         return MockSPLibResult(
-                set(v for v in vendor_libs if 'lib_sp_hal.so' in v.path),
-                set(v for v in vendor_libs if 'lib_sp_hal_dep.so' in v.path))
+            set(v for v in vendor_libs if 'lib_sp_hal.so' in v.path),
+            set(v for v in vendor_libs if 'lib_sp_hal_dep.so' in v.path))
 
 
 class TaggedLibDictTest(unittest.TestCase):
@@ -389,13 +389,13 @@
 
         self.lib_ll_ndk = self.graph.add('/system/lib/lib_ll_ndk.so')
         self.lib_ll_ndk_indirect = \
-                self.graph.add('/system/lib/lib_ll_ndk_indirect.so')
+            self.graph.add('/system/lib/lib_ll_ndk_indirect.so')
 
         self.lib_vndk_sp = self.graph.add('/system/lib/lib_vndk_sp.so')
         self.lib_vndk_sp_indirect = \
-                self.graph.add('/system/lib/lib_vndk_sp_indirect.so')
+            self.graph.add('/system/lib/lib_vndk_sp_indirect.so')
         self.lib_vndk_sp_indirect_private = \
-                self.graph.add('/system/lib/lib_vndk_sp_indirect_private.so')
+            self.graph.add('/system/lib/lib_vndk_sp_indirect_private.so')
 
         self.lib_vndk = self.graph.add('/system/lib/lib_vndk.so')
 
@@ -408,7 +408,7 @@
         self.lib_vnd_only = self.graph.add('/vendor/lib/lib_vnd_only.so')
 
         self.tagged_libs = TaggedLibDict.create_from_graph(
-                self.graph, self.tagged_paths)
+            self.graph, self.tagged_paths)
 
 
     def test_create_from_graph(self):
@@ -456,7 +456,3 @@
         self.assertEqual('fwk_only', tag)
         tag = d.get_path_tag(MockELFLinkData('/vendor/lib/unknown.so'))
         self.assertEqual('vnd_only', tag)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/definition-tool/tests/test_vndk.py b/vndk/tools/definition-tool/tests/test_vndk.py
old mode 100755
new mode 100644
index 196a15b..ac55f8f
--- a/vndk/tools/definition-tool/tests/test_vndk.py
+++ b/vndk/tools/definition-tool/tests/test_vndk.py
@@ -2,18 +2,13 @@
 
 from __future__ import print_function
 
-import os
-import sys
-import unittest
+from vndk_definition_tool import (PT_SYSTEM, PT_VENDOR)
 
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-from compat import StringIO, patch
-from vndk_definition_tool import (ELF, ELFLinker, PT_SYSTEM, PT_VENDOR)
-from utils import GraphBuilder
+from .compat import StringIO, TestCase, patch
+from .utils import GraphBuilder
 
 
-class ELFLinkerVNDKTest(unittest.TestCase):
+class ELFLinkerVNDKTest(TestCase):
     def test_normalize_partition_tags_bad_vendor_deps(self):
         """Check whether normalize_partition_tags() hides the dependencies from
         the system partition to the vendor partition if the dependencies are
@@ -31,10 +26,10 @@
         with patch('sys.stderr', stderr):
             gb.graph.normalize_partition_tags(set(), None)
 
-        self.assertRegexpMatches(
-                stderr.getvalue(),
-                'error: .*: system exe/lib must not depend on vendor lib .*.  '
-                'Assume such dependency does not exist.')
+        self.assertRegex(
+            stderr.getvalue(),
+            'error: .*: system exe/lib must not depend on vendor lib .*.  '
+            'Assume such dependency does not exist.')
 
         self.assertNotIn(libvnd, libfwk.deps_needed)
         self.assertNotIn(libfwk, libvnd.users_needed)
@@ -74,7 +69,7 @@
         """Check the computation of vndk without generic references."""
 
         gb = GraphBuilder()
-        libfwk = gb.add_lib32(PT_SYSTEM, 'libfwk')
+        gb.add_lib32(PT_SYSTEM, 'libfwk')
         libvndk = gb.add_lib32(PT_SYSTEM, 'libvndk', extra_dir='vndk')
         libvndk_sp = gb.add_lib32(PT_SYSTEM, 'libutils', extra_dir='vndk-sp')
         libvnd = gb.add_lib32(PT_VENDOR, 'libvnd',
@@ -94,15 +89,17 @@
         """Check the computation of vndk without generic references."""
 
         gb = GraphBuilder()
-        libfwk = gb.add_lib32(PT_SYSTEM, 'libfwk')
-        libvndk = gb.add_lib32(PT_SYSTEM, 'libvndk',
-                               dt_needed=['libvnd_bad.so'], extra_dir='vndk')
-        libvndk_sp = gb.add_lib32(PT_SYSTEM, 'libutils',
-                                  dt_needed=['libvnd_bad.so'],
-                                  extra_dir='vndk-sp')
-        libvnd = gb.add_lib32(PT_VENDOR, 'libvnd',
-                              dt_needed=['libvndk.so', 'libutils.so'])
+
+        libvndk = gb.add_lib32(
+            PT_SYSTEM, 'libvndk', dt_needed=['libvnd_bad.so'],
+            extra_dir='vndk')
+
+        libvndk_sp = gb.add_lib32(
+            PT_SYSTEM, 'libutils', dt_needed=['libvnd_bad.so'],
+            extra_dir='vndk-sp')
+
         libvnd_bad = gb.add_lib32(PT_VENDOR, 'libvnd_bad', extra_dir='vndk-sp')
+
         gb.resolve()
 
         self.assertIn(libvnd_bad, libvndk.deps_all)
@@ -136,7 +133,3 @@
         self.assertIn(libEGL_chipset, vndk_sets.sp_hal)
 
         self.assertNotIn(libEGL_chipset, vndk_sets.ll_ndk_indirect)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/definition-tool/tests/test_vndk_lib_dir.py b/vndk/tools/definition-tool/tests/test_vndk_lib_dir.py
old mode 100755
new mode 100644
index 0a323e5..a1a2a8c
--- a/vndk/tools/definition-tool/tests/test_vndk_lib_dir.py
+++ b/vndk/tools/definition-tool/tests/test_vndk_lib_dir.py
@@ -2,13 +2,11 @@
 
 import os
 import posixpath
-import sys
 import unittest
 
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from vndk_definition_tool import VNDKLibDir
 
-from compat import StringIO
-from vndk_definition_tool import ELF, VNDKLibDir
+from .compat import StringIO
 
 
 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -22,92 +20,92 @@
 
     def test_create_vndk_sp_dir_name(self):
         self.assertEqual(
-                'vndk-sp', VNDKLibDir.create_vndk_sp_dir_name('current'))
+            'vndk-sp', VNDKLibDir.create_vndk_sp_dir_name('current'))
         self.assertEqual(
-                'vndk-sp-28', VNDKLibDir.create_vndk_sp_dir_name('28'))
+            'vndk-sp-28', VNDKLibDir.create_vndk_sp_dir_name('28'))
 
 
     def test_create_vndk_dir_name(self):
         self.assertEqual(
-                'vndk', VNDKLibDir.create_vndk_dir_name('current'))
+            'vndk', VNDKLibDir.create_vndk_dir_name('current'))
         self.assertEqual(
-                'vndk-28', VNDKLibDir.create_vndk_dir_name('28'))
+            'vndk-28', VNDKLibDir.create_vndk_dir_name('28'))
 
 
     def test_extract_vndk_version_from_name(self):
         self.assertEqual(
-                'current', VNDKLibDir.extract_version_from_name('vndk'))
+            'current', VNDKLibDir.extract_version_from_name('vndk'))
         self.assertEqual(
-                'current', VNDKLibDir.extract_version_from_name('vndk-sp'))
+            'current', VNDKLibDir.extract_version_from_name('vndk-sp'))
         self.assertEqual(
-                '28', VNDKLibDir.extract_version_from_name('vndk-28'))
+            '28', VNDKLibDir.extract_version_from_name('vndk-28'))
         self.assertEqual(
-                '28', VNDKLibDir.extract_version_from_name('vndk-sp-28'))
+            '28', VNDKLibDir.extract_version_from_name('vndk-sp-28'))
         self.assertEqual(
-                'p', VNDKLibDir.extract_version_from_name('vndk-p'))
+            'p', VNDKLibDir.extract_version_from_name('vndk-p'))
         self.assertEqual(
-                'p', VNDKLibDir.extract_version_from_name('vndk-sp-p'))
+            'p', VNDKLibDir.extract_version_from_name('vndk-sp-p'))
 
 
     def test_extract_vndk_version_from_path(self):
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/vndk/libexample.so')
+            '/system/lib64/vndk/libexample.so')
         self.assertEqual('current', ans)
 
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/vndk-sp/libexample.so')
+            '/system/lib64/vndk-sp/libexample.so')
         self.assertEqual('current', ans)
 
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/vndk-28/libexample.so')
+            '/system/lib64/vndk-28/libexample.so')
         self.assertEqual('28', ans)
 
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/vndk-sp-28/libexample.so')
+            '/system/lib64/vndk-sp-28/libexample.so')
         self.assertEqual('28', ans)
 
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/vndk-p/libexample.so')
+            '/system/lib64/vndk-p/libexample.so')
         self.assertEqual('p', ans)
 
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/vndk-sp-p/libexample.so')
+            '/system/lib64/vndk-sp-p/libexample.so')
         self.assertEqual('p', ans)
 
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/vndk-sp-p/hw/libexample.so')
+            '/system/lib64/vndk-sp-p/hw/libexample.so')
         self.assertEqual('p', ans)
 
         ans = VNDKLibDir.extract_version_from_path(
-                '/system/lib64/libexample.so')
+            '/system/lib64/libexample.so')
         self.assertEqual(None, ans)
 
 
     def test_is_in_vndk_sp_dir(self):
         self.assertFalse(VNDKLibDir.is_in_vndk_sp_dir('/system/lib/liba.so'))
         self.assertFalse(
-                VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk/liba.so'))
+            VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk/liba.so'))
         self.assertFalse(
-                VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-28/liba.so'))
+            VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-28/liba.so'))
         self.assertFalse(
-                VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-spec/liba.so'))
+            VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-spec/liba.so'))
         self.assertTrue(
-                VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-sp/liba.so'))
+            VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-sp/liba.so'))
         self.assertTrue(
-                VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-sp-28/liba.so'))
+            VNDKLibDir.is_in_vndk_sp_dir('/system/lib/vndk-sp-28/liba.so'))
 
 
     def test_is_in_vndk_dir(self):
         self.assertFalse(VNDKLibDir.is_in_vndk_dir('/system/lib/liba.so'))
         self.assertTrue(VNDKLibDir.is_in_vndk_dir('/system/lib/vndk/liba.so'))
         self.assertTrue(
-                VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-28/liba.so'))
+            VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-28/liba.so'))
         self.assertTrue(
-                VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-spec/liba.so'))
+            VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-spec/liba.so'))
         self.assertFalse(
-                VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-sp/liba.so'))
+            VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-sp/liba.so'))
         self.assertFalse(
-                VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-sp-28/liba.so'))
+            VNDKLibDir.is_in_vndk_dir('/system/lib/vndk-sp-28/liba.so'))
 
 
     def test_create_vndk_search_paths(self):
@@ -126,7 +124,7 @@
                 ]
 
                 vndk_sp_dirs, vndk_dirs = \
-                        VNDKLibDir.create_vndk_search_paths(lib_dir, version)
+                    VNDKLibDir.create_vndk_search_paths(lib_dir, version)
                 self.assertEqual(expected_vndk_sp, vndk_sp_dirs)
                 self.assertEqual(expected_vndk, vndk_dirs)
 
@@ -139,35 +137,34 @@
 
     def test_create_from_dirs_unversioned(self):
         input_dir = os.path.join(
-                SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir',
-                'vndk_unversioned')
+            SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir', 'vndk_unversioned')
 
         vndk_lib_dirs = VNDKLibDir.create_from_dirs(
-                [os.path.join(input_dir, 'system')],
-                [os.path.join(input_dir, 'vendor')])
+            [os.path.join(input_dir, 'system')],
+            [os.path.join(input_dir, 'vendor')])
 
         self.assertIn('current', vndk_lib_dirs)
 
 
     def test_create_from_dirs_versioned(self):
         input_dir = os.path.join(
-                SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir', 'vndk_versioned')
+            SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir', 'vndk_versioned')
 
         vndk_lib_dirs = VNDKLibDir.create_from_dirs(
-                [os.path.join(input_dir, 'system')],
-                [os.path.join(input_dir, 'vendor')])
+            [os.path.join(input_dir, 'system')],
+            [os.path.join(input_dir, 'vendor')])
 
         self.assertIn('28', vndk_lib_dirs)
 
 
     def test_create_from_dirs_versioned_multiple(self):
         input_dir = os.path.join(
-                SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir',
-                'vndk_versioned_multiple')
+            SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir',
+            'vndk_versioned_multiple')
 
         vndk_lib_dirs = VNDKLibDir.create_from_dirs(
-                [os.path.join(input_dir, 'system')],
-                [os.path.join(input_dir, 'vendor')])
+            [os.path.join(input_dir, 'system')],
+            [os.path.join(input_dir, 'vendor')])
 
         self.assertIn('28', vndk_lib_dirs)
         self.assertIn('29', vndk_lib_dirs)
@@ -175,11 +172,11 @@
 
     def test_create_from_dirs_versioned_32bit_only(self):
         input_dir = os.path.join(
-                SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir', 'vndk_32')
+            SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir', 'vndk_32')
 
         vndk_lib_dirs = VNDKLibDir.create_from_dirs(
-                [os.path.join(input_dir, 'system')],
-                [os.path.join(input_dir, 'vendor')])
+            [os.path.join(input_dir, 'system')],
+            [os.path.join(input_dir, 'vendor')])
 
         self.assertIn('28', vndk_lib_dirs)
 
@@ -196,8 +193,8 @@
 
     def test_get_ro_vndk_version(self):
         input_dir = os.path.join(
-                SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir',
-                'vndk_versioned_multiple')
+            SCRIPT_DIR, 'testdata', 'test_vndk_lib_dir',
+            'vndk_versioned_multiple')
 
         vendor_dirs = [os.path.join(input_dir, 'vendor')]
 
@@ -206,22 +203,17 @@
 
     def test_sorted_versions(self):
         self.assertEqual(
-                ['20', '10', '2', '1'],
-                VNDKLibDir.sorted_version(['1', '2', '10', '20']))
+            ['20', '10', '2', '1'],
+            VNDKLibDir.sorted_version(['1', '2', '10', '20']))
 
         self.assertEqual(
-                ['b', 'a', '20', '10', '2', '1'],
-                VNDKLibDir.sorted_version(['1', '2', '10', '20', 'a', 'b']))
+            ['b', 'a', '20', '10', '2', '1'],
+            VNDKLibDir.sorted_version(['1', '2', '10', '20', 'a', 'b']))
 
         self.assertEqual(
-                ['a', '10b', '10', '2', '1'],
-                VNDKLibDir.sorted_version(['1', '2', '10', 'a', '10b']))
+            ['a', '10b', '10', '2', '1'],
+            VNDKLibDir.sorted_version(['1', '2', '10', 'a', '10b']))
 
         self.assertEqual(
-                ['current', 'd', 'a', '10', '1'],
-                VNDKLibDir.sorted_version(['1', '10', 'a', 'd', 'current']))
-
-
-
-if __name__ == '__main__':
-    unittest.main()
+            ['current', 'd', 'a', '10', '1'],
+            VNDKLibDir.sorted_version(['1', '10', 'a', 'd', 'current']))
diff --git a/vndk/tools/definition-tool/tests/utils.py b/vndk/tools/definition-tool/tests/utils.py
index 6c61a34..2781233 100644
--- a/vndk/tools/definition-tool/tests/utils.py
+++ b/vndk/tools/definition-tool/tests/utils.py
@@ -1,13 +1,8 @@
 #!/usr/bin/env python3
 
 import os
-import sys
 
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-from compat import StringIO
-from vndk_definition_tool import (
-        ELF, ELFLinker, PT_SYSTEM, PT_VENDOR, VNDKLibDir)
+from vndk_definition_tool import (ELF, ELFLinker, PT_SYSTEM, PT_VENDOR)
 
 
 class GraphBuilder(object):
@@ -16,16 +11,19 @@
         PT_VENDOR: 'vendor',
     }
 
+
     _LIB_DIRS = {
         ELF.ELFCLASS32: 'lib',
         ELF.ELFCLASS64: 'lib64',
     }
 
+
     def __init__(self):
         self.graph = ELFLinker()
 
-    def add_lib(self, partition, klass, name, dt_needed=[],
-                exported_symbols=set(), imported_symbols=set(),
+
+    def add_lib(self, partition, klass, name, dt_needed=tuple(),
+                exported_symbols=tuple(), imported_symbols=tuple(),
                 extra_dir=None):
         """Create and add a shared library to ELFLinker."""
 
@@ -37,27 +35,30 @@
         path = os.path.join(lib_dir, name + '.so')
 
         elf = ELF(klass, ELF.ELFDATA2LSB, dt_needed=dt_needed,
-                  exported_symbols=exported_symbols,
-                  imported_symbols=imported_symbols)
+                  exported_symbols=set(exported_symbols),
+                  imported_symbols=set(imported_symbols))
 
         lib = self.graph.add_lib(partition, path, elf)
         setattr(self, name + '_' + elf.elf_class_name, lib)
         return lib
 
-    def add_lib32(self, partition, name, dt_needed=[],
-                  exported_symbols=set(), imported_symbols=set(),
+
+    def add_lib32(self, partition, name, dt_needed=tuple(),
+                  exported_symbols=tuple(), imported_symbols=tuple(),
                   extra_dir=None):
         return self.add_lib(partition, ELF.ELFCLASS32, name, dt_needed,
                             exported_symbols, imported_symbols, extra_dir)
 
-    def add_lib64(self, partition, name, dt_needed=[],
-                  exported_symbols=set(), imported_symbols=set(),
+
+    def add_lib64(self, partition, name, dt_needed=tuple(),
+                  exported_symbols=tuple(), imported_symbols=tuple(),
                   extra_dir=None):
         return self.add_lib(partition, ELF.ELFCLASS64, name, dt_needed,
                             exported_symbols, imported_symbols, extra_dir)
 
-    def add_multilib(self, partition, name, dt_needed=[],
-                     exported_symbols=set(), imported_symbols=set(),
+
+    def add_multilib(self, partition, name, dt_needed=tuple(),
+                     exported_symbols=tuple(), imported_symbols=tuple(),
                      extra_dir=None):
         """Add 32-bit / 64-bit shared libraries to ELFLinker."""
         return (
@@ -67,6 +68,7 @@
                          exported_symbols, imported_symbols, extra_dir)
         )
 
+
     def resolve(self, vndk_lib_dirs=None, ro_vndk_version=None):
         if vndk_lib_dirs is not None:
             self.graph.vndk_lib_dirs = vndk_lib_dirs
diff --git a/vndk/tools/definition-tool/tools/update_dataset.py b/vndk/tools/definition-tool/tools/update_dataset.py
index 3155d00..4c86062 100755
--- a/vndk/tools/definition-tool/tools/update_dataset.py
+++ b/vndk/tools/definition-tool/tools/update_dataset.py
@@ -59,17 +59,35 @@
 
     return (result, name_path_dict)
 
-def main():
-    parser =argparse.ArgumentParser()
+def _is_stale_module(path, installed_paths):
+    if path in installed_paths:
+        return False
+    # libclang_rt.asan-${arch}-android and
+    # libclang_rt.ubsan_standalone-${arch}-android may vary between different
+    # architectures.
+    if posixpath.basename(path).startswith('libclang_rt'):
+        return False
+    return True
+
+def remove_stale_modules(data, installed_paths):
+    result = {}
+    for path, row in data.items():
+        if not _is_stale_module(path, installed_paths):
+            result[path] = row
+    return result
+
+def _parse_args():
+    parser = argparse.ArgumentParser()
     parser.add_argument('tag_file')
     parser.add_argument('-o', '--output', required=True)
     parser.add_argument('--make-vars', required=True,
                         help='out/soong/make_vars-$(TARGET).mk')
     parser.add_argument('--module-info', required=True,
                         help='out/target/product/$(TARGET)/module-info.json')
-    parser.add_argument('--delete-removed-entries', action='store_true',
-                        help='Delete removed shared libs')
-    args = parser.parse_args()
+    return parser.parse_args()
+
+def main():
+    args = _parse_args()
 
     # Load libraries from `out/soong/make_vars-$(TARGET).mk`.
     llndk, vndk_sp, vndk, vndk_private = load_make_vars(args.make_vars)
@@ -88,12 +106,7 @@
 
     # Delete non-existing libraries.
     installed_paths, name_path_dict = load_install_paths(args.module_info)
-
-    if args.delete_removed_entries:
-        data = { path: row for path, row in data.items()
-                           if path in installed_paths }
-    else:
-        data = { path: row for path, row in data.items() }
+    data = remove_stale_modules(data, installed_paths)
 
     # Reset all /system/${LIB} libraries to FWK-ONLY.
     for path, row in data.items():
@@ -184,6 +197,7 @@
         'ld-android',
         'libc_malloc_debug',
         'libnetd_client',
+        'libtextclassifier_hash',
     ]
     for name in libs:
         update_tag('/system/${LIB}/' + name + '.so', 'LL-NDK-Private')
@@ -208,19 +222,22 @@
         update_tag(prefix_vendor + name, 'VNDK-SP-Private',
                    'Workaround for degenerated VDNK')
 
-    # Workaround for libclang_rt.asan
-    prefix = 'libclang_rt.asan'
-    if any(name.startswith(prefix) for name in llndk):
-        for path in list(data.keys()):
-            if os.path.basename(path).startswith(prefix):
-                update_tag(path, 'LL-NDK')
-
-    # Workaround for libclang_rt.ubsan_standalone
-    prefix = 'libclang_rt.ubsan_standalone'
-    if any(name.startswith(prefix) for name in vndk):
-        for path in list(data.keys()):
-            if os.path.basename(path).startswith(prefix):
-                update_tag(path, 'VNDK')
+    # Workaround for libclang_rt.*.so
+    lib_sets = {
+        'LL-NDK': llndk,
+        'VNDK': vndk,
+    }
+    prefixes = {
+        'libclang_rt.asan': 'LL-NDK',
+        'libclang_rt.hwasan': 'LL-NDK',
+        'libclang_rt.scudo': 'VNDK',
+        'libclang_rt.ubsan_standalone': 'VNDK',
+    }
+    for prefix, tag in prefixes.items():
+        if any(name.startswith(prefix) for name in lib_sets[tag]):
+            for path in list(data.keys()):
+                if os.path.basename(path).startswith(prefix):
+                    update_tag(path, tag)
 
     # Merge regular expression patterns into final dataset
     for regex in regex_patterns:
diff --git a/vndk/tools/definition-tool/tools/update_dataset_auto.py b/vndk/tools/definition-tool/tools/update_dataset_auto.py
new file mode 100755
index 0000000..39504a7
--- /dev/null
+++ b/vndk/tools/definition-tool/tools/update_dataset_auto.py
@@ -0,0 +1,101 @@
+#!/usr/bin/env python3
+
+# This tool generates `eligible-list-${ver}.csv` and
+# `eligible-list-${ver}-properties.csv`.
+
+import argparse
+import os
+import subprocess
+import sys
+import tempfile
+
+UPDATE_DATASET = os.path.abspath(os.path.join(
+    __file__, '..', 'update_dataset.py'))
+
+LIST_VNDK_MODULE = os.path.abspath(os.path.join(
+    __file__, '..', '..', '..', 'sourcedr', 'blueprint', 'list_vndk_module.py'))
+
+
+def update_eligible_list(path, make_vars, module_info):
+    dirname, basename = os.path.split(path)
+    tmp_fd, tmp_path = tempfile.mkstemp(prefix=basename + '-', dir=dirname)
+    os.close(tmp_fd)
+
+    cmd = [sys.executable, UPDATE_DATASET]
+    cmd.extend(['--make-vars', make_vars])
+    cmd.extend(['--module-info', module_info])
+    cmd.extend(['-o', tmp_path])
+    cmd.append(path)
+
+    print('command:', ' '.join(cmd))
+
+    subprocess.check_call(cmd)
+    os.rename(tmp_path, path)
+
+
+def update_eligible_list_properties(path, build_top):
+    dirname, basename = os.path.split(path)
+    tmp_fd, tmp_path = tempfile.mkstemp(prefix=basename + '-', dir=dirname)
+    os.close(tmp_fd)
+
+    cmd = [sys.executable, LIST_VNDK_MODULE]
+    cmd.extend(['--exclude', '(?:device/)|(?:vendor/)'])
+    cmd.extend(['--namespace', 'hardware/google/av'])
+    cmd.extend(['--namespace', 'hardware/google/interfaces'])
+    cmd.extend(['-o', tmp_path])
+    cmd.append(os.path.join(build_top, 'Android.bp'))
+
+    print('command:', ' '.join(cmd))
+
+    subprocess.check_call(cmd)
+    os.rename(tmp_path, path)
+
+
+def _get_eligible_list_properties_path(eligible_list_path):
+    root, ext = os.path.splitext(eligible_list_path)
+    return root + '-properties' + ext
+
+
+def _parse_args():
+    parser = argparse.ArgumentParser()
+    parser.add_argument('eligible_list',
+                        help='Path to eligible list to be updated')
+    return parser.parse_args()
+
+
+def main():
+    args = _parse_args()
+
+    # Read Android product environment variables.
+    try:
+        build_top = os.environ['ANDROID_BUILD_TOP']
+        product = os.environ['TARGET_PRODUCT']
+        product_out = os.environ['ANDROID_PRODUCT_OUT']
+    except KeyError as e:
+        print('error: Failed to read the environment variable', e.args[0],
+              file=sys.stderr)
+        print('error: Did you lunch an Android target?', file=sys.stderr)
+        sys.exit(1)
+
+    print('----------------------------------------')
+    print('build_top:', build_top)
+    print('product:', product)
+    print('product_out:', product_out)
+
+    out_dir = os.path.normpath(os.path.join(product_out, '..', '..', '..'))
+    make_vars = os.path.join(out_dir, 'soong', 'make_vars-' + product + '.mk')
+    module_info = os.path.join(product_out, 'module-info.json')
+
+    print('----------------------------------------')
+    print('make_vars:', make_vars)
+    print('module_info:', module_info)
+    print('----------------------------------------')
+
+    # Run the commands to update the files.
+    update_eligible_list(args.eligible_list, make_vars, module_info)
+    update_eligible_list_properties(
+        _get_eligible_list_properties_path(args.eligible_list), build_top)
+
+
+if __name__ == '__main__':
+    sys.exit(main())
diff --git a/vndk/tools/definition-tool/vndk_definition_tool.py b/vndk/tools/definition-tool/vndk_definition_tool.py
index 0179de2..ea3ee66 100755
--- a/vndk/tools/definition-tool/vndk_definition_tool.py
+++ b/vndk/tools/definition-tool/vndk_definition_tool.py
@@ -39,7 +39,7 @@
     def makedirs(path, exist_ok):
         if exist_ok and os.path.isdir(path):
             return
-        return os.makedirs(path)
+        os.makedirs(path)
 
     class mmap(mmap):
         def __enter__(self):
@@ -50,14 +50,14 @@
 
         def __getitem__(self, key):
             res = super(mmap, self).__getitem__(key)
-            if type(key) == int:
+            if isinstance(key, int):
                 return ord(res)
             return res
 
     class Py3Bytes(bytes):
         def __getitem__(self, key):
             res = super(Py3Bytes, self).__getitem__(key)
-            if type(key) == int:
+            if isinstance(key, int):
                 return ord(res)
             return Py3Bytes(res)
 
@@ -70,7 +70,7 @@
         for i, byte in enumerate(iterable):
             yield (i, ord(byte))
 
-    FileNotFoundError = OSError
+    FileNotFoundError = EnvironmentError
 
 try:
     from sys import intern
@@ -82,6 +82,10 @@
 # Modified UTF-8 Encoder and Decoder
 #------------------------------------------------------------------------------
 
+class UnicodeSurrogateDecodeError(UnicodeDecodeError):
+    pass
+
+
 def encode_mutf8(input, errors='strict'):
     i = 0
     res = io.BytesIO()
@@ -130,6 +134,10 @@
     def raise_error(start, reason):
         raise UnicodeDecodeError('mutf-8', input, start, i + 1, reason)
 
+    def raise_surrogate_error(start, reason):
+        raise UnicodeSurrogateDecodeError(
+            'mutf-8', input, start, i + 1, reason)
+
     for i, byte in enumerate_bytes(input):
         if (byte & 0x80) == 0x00:
             if num_next > 0:
@@ -158,17 +166,19 @@
             raise_error(i, 'invalid start byte')
 
         if num_next == 0:
-            if code >= 0xd800 and code <= 0xdbff:  # High surrogate
+            if 0xd800 <= code <= 0xdbff:  # High surrogate
                 if code_surrogate is not None:
-                    raise_error(start_surrogate, 'invalid high surrogate')
+                    raise_surrogate_error(
+                        start_surrogate, 'invalid high surrogate')
                 code_surrogate = code
                 start_surrogate = start
                 continue
 
-            if code >= 0xdc00 and code <= 0xdfff:  # Low surrogate
+            if 0xdc00 <= code <= 0xdfff:  # Low surrogate
                 if code_surrogate is None:
-                    raise_error(start, 'invalid low surrogate')
-                code = ((code_surrogate & 0x3f) << 10) | (code & 0x3f) + 0x10000
+                    raise_surrogate_error(start, 'invalid low surrogate')
+                code = (((code_surrogate & 0x3f) << 10) |
+                        (code & 0x3f) + 0x10000)
                 code_surrogate = None
                 start_surrogate = None
             elif code_surrogate is not None:
@@ -177,7 +187,7 @@
                     code_surrogate = None
                     start_surrogate = None
                 else:
-                    raise_error(start_surrogate, 'illegal surrogate')
+                    raise_surrogate_error(start_surrogate, 'illegal surrogate')
 
             res.write(create_chr(code))
 
@@ -185,7 +195,7 @@
     if num_next > 0:
         raise_error(start, 'unexpected end')
     if code_surrogate is not None:
-        raise_error(start_surrogate, 'unexpected end')
+        raise_surrogate_error(start_surrogate, 'unexpected end')
 
     return (res.getvalue(), i)
 
@@ -275,28 +285,28 @@
 #------------------------------------------------------------------------------
 
 Elf_Hdr = collections.namedtuple(
-        'Elf_Hdr',
-        'ei_class ei_data ei_version ei_osabi e_type e_machine e_version '
-        'e_entry e_phoff e_shoff e_flags e_ehsize e_phentsize e_phnum '
-        'e_shentsize e_shnum e_shstridx')
+    'Elf_Hdr',
+    'ei_class ei_data ei_version ei_osabi e_type e_machine e_version '
+    'e_entry e_phoff e_shoff e_flags e_ehsize e_phentsize e_phnum '
+    'e_shentsize e_shnum e_shstridx')
 
 
 Elf_Shdr = collections.namedtuple(
-        'Elf_Shdr',
-        'sh_name sh_type sh_flags sh_addr sh_offset sh_size sh_link sh_info '
-        'sh_addralign sh_entsize')
+    'Elf_Shdr',
+    'sh_name sh_type sh_flags sh_addr sh_offset sh_size sh_link sh_info '
+    'sh_addralign sh_entsize')
 
 
 Elf_Phdr = collections.namedtuple(
-        'Elf_Phdr',
-        'p_type p_offset p_vaddr p_paddr p_filesz p_memsz p_flags p_align')
+    'Elf_Phdr',
+    'p_type p_offset p_vaddr p_paddr p_filesz p_memsz p_flags p_align')
 
 
 Elf_Dyn = collections.namedtuple('Elf_Dyn', 'd_tag d_val')
 
 
 class Elf_Sym(collections.namedtuple(
-    'ELF_Sym', 'st_name st_value st_size st_info st_other st_shndx')):
+        'ELF_Sym', 'st_name st_value st_size st_info st_other st_shndx')):
 
     STB_LOCAL = 0
     STB_GLOBAL = 1
@@ -304,22 +314,27 @@
 
     SHN_UNDEF = 0
 
+
     @property
     def st_bind(self):
-        return (self.st_info >> 4)
+        return self.st_info >> 4
+
 
     @property
     def is_local(self):
         return self.st_bind == Elf_Sym.STB_LOCAL
 
+
     @property
     def is_global(self):
         return self.st_bind == Elf_Sym.STB_GLOBAL
 
+
     @property
     def is_weak(self):
         return self.st_bind == Elf_Sym.STB_WEAK
 
+
     @property
     def is_undef(self):
         return self.st_shndx == Elf_Sym.SHN_UNDEF
@@ -371,6 +386,7 @@
     EM_X86_64 = 62
     EM_AARCH64 = 183
 
+
     def _create_elf_machines(d):
         elf_machine_ids = {}
         for key, value in d.items():
@@ -390,14 +406,17 @@
                 return key
         raise KeyError(dst)
 
+
     @staticmethod
     def get_ei_class_from_name(name):
         return ELF._dict_find_key_by_value(ELF._ELF_CLASS_NAMES, name)
 
+
     @staticmethod
     def get_ei_data_from_name(name):
         return ELF._dict_find_key_by_value(ELF._ELF_DATA_NAMES, name)
 
+
     @staticmethod
     def get_e_machine_from_name(name):
         return ELF._dict_find_key_by_value(ELF.ELF_MACHINES, name)
@@ -421,50 +440,60 @@
         self.dt_runpath = dt_runpath if dt_runpath is not None else []
         self.dt_needed = dt_needed if dt_needed is not None else []
         self.exported_symbols = \
-                exported_symbols if exported_symbols is not None else set()
+            exported_symbols if exported_symbols is not None else set()
         self.imported_symbols = \
-                imported_symbols if imported_symbols is not None else set()
+            imported_symbols if imported_symbols is not None else set()
         self.file_size = file_size
         self.ro_seg_file_size = ro_seg_file_size
         self.ro_seg_mem_size = ro_seg_mem_size
         self.rw_seg_file_size = rw_seg_file_size
         self.rw_seg_mem_size = rw_seg_mem_size
 
+
     def __repr__(self):
         args = (a + '=' + repr(getattr(self, a)) for a in self.__slots__)
         return 'ELF(' + ', '.join(args) + ')'
 
+
     def __eq__(self, rhs):
         return all(getattr(self, a) == getattr(rhs, a) for a in self.__slots__)
 
+
     @property
     def elf_class_name(self):
         return self._ELF_CLASS_NAMES.get(self.ei_class, 'None')
 
+
     @property
     def elf_data_name(self):
         return self._ELF_DATA_NAMES.get(self.ei_data, 'None')
 
+
     @property
     def elf_machine_name(self):
         return self.ELF_MACHINES.get(self.e_machine, str(self.e_machine))
 
+
     @property
     def is_32bit(self):
         return self.ei_class == ELF.ELFCLASS32
 
+
     @property
     def is_64bit(self):
         return self.ei_class == ELF.ELFCLASS64
 
+
     @property
     def sorted_exported_symbols(self):
         return sorted(list(self.exported_symbols))
 
+
     @property
     def sorted_imported_symbols(self):
         return sorted(list(self.imported_symbols))
 
+
     def dump(self, file=None):
         """Print parsed ELF information to the file"""
         file = file if file is not None else sys.stdout
@@ -488,6 +517,7 @@
         for symbol in self.sorted_imported_symbols:
             print('IMP_SYMBOL\t' + symbol, file=file)
 
+
     # Extract zero-terminated buffer slice.
     def _extract_zero_terminated_buf_slice(self, buf, offset):
         """Extract a zero-terminated buffer slice from the given offset"""
@@ -496,6 +526,7 @@
             return buf[offset:]
         return buf[offset:end]
 
+
     # Extract c-style interned string from the buffer.
     if sys.version_info >= (3, 0):
         def _extract_zero_terminated_str(self, buf, offset):
@@ -507,11 +538,12 @@
             """Extract a c-style string from the given buffer and offset"""
             return intern(self._extract_zero_terminated_buf_slice(buf, offset))
 
+
     def _parse_from_buf_internal(self, buf):
         """Parse ELF image resides in the buffer"""
 
         # Check ELF ident.
-        if buf.size() < 8:
+        if len(buf) < 8:
             raise ELFError('bad ident')
 
         if buf[0:4] != ELF.ELF_MAGIC:
@@ -525,7 +557,7 @@
         if self.ei_data not in (ELF.ELFDATA2LSB, ELF.ELFDATA2MSB):
             raise ELFError('unknown endianness')
 
-        self.file_size = buf.size()
+        self.file_size = len(buf)
 
         # ELF structure definitions.
         endian_fmt = '<' if self.ei_data == ELF.ELFDATA2LSB else '>'
@@ -575,7 +607,8 @@
 
         if self.is_32bit:
             def parse_elf_sym(offset):
-                return parse_struct(Elf_Sym, elf_sym_fmt, offset, 'bad elf sym')
+                return parse_struct(
+                    Elf_Sym, elf_sym_fmt, offset, 'bad elf sym')
         else:
             def parse_elf_sym(offset):
                 try:
@@ -624,7 +657,7 @@
 
         # Find .shstrtab section.
         shstrtab_shdr_off = \
-                header.e_shoff + header.e_shstridx * header.e_shentsize
+            header.e_shoff + header.e_shstridx * header.e_shentsize
         shstrtab_shdr = parse_elf_shdr(shstrtab_shdr_off)
         shstrtab_off = shstrtab_shdr.sh_offset
 
@@ -651,16 +684,17 @@
         # Parse entries in .dynamic section.
         assert struct.calcsize(elf_dyn_fmt) == dynamic_shdr.sh_entsize
         dynamic_end = dynamic_off + dynamic_shdr.sh_size
-        for ent_off in range(dynamic_off, dynamic_end, dynamic_shdr.sh_entsize):
+        for ent_off in range(
+                dynamic_off, dynamic_end, dynamic_shdr.sh_entsize):
             ent = parse_elf_dyn(ent_off)
             if ent.d_tag == ELF.DT_NEEDED:
                 self.dt_needed.append(extract_str(dynstr_off + ent.d_val))
             elif ent.d_tag == ELF.DT_RPATH:
                 self.dt_rpath.extend(
-                        extract_str(dynstr_off + ent.d_val).split(':'))
+                    extract_str(dynstr_off + ent.d_val).split(':'))
             elif ent.d_tag == ELF.DT_RUNPATH:
                 self.dt_runpath.extend(
-                        extract_str(dynstr_off + ent.d_val).split(':'))
+                    extract_str(dynstr_off + ent.d_val).split(':'))
 
         # Parse exported symbols in .dynsym section.
         dynsym_shdr = sections.get('.dynsym')
@@ -683,6 +717,7 @@
                 elif not ent.is_local:
                     exp_symbols.add(symbol_name)
 
+
     def _parse_from_buf(self, buf):
         """Parse ELF image resides in the buffer"""
         try:
@@ -690,6 +725,7 @@
         except IndexError:
             raise ELFError('bad offset')
 
+
     def _parse_from_file(self, path):
         """Parse ELF image from the file path"""
         with open(path, 'rb') as f:
@@ -699,13 +735,14 @@
             with mmap(f.fileno(), st.st_size, access=ACCESS_READ) as image:
                 self._parse_from_buf(image)
 
+
     def _parse_from_dump_lines(self, path, lines):
         patt = re.compile('^([A-Za-z_]+)\t+(.*)$')
         for line_no, line in enumerate(lines):
             match = patt.match(line)
             if not match:
-                print('error: {}: {}: failed to parse'
-                        .format(path, line_no + 1), file=sys.stderr)
+                print('error: {}: {}: Failed to parse'
+                      .format(path, line_no + 1), file=sys.stderr)
                 continue
             key = match.group(1)
             value = match.group(2)
@@ -738,18 +775,21 @@
                 self.imported_symbols.add(intern(value))
             else:
                 print('error: {}: {}: unknown tag name: {}'
-                        .format(path, line_no + 1, key), file=sys.stderr)
+                      .format(path, line_no + 1, key), file=sys.stderr)
+
 
     def _parse_from_dump_file(self, path):
         """Load information from ELF dump file."""
         with open(path, 'r') as f:
             self._parse_from_dump_lines(path, f)
 
+
     def _parse_from_dump_buf(self, buf):
         """Load information from ELF dump buffer."""
         self._parse_from_dump_lines('<str:0x{:x}>'.format(id(buf)),
                                     buf.splitlines())
 
+
     @staticmethod
     def load(path):
         """Create an ELF instance from the file path"""
@@ -757,6 +797,7 @@
         elf._parse_from_file(path)
         return elf
 
+
     @staticmethod
     def loads(buf):
         """Create an ELF instance from the buffer"""
@@ -764,6 +805,7 @@
         elf._parse_from_buf(buf)
         return elf
 
+
     @staticmethod
     def load_dump(path):
         """Create an ELF instance from a dump file path"""
@@ -771,6 +813,7 @@
         elf._parse_from_dump_file(path)
         return elf
 
+
     @staticmethod
     def load_dumps(buf):
         """Create an ELF instance from a dump file buffer"""
@@ -778,6 +821,7 @@
         elf._parse_from_dump_buf(buf)
         return elf
 
+
     def is_jni_lib(self):
         """Test whether the ELF file looks like a JNI library."""
         for name in ['libnativehelper.so', 'libandroid_runtime.so']:
@@ -799,15 +843,7 @@
     @classmethod
     def extract_dex_string(cls, buf, offset=0):
         end = buf.find(b'\0', offset)
-        res = buf[offset:] if end == -1 else buf[offset:end]
-        return res.decode('mutf-8', 'ignore')
-
-    if sys.version_info < (3,):
-        _extract_dex_string = extract_dex_string
-
-        @classmethod
-        def extract_dex_string(cls, buf, offset=0):
-            return cls._extract_dex_string(buf, offset).encode('utf-8')
+        return buf[offset:] if end == -1 else buf[offset:end]
 
 
     @classmethod
@@ -898,87 +934,154 @@
 
 
     @classmethod
-    def _read_first_bytes(cls, apk_file, num_bytes):
-        try:
-            with open(apk_file, 'rb') as fp:
-                return fp.read(num_bytes)
-        except IOError:
-            return b''
-
-    @classmethod
-    def is_zipfile(cls, apk_file_path):
-        magic = cls._read_first_bytes(apk_file_path, 2)
-        return magic == b'PK' and zipfile.is_zipfile(apk_file_path)
-
-    @classmethod
     def enumerate_dex_strings_apk(cls, apk_file_path):
         with zipfile.ZipFile(apk_file_path, 'r') as zip_file:
             for name in cls.generate_classes_dex_names():
                 try:
                     with zip_file.open(name) as dex_file:
-                        for s in cls.enumerate_dex_strings_buf(dex_file.read()):
-                            yield s
+                        dex_file_content = dex_file.read()
+                    for s in cls.enumerate_dex_strings_buf(dex_file_content):
+                        yield s
                 except KeyError:
                     break
 
+
     @classmethod
     def is_vdex_file(cls, vdex_file_path):
         return vdex_file_path.endswith('.vdex')
 
-    VdexHeader = create_struct('VdexHeader', (
+
+    # VdexHeader 0
+    VdexHeader0 = create_struct('VdexHeader0', (
         ('magic', '4s'),
-        ('version', '4s'),
+        ('vdex_version', '4s'),
+    ))
+
+
+    # VdexHeader 1 - 15
+    VdexHeader1 = create_struct('VdexHeader1', (
+        ('magic', '4s'),
+        ('vdex_version', '4s'),
         ('number_of_dex_files', 'I'),
         ('dex_size', 'I'),
-        # ('dex_shared_data_size', 'I'),  # >= 016
         ('verifier_deps_size', 'I'),
         ('quickening_info_size', 'I'),
+        # checksums
     ))
 
+
+    # VdexHeader 16 - 18
+    VdexHeader16 = create_struct('VdexHeader16', (
+        ('magic', '4s'),
+        ('vdex_version', '4s'),
+        ('number_of_dex_files', 'I'),
+        ('dex_size', 'I'),
+        ('dex_shared_data_size', 'I'),
+        ('verifier_deps_size', 'I'),
+        ('quickening_info_size', 'I'),
+        # checksums
+    ))
+
+
+    # VdexHeader 19
+    VdexHeader19 = create_struct('VdexHeader19', (
+        ('magic', '4s'),
+        ('vdex_version', '4s'),
+        ('dex_section_version', '4s'),
+        ('number_of_dex_files', 'I'),
+        ('verifier_deps_size', 'I'),
+        # checksums
+    ))
+
+
+    DexSectionHeader = create_struct('DexSectionHeader', (
+        ('dex_size', 'I'),
+        ('dex_shared_data_size', 'I'),
+        ('quickening_info_size', 'I'),
+    ))
+
+
     @classmethod
     def enumerate_dex_strings_vdex_buf(cls, buf):
         buf = get_py3_bytes(buf)
-        vdex_header = cls.VdexHeader.unpack_from(buf, offset=0)
 
-        quickening_table_off_size = 0
-        if vdex_header.version > b'010\x00':
-            quickening_table_off_size = 4
+        magic, version = struct.unpack_from('4s4s', buf)
 
-        # Skip vdex file header size
-        offset = cls.VdexHeader.struct_size
+        # Check the vdex file magic word
+        if magic != b'vdex':
+            raise ValueError('bad vdex magic word')
 
-        # Skip `dex_shared_data_size`
-        if vdex_header.version >= b'016\x00':
-            offset += 4
+        # Parse vdex file header (w.r.t. version)
+        if version == b'000\x00':
+            VdexHeader = cls.VdexHeader0
+        elif b'001\x00' <= version < b'016\x00':
+            VdexHeader = cls.VdexHeader1
+        elif b'016\x00' <= version < b'019\x00':
+            VdexHeader = cls.VdexHeader16
+        elif version == b'019\x00':
+            VdexHeader = cls.VdexHeader19
+        else:
+            raise ValueError('unknown vdex version ' + repr(version))
 
-        # Skip dex file checksums size
-        offset += 4 * vdex_header.number_of_dex_files
+        vdex_header = VdexHeader.unpack_from(buf, offset=0)
 
         # Skip this vdex file if there is no dex file section
-        if vdex_header.dex_size == 0:
-            return
+        if vdex_header.vdex_version < b'019\x00':
+            if vdex_header.dex_size == 0:
+                return
+        else:
+            if vdex_header.dex_section_version == b'000\x00':
+                return
 
-        for i in range(vdex_header.number_of_dex_files):
+        # Skip vdex file header struct
+        offset = VdexHeader.struct_size
+
+        # Skip dex file checksums struct
+        offset += 4 * vdex_header.number_of_dex_files
+
+        # Skip dex section header struct
+        if vdex_header.vdex_version >= b'019\x00':
+            offset += cls.DexSectionHeader.struct_size
+
+        # Calculate the quickening table offset
+        if vdex_header.vdex_version >= b'012\x00':
+            quickening_table_off_size = 4
+        else:
+            quickening_table_off_size = 0
+
+        for _ in range(vdex_header.number_of_dex_files):
             # Skip quickening_table_off size
             offset += quickening_table_off_size
 
             # Check the dex file magic
             dex_magic = buf[offset:offset + 4]
-            if dex_magic != b'dex\n' and dex_magic != b'cdex':
+            if dex_magic not in (b'dex\n', b'cdex'):
                 raise ValueError('bad dex file offset {}'.format(offset))
 
             dex_header = cls.Header.unpack_from(buf, offset)
             dex_file_end = offset + dex_header.file_size
             for s in cls.enumerate_dex_strings_buf(buf, offset):
                 yield s
+
+            # Align to the end of the dex file
             offset = (dex_file_end + 3) // 4 * 4
 
+
     @classmethod
     def enumerate_dex_strings_vdex(cls, vdex_file_path):
         with open(vdex_file_path, 'rb') as vdex_file:
             return cls.enumerate_dex_strings_vdex_buf(vdex_file.read())
 
 
+    @classmethod
+    def enumerate_dex_strings(cls, path):
+        if is_zipfile(path):
+            return DexFileReader.enumerate_dex_strings_apk(path)
+        if cls.is_vdex_file(path):
+            return DexFileReader.enumerate_dex_strings_vdex(path)
+        return None
+
+
 #------------------------------------------------------------------------------
 # TaggedDict
 #------------------------------------------------------------------------------
@@ -1006,6 +1109,7 @@
     _define_tag_constants(locals())
     del _define_tag_constants
 
+
     _TAG_ALIASES = {
         'hl_ndk': 'fwk_only',  # Treat HL-NDK as FWK-ONLY.
         'sp_ndk': 'll_ndk',
@@ -1023,6 +1127,7 @@
         'vndk_sp_private': 'vndk_sp_indirect_private',
     }
 
+
     @classmethod
     def _normalize_tag(cls, tag):
         tag = tag.lower().replace('-', '_')
@@ -1031,6 +1136,7 @@
             raise ValueError('unknown lib tag ' + tag)
         return tag
 
+
     _LL_NDK_VIS = {'ll_ndk', 'll_ndk_indirect'}
     _VNDK_SP_VIS = {'ll_ndk', 'vndk_sp', 'vndk_sp_indirect',
                     'vndk_sp_indirect_private', 'fwk_only_rs'}
@@ -1063,10 +1169,12 @@
 
     del _LL_NDK_VIS, _VNDK_SP_VIS, _FWK_ONLY_VIS, _SP_HAL_VIS
 
+
     @classmethod
     def is_tag_visible(cls, from_tag, to_tag):
         return to_tag in cls._TAG_VISIBILITY[from_tag]
 
+
     def __init__(self, vndk_lib_dirs=None):
         self._path_tag = dict()
         for tag in self.TAGS:
@@ -1079,14 +1187,17 @@
             self._vndk_suffixes = [VNDKLibDir.create_vndk_dir_suffix(version)
                                    for version in vndk_lib_dirs]
 
+
     def add(self, tag, lib):
         lib_set = getattr(self, tag)
         lib_set.add(lib)
         self._path_tag[lib] = tag
 
+
     def add_regex(self, tag, pattern):
         self._regex_patterns.append((re.compile(pattern), tag))
 
+
     def get_path_tag(self, lib):
         try:
             return self._path_tag[lib]
@@ -1099,36 +1210,45 @@
 
         return self.get_path_tag_default(lib)
 
+
     def get_path_tag_default(self, lib):
         raise NotImplementedError()
 
+
     def get_path_tag_bit(self, lib):
         return self.TAGS[self.get_path_tag(lib)]
 
+
     def is_path_visible(self, from_lib, to_lib):
         return self.is_tag_visible(self.get_path_tag(from_lib),
                                    self.get_path_tag(to_lib))
 
+
     @staticmethod
     def is_ll_ndk(tag_bit):
         return bool(tag_bit & TaggedDict.LL_NDK)
 
+
     @staticmethod
     def is_vndk_sp(tag_bit):
         return bool(tag_bit & TaggedDict.VNDK_SP)
 
+
     @staticmethod
     def is_vndk_sp_indirect(tag_bit):
         return bool(tag_bit & TaggedDict.VNDK_SP_INDIRECT)
 
+
     @staticmethod
     def is_vndk_sp_indirect_private(tag_bit):
         return bool(tag_bit & TaggedDict.VNDK_SP_INDIRECT_PRIVATE)
 
+
     @staticmethod
     def is_fwk_only_rs(tag_bit):
         return bool(tag_bit & TaggedDict.FWK_ONLY_RS)
 
+
     @staticmethod
     def is_sp_hal(tag_bit):
         return bool(tag_bit & TaggedDict.SP_HAL)
@@ -1156,17 +1276,20 @@
         for row in reader:
             self.add(self._normalize_tag(row[tag_col]), row[path_col])
 
+
     @staticmethod
     def create_from_csv(fp, vndk_lib_dirs=None):
         d = TaggedPathDict(vndk_lib_dirs)
         d.load_from_csv(fp)
         return d
 
+
     @staticmethod
     def create_from_csv_path(path, vndk_lib_dirs=None):
         with open(path, 'r') as fp:
             return TaggedPathDict.create_from_csv(fp, vndk_lib_dirs)
 
+
     def _enumerate_paths_with_lib(self, pattern):
         if '${LIB}' in pattern:
             yield pattern.replace('${LIB}', 'lib')
@@ -1174,6 +1297,7 @@
         else:
             yield pattern
 
+
     def _enumerate_paths(self, pattern):
         if '${VNDK_VER}' not in pattern:
             for path in self._enumerate_paths_with_lib(pattern):
@@ -1184,6 +1308,7 @@
             for path in self._enumerate_paths_with_lib(pattern_with_suffix):
                 yield path
 
+
     def add(self, tag, path):
         if path.startswith('[regex]'):
             super(TaggedPathDict, self).add_regex(tag, path[7:])
@@ -1191,6 +1316,7 @@
         for path in self._enumerate_paths(path):
             super(TaggedPathDict, self).add(tag, path)
 
+
     def get_path_tag_default(self, path):
         return 'vnd_only' if path.startswith('/vendor') else 'fwk_only'
 
@@ -1201,11 +1327,13 @@
         for tag in TaggedDict.TAGS:
             setattr(self, tag, set())
 
+
     def add(self, tag, lib):
         lib_set = getattr(self, tag)
         lib_set.add(lib)
         self._path_tag[lib] = tag
 
+
     @staticmethod
     def create_from_graph(graph, tagged_paths, generic_refs=None):
         d = TaggedLibDict()
@@ -1223,19 +1351,21 @@
                 d.add('vnd_only', lib)
         return d
 
+
     def get_path_tag(self, lib):
         try:
             return self._path_tag[lib]
         except KeyError:
             return self.get_path_tag_default(lib)
 
+
     def get_path_tag_default(self, lib):
         return 'vnd_only' if lib.path.startswith('/vendor') else 'fwk_only'
 
 
 class LibProperties(object):
     Properties = collections.namedtuple(
-            'Properties', 'vndk vndk_sp vendor_available rule')
+        'Properties', 'vndk vndk_sp vendor_available rule')
 
 
     def __init__(self, csv_file=None):
@@ -1250,8 +1380,8 @@
 
             for name, vndk, vndk_sp, vendor_available, rule in reader:
                 self.modules[name] = self.Properties(
-                        vndk == 'True', vndk_sp == 'True',
-                        vendor_available == 'True', rule)
+                    vndk == 'True', vndk_sp == 'True',
+                    vendor_available == 'True', rule)
 
 
     @classmethod
@@ -1292,37 +1422,64 @@
 
 
 def scan_accessible_files(root):
-    for base, dirs, files in os.walk(root):
+    for base, _, files in os.walk(root):
         for filename in files:
             path = os.path.join(base, filename)
             if is_accessible(path):
                 yield path
 
 
-def scan_elf_files(root):
+def is_zipfile(path):
+    # zipfile.is_zipfile() tries to find the zip header in the file.  But we
+    # only want to scan the zip file that starts with the magic word.  Thus,
+    # we read the magic word by ourselves.
+    try:
+        with open(path, 'rb') as fp:
+            if fp.read(2) != b'PK':
+                return False
+    except IOError:
+        return False
+
+    # Check whether this is a valid zip file.
+    return zipfile.is_zipfile(path)
+
+
+def scan_zip_file(zip_file_path):
+    """Scan all ELF files in a zip archive."""
+    with zipfile.ZipFile(zip_file_path, 'r') as zip_file:
+        for name in zip_file.namelist():
+            yield (os.path.join(zip_file_path, name),
+                   zip_file.open(name, 'r').read())
+
+
+def scan_elf_files(root, unzip_files=True):
+    """Scan all ELF files under a directory."""
     for path in scan_accessible_files(root):
+        # If this is a zip file and unzip_file is true, scan the ELF files in
+        # the zip file.
+        if unzip_files and is_zipfile(path):
+            for path, content in scan_zip_file(path):
+                try:
+                    yield (path, ELF.loads(content))
+                except ELFError:
+                    pass
+            continue
+
+        # Load ELF from the path.
         try:
             yield (path, ELF.load(path))
         except ELFError:
             pass
 
 
-def scan_elf_dump_files(root):
-    for path in scan_accessible_files(root):
-        if not path.endswith('.sym'):
-            continue
-        yield (path[0:-4], ELF.load_dump(path))
-
-
 PT_SYSTEM = 0
 PT_VENDOR = 1
 NUM_PARTITIONS = 2
 
 
 SPLibResult = collections.namedtuple(
-        'SPLibResult',
-        'sp_hal sp_hal_dep vndk_sp_hal ll_ndk ll_ndk_indirect '
-        'vndk_sp_both')
+    'SPLibResult',
+    'sp_hal sp_hal_dep vndk_sp_hal ll_ndk ll_ndk_indirect vndk_sp_both')
 
 
 VNDKLibTuple = defaultnamedtuple('VNDKLibTuple', 'vndk_sp vndk', [])
@@ -1356,19 +1513,18 @@
         """Extract VNDK version from a name."""
         if name in {'vndk', 'vndk-sp'}:
             return 'current'
-        elif name.startswith('vndk-sp-'):
+        if name.startswith('vndk-sp-'):
             return name[len('vndk-sp-'):]
-        elif name.startswith('vndk-'):
+        if name.startswith('vndk-'):
             return name[len('vndk-'):]
-        else:
-            return None
+        return None
 
 
     @classmethod
     def extract_path_component(cls, path, index):
         """Extract n-th path component from a posix path."""
         start = 0
-        for i in range(index):
+        for _ in range(index):
             pos = path.find('/', start)
             if pos == -1:
                 return None
@@ -1396,8 +1552,8 @@
             return False
         return (component == 'vndk' or
                 (component.startswith('vndk-') and
-                    not component == 'vndk-sp' and
-                    not component.startswith('vndk-sp-')))
+                 not component == 'vndk-sp' and
+                 not component.startswith('vndk-sp-')))
 
 
     @classmethod
@@ -1415,10 +1571,10 @@
         vndk_sp_name = cls.create_vndk_sp_dir_name(version)
         vndk_name = cls.create_vndk_dir_name(version)
         return VNDKLibTuple(
-                [posixpath.join('/vendor', lib_dir, vndk_sp_name),
-                 posixpath.join('/system', lib_dir, vndk_sp_name)],
-                [posixpath.join('/vendor', lib_dir, vndk_name),
-                 posixpath.join('/system', lib_dir, vndk_name)])
+            [posixpath.join('/vendor', lib_dir, vndk_sp_name),
+             posixpath.join('/system', lib_dir, vndk_sp_name)],
+            [posixpath.join('/vendor', lib_dir, vndk_name),
+             posixpath.join('/system', lib_dir, vndk_name)])
 
 
     @classmethod
@@ -1510,10 +1666,14 @@
         """Read ro.vendor.version property from vendor partitions."""
         for vendor_dir in vendor_dirs:
             path = os.path.join(vendor_dir, 'default.prop')
-            with open(path, 'r') as property_file:
-                result = cls._get_property(property_file, 'ro.vndk.version')
-                if result is not None:
-                    return result
+            try:
+                with open(path, 'r') as property_file:
+                    result = cls._get_property(
+                        property_file, 'ro.vndk.version')
+                    if result is not None:
+                        return result
+            except FileNotFoundError:
+                pass
         return None
 
 
@@ -1562,12 +1722,22 @@
         return self.sorted_version(self)[0]
 
 
+# File path patterns for Android apps
+_APP_DIR_PATTERNS = re.compile('^(?:/[^/]+){1,2}/(?:priv-)?app/')
+
+
 class ELFResolver(object):
     def __init__(self, lib_set, default_search_path):
         self.lib_set = lib_set
         self.default_search_path = default_search_path
 
-    def get_candidates(self, name, dt_rpath=None, dt_runpath=None):
+
+    def get_candidates(self, requester, name, dt_rpath=None, dt_runpath=None):
+        # Search app-specific search paths.
+        if _APP_DIR_PATTERNS.match(requester):
+            yield os.path.join(os.path.dirname(requester), name)
+
+        # Search default search paths.
         if dt_rpath:
             for d in dt_rpath:
                 yield os.path.join(d, name)
@@ -1577,8 +1747,9 @@
         for d in self.default_search_path:
             yield os.path.join(d, name)
 
-    def resolve(self, name, dt_rpath=None, dt_runpath=None):
-        for path in self.get_candidates(name, dt_rpath, dt_runpath):
+
+    def resolve(self, requester, name, dt_rpath=None, dt_runpath=None):
+        for path in self.get_candidates(requester, name, dt_rpath, dt_runpath):
             try:
                 return self.lib_set[path]
             except KeyError:
@@ -1605,54 +1776,65 @@
         self.unresolved_dt_needed = []
         self.linked_symbols = dict()
 
+
     @property
     def is_ll_ndk(self):
         return TaggedDict.is_ll_ndk(self._tag_bit)
 
+
     @property
     def is_vndk_sp(self):
         return TaggedDict.is_vndk_sp(self._tag_bit)
 
+
     @property
     def is_vndk_sp_indirect(self):
         return TaggedDict.is_vndk_sp_indirect(self._tag_bit)
 
+
     @property
     def is_vndk_sp_indirect_private(self):
         return TaggedDict.is_vndk_sp_indirect_private(self._tag_bit)
 
+
     @property
     def is_fwk_only_rs(self):
         return TaggedDict.is_fwk_only_rs(self._tag_bit)
 
+
     @property
     def is_sp_hal(self):
         return TaggedDict.is_sp_hal(self._tag_bit)
 
+
     def add_needed_dep(self, dst):
         assert dst not in self.deps_needed_hidden
         assert self not in dst.users_needed_hidden
         self.deps_needed.add(dst)
         dst.users_needed.add(self)
 
+
     def add_dlopen_dep(self, dst):
         assert dst not in self.deps_dlopen_hidden
         assert self not in dst.users_dlopen_hidden
         self.deps_dlopen.add(dst)
         dst.users_dlopen.add(self)
 
+
     def hide_needed_dep(self, dst):
         self.deps_needed.remove(dst)
         dst.users_needed.remove(self)
         self.deps_needed_hidden.add(dst)
         dst.users_needed_hidden.add(self)
 
+
     def hide_dlopen_dep(self, dst):
         self.deps_dlopen.remove(dst)
         dst.users_dlopen.remove(self)
         self.deps_dlopen_hidden.add(dst)
         dst.users_dlopen_hidden.add(self)
 
+
     @property
     def num_deps(self):
         """Get the number of dependencies.  If a library is linked by both
@@ -1660,23 +1842,28 @@
         return (len(self.deps_needed) + len(self.deps_needed_hidden) +
                 len(self.deps_dlopen) + len(self.deps_dlopen_hidden))
 
+
     @property
     def deps_all(self):
         return itertools.chain(self.deps_needed, self.deps_needed_hidden,
                                self.deps_dlopen, self.deps_dlopen_hidden)
 
+
     @property
     def deps_good(self):
         return itertools.chain(self.deps_needed, self.deps_dlopen)
 
+
     @property
     def deps_needed_all(self):
         return itertools.chain(self.deps_needed, self.deps_needed_hidden)
 
+
     @property
     def deps_dlopen_all(self):
         return itertools.chain(self.deps_dlopen, self.deps_dlopen_hidden)
 
+
     @property
     def num_users(self):
         """Get the number of users.  If a library is linked by both NEEDED and
@@ -1684,34 +1871,42 @@
         return (len(self.users_needed) + len(self.users_needed_hidden) +
                 len(self.users_dlopen) + len(self.users_dlopen_hidden))
 
+
     @property
     def users_all(self):
         return itertools.chain(self.users_needed, self.users_needed_hidden,
                                self.users_dlopen, self.users_dlopen_hidden)
 
+
     @property
     def users_good(self):
         return itertools.chain(self.users_needed, self.users_dlopen)
 
+
     @property
     def users_needed_all(self):
         return itertools.chain(self.users_needed, self.users_needed_hidden)
 
+
     @property
     def users_dlopen_all(self):
         return itertools.chain(self.users_dlopen, self.users_dlopen_hidden)
 
+
     def has_dep(self, dst):
         return (dst in self.deps_needed or dst in self.deps_needed_hidden or
                 dst in self.deps_dlopen or dst in self.deps_dlopen_hidden)
 
+
     def has_user(self, dst):
         return (dst in self.users_needed or dst in self.users_needed_hidden or
                 dst in self.users_dlopen or dst in self.users_dlopen_hidden)
 
+
     def is_system_lib(self):
         return self.partition == PT_SYSTEM
 
+
     def get_dep_linked_symbols(self, dep):
         symbols = set()
         for symbol, exp_lib in self.linked_symbols.items():
@@ -1719,6 +1914,7 @@
                 symbols.add(symbol)
         return sorted(symbols)
 
+
     def __lt__(self, rhs):
         return self.path < rhs.path
 
@@ -1728,33 +1924,40 @@
     libs.sort()
     return libs
 
+
 _VNDK_RESULT_FIELD_NAMES = (
-        'll_ndk', 'll_ndk_indirect',
-        'vndk_sp', 'vndk_sp_unused', 'vndk_sp_indirect',
-        'vndk_sp_indirect_unused', 'vndk_sp_indirect_private', 'vndk',
-        'vndk_indirect', 'fwk_only', 'fwk_only_rs', 'sp_hal', 'sp_hal_dep',
-        'vnd_only', 'vndk_ext', 'vndk_sp_ext', 'vndk_sp_indirect_ext',
-        'extra_vendor_libs')
+    'll_ndk', 'll_ndk_indirect',
+    'vndk_sp', 'vndk_sp_unused', 'vndk_sp_indirect',
+    'vndk_sp_indirect_unused', 'vndk_sp_indirect_private', 'vndk',
+    'vndk_indirect', 'fwk_only', 'fwk_only_rs', 'sp_hal', 'sp_hal_dep',
+    'vnd_only', 'vndk_ext', 'vndk_sp_ext', 'vndk_sp_indirect_ext',
+    'extra_vendor_libs')
+
 
 VNDKResult = defaultnamedtuple('VNDKResult', _VNDK_RESULT_FIELD_NAMES, set())
 
+
 _SIMPLE_VNDK_RESULT_FIELD_NAMES = (
-        'vndk_sp', 'vndk_sp_ext', 'extra_vendor_libs')
+    'vndk_sp', 'vndk_sp_ext', 'extra_vendor_libs')
+
 
 SimpleVNDKResult = defaultnamedtuple(
-        'SimpleVNDKResult', _SIMPLE_VNDK_RESULT_FIELD_NAMES, set())
+    'SimpleVNDKResult', _SIMPLE_VNDK_RESULT_FIELD_NAMES, set())
 
 
 class ELFLibDict(defaultnamedtuple('ELFLibDict', ('lib32', 'lib64'), {})):
     def get_lib_dict(self, elf_class):
         return self[elf_class - 1]
 
+
     def add(self, path, lib):
         self.get_lib_dict(lib.elf.ei_class)[path] = lib
 
+
     def remove(self, lib):
         del self.get_lib_dict(lib.elf.ei_class)[lib.path]
 
+
     def get(self, path, default=None):
         for lib_set in self:
             res = lib_set.get(path, None)
@@ -1762,12 +1965,15 @@
                 return res
         return default
 
+
     def keys(self):
         return itertools.chain(self.lib32.keys(), self.lib64.keys())
 
+
     def values(self):
         return itertools.chain(self.lib32.values(), self.lib64.values())
 
+
     def items(self):
         return itertools.chain(self.lib32.items(), self.lib64.items())
 
@@ -1785,26 +1991,30 @@
         if tagged_paths is None:
             script_dir = os.path.dirname(os.path.abspath(__file__))
             dataset_path = os.path.join(
-                    script_dir, 'datasets', 'minimum_tag_file.csv')
+                script_dir, 'datasets', 'minimum_tag_file.csv')
             self.tagged_paths = TaggedPathDict.create_from_csv_path(
-                    dataset_path, vndk_lib_dirs)
+                dataset_path, vndk_lib_dirs)
         else:
             self.tagged_paths = tagged_paths
 
         self.ro_vndk_version = ro_vndk_version
 
+
     def _add_lib_to_lookup_dict(self, lib):
         self.lib_pt[lib.partition].add(lib.path, lib)
 
+
     def _remove_lib_from_lookup_dict(self, lib):
         self.lib_pt[lib.partition].remove(lib)
 
+
     def add_lib(self, partition, path, elf):
         lib = ELFLinkData(partition, path, elf,
                           self.tagged_paths.get_path_tag_bit(path))
         self._add_lib_to_lookup_dict(lib)
         return lib
 
+
     def add_dlopen_dep(self, src_path, dst_path):
         num_matches = 0
         for elf_class in (ELF.ELFCLASS32, ELF.ELFCLASS64):
@@ -1817,6 +2027,7 @@
             raise ValueError('Failed to add dlopen dependency from {} to {}'
                              .format(src_path, dst_path))
 
+
     def _get_libs_in_elf_class(self, elf_class, path):
         result = set()
         if '${LIB}' in path:
@@ -1826,7 +2037,7 @@
             patt = re.compile(path[7:])
             for partition in range(NUM_PARTITIONS):
                 lib_set = self.lib_pt[partition].get_lib_dict(elf_class)
-                for path ,lib in lib_set.items():
+                for path, lib in lib_set.items():
                     if patt.match(path):
                         result.add(lib)
         else:
@@ -1837,6 +2048,7 @@
                     result.add(lib)
         return result
 
+
     def get_lib(self, path):
         for lib_set in self.lib_pt:
             lib = lib_set.get(path)
@@ -1844,6 +2056,7 @@
                 return lib
         return None
 
+
     def get_libs(self, paths, report_error=None):
         result = set()
         for path in paths:
@@ -1856,49 +2069,56 @@
             result.add(lib)
         return result
 
+
     def all_libs(self):
         for lib_set in self.lib_pt:
             for lib in lib_set.values():
                 yield lib
 
+
     def _compute_lib_dict(self, elf_class):
         res = dict()
         for lib_pt in self.lib_pt:
             res.update(lib_pt.get_lib_dict(elf_class))
         return res
 
+
     @staticmethod
     def _compile_path_matcher(root, subdirs):
         dirs = [os.path.normpath(os.path.join(root, i)) for i in subdirs]
         patts = ['(?:' + re.escape(i) + os.sep + ')' for i in dirs]
         return re.compile('|'.join(patts))
 
+
     def add_executables_in_dir(self, partition_name, partition, root,
                                alter_partition, alter_subdirs, ignored_subdirs,
-                               scan_elf_files):
+                               scan_elf_files, unzip_files):
         root = os.path.abspath(root)
         prefix_len = len(root) + 1
 
         if alter_subdirs:
             alter_patt = ELFLinker._compile_path_matcher(root, alter_subdirs)
         if ignored_subdirs:
-            ignored_patt = ELFLinker._compile_path_matcher(root, ignored_subdirs)
+            ignored_patt = ELFLinker._compile_path_matcher(
+                root, ignored_subdirs)
 
-        for path, elf in scan_elf_files(root):
+        for path, elf in scan_elf_files(root, unzip_files):
             # Ignore ELF files with unknown machine ID (eg. DSP).
             if elf.e_machine not in ELF.ELF_MACHINES:
                 continue
 
             # Ignore ELF files with matched path.
-            short_path = os.path.join('/', partition_name, path[prefix_len:])
             if ignored_subdirs and ignored_patt.match(path):
                 continue
 
+            short_path = os.path.join('/', partition_name, path[prefix_len:])
+
             if alter_subdirs and alter_patt.match(path):
                 self.add_lib(alter_partition, short_path, elf)
             else:
                 self.add_lib(partition, short_path, elf)
 
+
     def add_dlopen_deps(self, path):
         patt = re.compile('([^:]*):\\s*(.*)')
         with open(path, 'r') as dlopen_dep_file:
@@ -1912,6 +2132,7 @@
                     print('error:{}:{}: {}.'.format(path, line_no, e),
                           file=sys.stderr)
 
+
     def _find_exported_symbol(self, symbol, libs):
         """Find the shared library with the exported symbol."""
         for lib in libs:
@@ -1919,6 +2140,7 @@
                 return lib
         return None
 
+
     def _resolve_lib_imported_symbols(self, lib, imported_libs, generic_refs):
         """Resolve the imported symbols in a library."""
         for symbol in lib.elf.imported_symbols:
@@ -1932,22 +2154,25 @@
                     if not ref_lib or not symbol in ref_lib.exported_symbols:
                         lib.imported_ext_symbols[imported_lib].add(symbol)
 
+
     def _resolve_lib_dt_needed(self, lib, resolver):
         imported_libs = []
         for dt_needed in lib.elf.dt_needed:
-            dep = resolver.resolve(dt_needed, lib.elf.dt_rpath,
+            dep = resolver.resolve(lib.path, dt_needed, lib.elf.dt_rpath,
                                    lib.elf.dt_runpath)
             if not dep:
                 candidates = list(resolver.get_candidates(
-                    dt_needed, lib.elf.dt_rpath, lib.elf.dt_runpath))
+                    lib.path, dt_needed, lib.elf.dt_rpath, lib.elf.dt_runpath))
                 print('warning: {}: Missing needed library: {}  Tried: {}'
-                      .format(lib.path, dt_needed, candidates), file=sys.stderr)
+                      .format(lib.path, dt_needed, candidates),
+                      file=sys.stderr)
                 lib.unresolved_dt_needed.append(dt_needed)
                 continue
             lib.add_needed_dep(dep)
             imported_libs.append(dep)
         return imported_libs
 
+
     def _resolve_lib_deps(self, lib, resolver, generic_refs):
         # Resolve DT_NEEDED entries.
         imported_libs = self._resolve_lib_dt_needed(lib, resolver)
@@ -1963,6 +2188,7 @@
         # Resolve imported symbols.
         self._resolve_lib_imported_symbols(lib, imported_libs, generic_refs)
 
+
     def _resolve_lib_set_deps(self, lib_set, resolver, generic_refs):
         for lib in lib_set:
             self._resolve_lib_deps(lib, resolver, generic_refs)
@@ -1975,6 +2201,7 @@
             '/vendor/' + lib_dir,
         ]
 
+
     def _get_vendor_search_paths(self, lib_dir, vndk_sp_dirs, vndk_dirs):
         vendor_lib_dirs = [
             '/vendor/' + lib_dir + '/hw',
@@ -2013,11 +2240,11 @@
 
         system_lib_dict = self.lib_pt[PT_SYSTEM].get_lib_dict(elf_class)
         system_vndk_sp_libs, system_vndk_libs, system_libs = \
-                vndk_lib_dirs.classify_vndk_libs(system_lib_dict.values())
+            vndk_lib_dirs.classify_vndk_libs(system_lib_dict.values())
 
         vendor_lib_dict = self.lib_pt[PT_VENDOR].get_lib_dict(elf_class)
         vendor_vndk_sp_libs, vendor_vndk_libs, vendor_libs = \
-                vndk_lib_dirs.classify_vndk_libs(vendor_lib_dict.values())
+            vndk_lib_dirs.classify_vndk_libs(vendor_lib_dict.values())
 
         # Resolve system libs.
         search_paths = self._get_system_search_paths(lib_dir)
@@ -2027,28 +2254,29 @@
         # Resolve vndk-sp libs
         for version in vndk_lib_dirs:
             vndk_sp_dirs, vndk_dirs = \
-                    vndk_lib_dirs.create_vndk_search_paths(lib_dir, version)
-            vndk_sp_libs = system_vndk_sp_libs[version] | \
-                           vendor_vndk_sp_libs[version]
-            search_paths = self._get_vndk_sp_search_paths(lib_dir, vndk_sp_dirs)
+                vndk_lib_dirs.create_vndk_search_paths(lib_dir, version)
+            vndk_sp_libs = \
+                system_vndk_sp_libs[version] | vendor_vndk_sp_libs[version]
+            search_paths = self._get_vndk_sp_search_paths(
+                lib_dir, vndk_sp_dirs)
             resolver = ELFResolver(lib_dict, search_paths)
             self._resolve_lib_set_deps(vndk_sp_libs, resolver, generic_refs)
 
         # Resolve vndk libs
         for version in vndk_lib_dirs:
             vndk_sp_dirs, vndk_dirs = \
-                    vndk_lib_dirs.create_vndk_search_paths(lib_dir, version)
+                vndk_lib_dirs.create_vndk_search_paths(lib_dir, version)
             vndk_libs = system_vndk_libs[version] | vendor_vndk_libs[version]
             search_paths = self._get_vndk_search_paths(
-                    lib_dir, vndk_sp_dirs, vndk_dirs)
+                lib_dir, vndk_sp_dirs, vndk_dirs)
             resolver = ELFResolver(lib_dict, search_paths)
             self._resolve_lib_set_deps(vndk_libs, resolver, generic_refs)
 
         # Resolve vendor libs.
         vndk_sp_dirs, vndk_dirs = vndk_lib_dirs.create_vndk_search_paths(
-                lib_dir, self.ro_vndk_version)
+            lib_dir, self.ro_vndk_version)
         search_paths = self._get_vendor_search_paths(
-                lib_dir, vndk_sp_dirs, vndk_dirs)
+            lib_dir, vndk_sp_dirs, vndk_dirs)
         resolver = ELFResolver(lib_dict, search_paths)
         self._resolve_lib_set_deps(vendor_libs, resolver, generic_refs)
 
@@ -2069,7 +2297,7 @@
 
         ll_ndk = set(lib for lib in self.all_libs() if lib.is_ll_ndk)
         ll_ndk_closure = self.compute_deps_closure(
-                ll_ndk, is_ll_ndk_or_sp_hal, ignore_hidden_deps)
+            ll_ndk, is_ll_ndk_or_sp_hal, ignore_hidden_deps)
         ll_ndk_indirect = ll_ndk_closure - ll_ndk
 
         def is_ll_ndk(lib):
@@ -2077,7 +2305,7 @@
 
         sp_hal = self.compute_predefined_sp_hal()
         sp_hal_closure = self.compute_deps_closure(
-                sp_hal, is_ll_ndk, ignore_hidden_deps)
+            sp_hal, is_ll_ndk, ignore_hidden_deps)
 
         def is_aosp_lib(lib):
             return (not generic_refs or
@@ -2098,6 +2326,7 @@
         return SPLibResult(sp_hal, sp_hal_dep, vndk_sp_hal, ll_ndk,
                            ll_ndk_indirect, vndk_sp_both)
 
+
     def normalize_partition_tags(self, sp_hals, generic_refs):
         def is_system_lib_or_sp_hal(lib):
             return lib.is_system_lib() or lib in sp_hals
@@ -2123,6 +2352,7 @@
                           file=sys.stderr)
                     lib.hide_dlopen_dep(dep)
 
+
     @staticmethod
     def _parse_action_on_ineligible_lib(arg):
         follow = False
@@ -2138,6 +2368,7 @@
                 raise ValueError('unknown action \"{}\"'.format(flag))
         return (follow, warn)
 
+
     def compute_degenerated_vndk(self, generic_refs, tagged_paths=None,
                                  action_ineligible_vndk_sp='warn',
                                  action_ineligible_vndk='warn'):
@@ -2147,12 +2378,11 @@
         # Find pre-defined libs.
         fwk_only_rs = set(lib for lib in self.all_libs() if lib.is_fwk_only_rs)
         predefined_vndk_sp = set(
-                lib for lib in self.all_libs() if lib.is_vndk_sp)
+            lib for lib in self.all_libs() if lib.is_vndk_sp)
         predefined_vndk_sp_indirect = set(
-                lib for lib in self.all_libs() if lib.is_vndk_sp_indirect)
+            lib for lib in self.all_libs() if lib.is_vndk_sp_indirect)
         predefined_vndk_sp_indirect_private = set(
-                lib for lib in self.all_libs()
-                if lib.is_vndk_sp_indirect_private)
+            lib for lib in self.all_libs() if lib.is_vndk_sp_indirect_private)
 
         # FIXME: Don't squash VNDK-SP-Indirect-Private into VNDK-SP-Indirect.
         predefined_vndk_sp_indirect |= predefined_vndk_sp_indirect_private
@@ -2186,7 +2416,7 @@
             return lib.is_ll_ndk or lib in sp_hal or lib in sp_hal_dep
 
         follow_ineligible_vndk_sp, warn_ineligible_vndk_sp = \
-                self._parse_action_on_ineligible_lib(action_ineligible_vndk_sp)
+            self._parse_action_on_ineligible_lib(action_ineligible_vndk_sp)
         vndk_sp = set()
         for lib in itertools.chain(sp_hal, sp_hal_dep):
             for dep in lib.deps_all:
@@ -2207,7 +2437,7 @@
             return lib.is_ll_ndk or lib in vndk_sp or lib in fwk_only_rs
 
         vndk_sp_indirect = self.compute_deps_closure(
-                vndk_sp, is_not_vndk_sp_indirect, True)
+            vndk_sp, is_not_vndk_sp_indirect, True)
         vndk_sp_indirect -= vndk_sp
 
         # Find unused predefined VNDK-SP libs.
@@ -2220,11 +2450,12 @@
         def is_not_vndk_sp_indirect_unused(lib):
             return is_not_vndk_sp_indirect(lib) or lib in vndk_sp_indirect
         vndk_sp_unused_deps = self.compute_deps_closure(
-                vndk_sp_unused, is_not_vndk_sp_indirect_unused, True)
+            vndk_sp_unused, is_not_vndk_sp_indirect_unused, True)
         vndk_sp_unused_deps -= vndk_sp_unused
 
-        vndk_sp_indirect_unused = set(lib for lib in predefined_vndk_sp_indirect
-                                      if VNDKLibDir.is_in_vndk_sp_dir(lib.path))
+        vndk_sp_indirect_unused = set(
+            lib for lib in predefined_vndk_sp_indirect
+            if VNDKLibDir.is_in_vndk_sp_dir(lib.path))
         vndk_sp_indirect_unused -= vndk_sp_indirect
         vndk_sp_indirect_unused -= vndk_sp_unused
         vndk_sp_indirect_unused |= vndk_sp_unused_deps
@@ -2232,8 +2463,8 @@
         # TODO: Compute VNDK-SP-Indirect-Private.
         vndk_sp_indirect_private = set()
 
-        assert not (vndk_sp & vndk_sp_indirect)
-        assert not (vndk_sp_unused & vndk_sp_indirect_unused)
+        assert not vndk_sp & vndk_sp_indirect
+        assert not vndk_sp_unused & vndk_sp_indirect_unused
 
         # Define helper functions for vndk_sp sets.
         def is_vndk_sp_public(lib):
@@ -2259,7 +2490,7 @@
 
             # Add the dependencies to vndk_sp_indirect if they are not vndk_sp.
             closure = self.compute_deps_closure(
-                    {lib}, lambda lib: lib not in vndk_sp_indirect_unused, True)
+                {lib}, lambda lib: lib not in vndk_sp_indirect_unused, True)
             closure.remove(lib)
             vndk_sp_indirect_unused.difference_update(closure)
             vndk_sp_indirect.update(closure)
@@ -2391,29 +2622,30 @@
                    is_vndk_sp(lib) or is_vndk(lib)
 
         ll_ndk_indirect = self.compute_deps_closure(
-                ll_ndk, is_not_ll_ndk_indirect, True)
+            ll_ndk, is_not_ll_ndk_indirect, True)
         ll_ndk_indirect -= ll_ndk
 
         # Return the VNDK classifications.
         return VNDKResult(
-                ll_ndk=ll_ndk,
-                ll_ndk_indirect=ll_ndk_indirect,
-                vndk_sp=vndk_sp,
-                vndk_sp_indirect=vndk_sp_indirect,
-                # vndk_sp_indirect_private=vndk_sp_indirect_private,
-                vndk_sp_unused=vndk_sp_unused,
-                vndk_sp_indirect_unused=vndk_sp_indirect_unused,
-                vndk=vndk,
-                vndk_indirect=vndk_indirect,
-                # fwk_only=fwk_only,
-                fwk_only_rs=fwk_only_rs,
-                sp_hal=sp_hal,
-                sp_hal_dep=sp_hal_dep,
-                # vnd_only=vnd_only,
-                vndk_ext=vndk_ext,
-                vndk_sp_ext=vndk_sp_ext,
-                vndk_sp_indirect_ext=vndk_sp_indirect_ext,
-                extra_vendor_libs=extra_vendor_libs)
+            ll_ndk=ll_ndk,
+            ll_ndk_indirect=ll_ndk_indirect,
+            vndk_sp=vndk_sp,
+            vndk_sp_indirect=vndk_sp_indirect,
+            # vndk_sp_indirect_private=vndk_sp_indirect_private,
+            vndk_sp_unused=vndk_sp_unused,
+            vndk_sp_indirect_unused=vndk_sp_indirect_unused,
+            vndk=vndk,
+            vndk_indirect=vndk_indirect,
+            # fwk_only=fwk_only,
+            fwk_only_rs=fwk_only_rs,
+            sp_hal=sp_hal,
+            sp_hal_dep=sp_hal_dep,
+            # vnd_only=vnd_only,
+            vndk_ext=vndk_ext,
+            vndk_sp_ext=vndk_sp_ext,
+            vndk_sp_indirect_ext=vndk_sp_indirect_ext,
+            extra_vendor_libs=extra_vendor_libs)
+
 
     @staticmethod
     def _compute_closure(root_set, is_excluded, get_successors):
@@ -2429,6 +2661,7 @@
                     stack.append(succ)
         return closure
 
+
     @classmethod
     def compute_deps_closure(cls, root_set, is_excluded,
                              ignore_hidden_deps=False):
@@ -2436,6 +2669,7 @@
                          (lambda x: x.deps_all)
         return cls._compute_closure(root_set, is_excluded, get_successors)
 
+
     @classmethod
     def compute_users_closure(cls, root_set, is_excluded,
                               ignore_hidden_users=False):
@@ -2443,31 +2677,32 @@
                          (lambda x: x.users_all)
         return cls._compute_closure(root_set, is_excluded, get_successors)
 
+
     @staticmethod
     def _create_internal(scan_elf_files, system_dirs, system_dirs_as_vendor,
                          system_dirs_ignored, vendor_dirs,
                          vendor_dirs_as_system, vendor_dirs_ignored,
                          extra_deps, generic_refs, tagged_paths,
-                         vndk_lib_dirs):
+                         vndk_lib_dirs, unzip_files):
         if vndk_lib_dirs is None:
             vndk_lib_dirs = VNDKLibDir.create_from_dirs(
-                    system_dirs, vendor_dirs)
+                system_dirs, vendor_dirs)
         ro_vndk_version = vndk_lib_dirs.find_vendor_vndk_version(vendor_dirs)
         graph = ELFLinker(tagged_paths, vndk_lib_dirs, ro_vndk_version)
 
         if system_dirs:
             for path in system_dirs:
-                graph.add_executables_in_dir('system', PT_SYSTEM, path,
-                                             PT_VENDOR, system_dirs_as_vendor,
-                                             system_dirs_ignored,
-                                             scan_elf_files)
+                graph.add_executables_in_dir(
+                    'system', PT_SYSTEM, path, PT_VENDOR,
+                    system_dirs_as_vendor, system_dirs_ignored,
+                    scan_elf_files, unzip_files)
 
         if vendor_dirs:
             for path in vendor_dirs:
-                graph.add_executables_in_dir('vendor', PT_VENDOR, path,
-                                             PT_SYSTEM, vendor_dirs_as_system,
-                                             vendor_dirs_ignored,
-                                             scan_elf_files)
+                graph.add_executables_in_dir(
+                    'vendor', PT_VENDOR, path, PT_SYSTEM,
+                    vendor_dirs_as_system, vendor_dirs_ignored,
+                    scan_elf_files, unzip_files)
 
         if extra_deps:
             for path in extra_deps:
@@ -2477,17 +2712,18 @@
 
         return graph
 
+
     @staticmethod
     def create(system_dirs=None, system_dirs_as_vendor=None,
                system_dirs_ignored=None, vendor_dirs=None,
                vendor_dirs_as_system=None, vendor_dirs_ignored=None,
                extra_deps=None, generic_refs=None, tagged_paths=None,
-               vndk_lib_dirs=None):
+               vndk_lib_dirs=None, unzip_files=True):
         return ELFLinker._create_internal(
-                scan_elf_files, system_dirs, system_dirs_as_vendor,
-                system_dirs_ignored, vendor_dirs, vendor_dirs_as_system,
-                vendor_dirs_ignored, extra_deps, generic_refs, tagged_paths,
-                vndk_lib_dirs)
+            scan_elf_files, system_dirs, system_dirs_as_vendor,
+            system_dirs_ignored, vendor_dirs, vendor_dirs_as_system,
+            vendor_dirs_ignored, extra_deps, generic_refs, tagged_paths,
+            vndk_lib_dirs, unzip_files)
 
 
 #------------------------------------------------------------------------------
@@ -2500,25 +2736,28 @@
     EXPORT_SUPER_SET = 2
     MODIFIED = 3
 
+
     def __init__(self):
         self.refs = dict()
         self._lib_names = set()
 
+
     def add(self, path, elf):
         self.refs[path] = elf
         self._lib_names.add(os.path.basename(path))
 
+
     def _load_from_sym_dir(self, root):
         root = os.path.abspath(root)
         prefix_len = len(root) + 1
-        for base, dirnames, filenames in os.walk(root):
+        for base, _, filenames in os.walk(root):
             for filename in filenames:
                 if not filename.endswith('.sym'):
                     continue
                 path = os.path.join(base, filename)
                 lib_path = '/' + path[prefix_len:-4]
-                with open(path, 'r') as f:
-                    self.add(lib_path, ELF.load_dump(path))
+                self.add(lib_path, ELF.load_dump(path))
+
 
     @staticmethod
     def create_from_sym_dir(root):
@@ -2526,18 +2765,21 @@
         result._load_from_sym_dir(root)
         return result
 
+
     def _load_from_image_dir(self, root, prefix):
         root = os.path.abspath(root)
         root_len = len(root) + 1
         for path, elf in scan_elf_files(root):
             self.add(os.path.join(prefix, path[root_len:]), elf)
 
+
     @staticmethod
     def create_from_image_dir(root, prefix):
         result = GenericRefs()
         result._load_from_image_dir(root, prefix)
         return result
 
+
     def classify_lib(self, lib):
         ref_lib = self.refs.get(lib.path)
         if not ref_lib:
@@ -2549,9 +2791,11 @@
             return GenericRefs.EXPORT_SUPER_SET
         return GenericRefs.MODIFIED
 
+
     def is_equivalent_lib(self, lib):
         return self.classify_lib(lib) == GenericRefs.EXPORT_EQUAL
 
+
     def has_same_name_lib(self, lib):
         return os.path.basename(lib.path) in self._lib_names
 
@@ -2588,9 +2832,11 @@
 
 def _enumerate_partition_paths(partition, root):
     prefix_len = len(root) + 1
-    for base, dirs, files in os.walk(root):
+    for base, _, files in os.walk(root):
         for filename in files:
             path = os.path.join(base, filename)
+            if not is_accessible(path):
+                continue
             android_path = posixpath.join('/', partition, path[prefix_len:])
             yield (android_path, path)
 
@@ -2608,27 +2854,53 @@
     libnames = _build_lib_names_dict(graph)
     results = []
 
+    if str is bytes:
+        def decode(string):  # PY2
+            return string.decode('mutf-8').encode('utf-8')
+    else:
+        def decode(string):  # PY3
+            return string.decode('mutf-8')
+
     for ap, path in _enumerate_paths(system_dirs, vendor_dirs):
         # Read the dex file from various file formats
         try:
-            if DexFileReader.is_zipfile(path):
-                strs = set(DexFileReader.enumerate_dex_strings_apk(path))
-            elif DexFileReader.is_vdex_file(path):
-                strs = set(DexFileReader.enumerate_dex_strings_vdex(path))
-            else:
+            dex_string_iter = DexFileReader.enumerate_dex_strings(path)
+            if dex_string_iter is None:
                 continue
+
+            strings = set()
+            for string in dex_string_iter:
+                try:
+                    strings.add(decode(string))
+                except UnicodeSurrogateDecodeError:
+                    pass
         except FileNotFoundError:
             continue
+        except:
+            print('error: Failed to parse', path, file=sys.stderr)
+            raise
 
         # Skip the file that does not call System.loadLibrary()
-        if 'loadLibrary' not in strs:
+        if 'loadLibrary' not in strings:
             continue
 
         # Collect libraries from string tables
         libs = set()
-        for string in strs:
+        for string in strings:
             try:
-                libs.update(libnames[string])
+                for dep_file in libnames[string]:
+                    match = _APP_DIR_PATTERNS.match(dep_file.path)
+
+                    # List the lib if it is not embedded in the app.
+                    if not match:
+                        libs.add(dep_file)
+                        continue
+
+                    # Only list the embedded lib if it is in the same app.
+                    common = os.path.commonprefix([ap, dep_file.path])
+                    if len(common) > len(match.group(0)):
+                        libs.add(dep_file)
+                        continue
             except KeyError:
                 pass
 
@@ -2651,23 +2923,26 @@
 
         mods = collections.defaultdict(set)
         installed_path_patt = re.compile(
-                '.*[\\\\/]target[\\\\/]product[\\\\/][^\\\\/]+([\\\\/].*)$')
-        for name, module in json.items():
+            '.*[\\\\/]target[\\\\/]product[\\\\/][^\\\\/]+([\\\\/].*)$')
+        for module in json.values():
             for path in module['installed']:
                 match = installed_path_patt.match(path)
                 if match:
                     for path in module['path']:
                         mods[match.group(1)].add(path)
-        self._mods = { installed_path: sorted(src_dirs)
-                       for installed_path, src_dirs in mods.items() }
+        self._mods = {installed_path: sorted(src_dirs)
+                      for installed_path, src_dirs in mods.items()}
+
 
     def get_module_path(self, installed_path):
         return self._mods.get(installed_path, [])
 
+
     @staticmethod
     def load(f):
         return ModuleInfo(json.load(f))
 
+
     @staticmethod
     def load_from_path_or_default(path):
         if not path:
@@ -2695,11 +2970,13 @@
 class ELFDumpCommand(Command):
     def __init__(self):
         super(ELFDumpCommand, self).__init__(
-                'elfdump', help='Dump ELF .dynamic section')
+            'elfdump', help='Dump ELF .dynamic section')
+
 
     def add_argparser_options(self, parser):
         parser.add_argument('path', help='path to an ELF file')
 
+
     def main(self, args):
         try:
             ELF.load(args.path).dump()
@@ -2713,14 +2990,15 @@
 class CreateGenericRefCommand(Command):
     def __init__(self):
         super(CreateGenericRefCommand, self).__init__(
-                'create-generic-ref', help='Create generic references')
+            'create-generic-ref', help='Create generic references')
+
 
     def add_argparser_options(self, parser):
         parser.add_argument('dir')
 
-        parser.add_argument(
-                '--output', '-o', metavar='PATH', required=True,
-                help='output directory')
+        parser.add_argument('-o', '--output', required=True,
+                            help='output directory')
+
 
     def main(self, args):
         root = os.path.abspath(args.dir)
@@ -2737,68 +3015,82 @@
 
 
 class ELFGraphCommand(Command):
-    def add_argparser_options(self, parser):
+    def add_argparser_options(self, parser, is_tag_file_required=None):
         parser.add_argument(
-                '--load-extra-deps', action='append',
-                help='load extra module dependencies')
+            '--load-extra-deps', action='append',
+            help='load extra module dependencies')
 
         parser.add_argument(
-                '--system', action='append',
-                help='path to system partition contents')
+            '--system', action='append',
+            help='path to system partition contents')
 
         parser.add_argument(
-                '--vendor', action='append',
-                help='path to vendor partition contents')
+            '--vendor', action='append',
+            help='path to vendor partition contents')
 
         parser.add_argument(
-                '--system-dir-as-vendor', action='append',
-                help='sub directory of system partition that has vendor files')
+            '--system-dir-as-vendor', action='append',
+            help='sub directory of system partition that has vendor files')
 
         parser.add_argument(
-                '--system-dir-ignored', action='append',
-                help='sub directory of system partition that must be ignored')
+            '--system-dir-ignored', action='append',
+            help='sub directory of system partition that must be ignored')
 
         parser.add_argument(
-                '--vendor-dir-as-system', action='append',
-                help='sub directory of vendor partition that has system files')
+            '--vendor-dir-as-system', action='append',
+            help='sub directory of vendor partition that has system files')
 
         parser.add_argument(
-                '--vendor-dir-ignored', action='append',
-                help='sub directory of vendor partition that must be ignored')
+            '--vendor-dir-ignored', action='append',
+            help='sub directory of vendor partition that must be ignored')
 
         parser.add_argument(
-                '--load-generic-refs',
-                help='compare with generic reference symbols')
+            '--load-generic-refs',
+            help='compare with generic reference symbols')
 
         parser.add_argument(
-                '--aosp-system',
-                help='compare with AOSP generic system image directory')
+            '--aosp-system',
+            help='compare with AOSP generic system image directory')
 
-        parser.add_argument('--tag-file', help='lib tag file')
+        parser.add_argument(
+            '--unzip-files', action='store_true', default=True,
+            help='scan ELF files in zip files')
+
+        parser.add_argument(
+            '--no-unzip-files', action='store_false', dest='unzip_files',
+            help='do not scan ELF files in zip files')
+
+        parser.add_argument(
+            '--tag-file', required=is_tag_file_required,
+            help='lib tag file')
+
 
     def get_generic_refs_from_args(self, args):
         if args.load_generic_refs:
             return GenericRefs.create_from_sym_dir(args.load_generic_refs)
         if args.aosp_system:
-            return GenericRefs.create_from_image_dir(args.aosp_system,
-                                                     '/system')
+            return GenericRefs.create_from_image_dir(
+                args.aosp_system, '/system')
         return None
 
+
     def _check_arg_dir_exists(self, arg_name, dirs):
         for path in dirs:
             if not os.path.exists(path):
-                print('error: Failed to find the directory "{}" specified in {}'
-                        .format(path, arg_name), file=sys.stderr)
+                print('error: Failed to find the directory "{}" specified in '
+                      '"{}"'.format(path, arg_name), file=sys.stderr)
                 sys.exit(1)
             if not os.path.isdir(path):
                 print('error: Path "{}" specified in {} is not a directory'
-                        .format(path, arg_name), file=sys.stderr)
+                      .format(path, arg_name), file=sys.stderr)
                 sys.exit(1)
 
+
     def check_dirs_from_args(self, args):
         self._check_arg_dir_exists('--system', args.system)
         self._check_arg_dir_exists('--vendor', args.vendor)
 
+
     def create_from_args(self, args):
         self.check_dirs_from_args(args)
 
@@ -2808,7 +3100,7 @@
 
         if args.tag_file:
             tagged_paths = TaggedPathDict.create_from_csv_path(
-                    args.tag_file, vndk_lib_dirs)
+                args.tag_file, vndk_lib_dirs)
         else:
             tagged_paths = None
 
@@ -2818,7 +3110,8 @@
                                  args.vendor_dir_ignored,
                                  args.load_extra_deps,
                                  generic_refs=generic_refs,
-                                 tagged_paths=tagged_paths)
+                                 tagged_paths=tagged_paths,
+                                 unzip_files=args.unzip_files)
 
         return (generic_refs, graph, tagged_paths, vndk_lib_dirs)
 
@@ -2827,30 +3120,31 @@
     def add_argparser_options(self, parser):
         super(VNDKCommandBase, self).add_argparser_options(parser)
 
-        parser.add_argument('--no-default-dlopen-deps', action='store_true',
-                help='do not add default dlopen dependencies')
+        parser.add_argument(
+            '--no-default-dlopen-deps', action='store_true',
+            help='do not add default dlopen dependencies')
 
         parser.add_argument(
-                '--action-ineligible-vndk-sp', default='warn',
-                help='action when a sp-hal uses non-vndk-sp libs '
-                     '(option: follow,warn,ignore)')
+            '--action-ineligible-vndk-sp', default='warn',
+            help='action when a sp-hal uses non-vndk-sp libs '
+                 '(option: follow,warn,ignore)')
 
         parser.add_argument(
-                '--action-ineligible-vndk', default='warn',
-                help='action when a vendor lib/exe uses fwk-only libs '
-                     '(option: follow,warn,ignore)')
+            '--action-ineligible-vndk', default='warn',
+            help='action when a vendor lib/exe uses fwk-only libs '
+                 '(option: follow,warn,ignore)')
+
 
     def create_from_args(self, args):
         """Create all essential data structures for VNDK computation."""
 
-        generic_refs, graph, tagged_paths, vndk_lib_dirs  = \
-                super(VNDKCommandBase, self).\
-                create_from_args(args)
+        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
+            super(VNDKCommandBase, self).create_from_args(args)
 
         if not args.no_default_dlopen_deps:
             script_dir = os.path.dirname(os.path.abspath(__file__))
-            minimum_dlopen_deps = os.path.join(script_dir, 'datasets',
-                                               'minimum_dlopen_deps.txt')
+            minimum_dlopen_deps = os.path.join(
+                script_dir, 'datasets', 'minimum_dlopen_deps.txt')
             graph.add_dlopen_deps(minimum_dlopen_deps)
 
         return (generic_refs, graph, tagged_paths, vndk_lib_dirs)
@@ -2859,26 +3153,28 @@
 class VNDKCommand(VNDKCommandBase):
     def __init__(self):
         super(VNDKCommand, self).__init__(
-                'vndk', help='Compute VNDK libraries set')
+            'vndk', help='Compute VNDK libraries set')
+
 
     def add_argparser_options(self, parser):
         super(VNDKCommand, self).add_argparser_options(parser)
 
         parser.add_argument(
-                '--warn-incorrect-partition', action='store_true',
-                help='warn about libraries only have cross partition linkages')
+            '--warn-incorrect-partition', action='store_true',
+            help='warn about libraries only have cross partition linkages')
 
         parser.add_argument(
-                '--full', action='store_true',
-                help='print all classification')
+            '--full', action='store_true',
+            help='print all classification')
 
         parser.add_argument(
-                '--output-format', default='tag',
-                help='output format for vndk classification')
+            '--output-format', default='tag',
+            help='output format for vndk classification')
 
         parser.add_argument(
-                '--file-size-output',
-                help='output file for calculated file sizes')
+            '--file-size-output',
+            help='output file for calculated file sizes')
+
 
     def _warn_incorrect_partition_lib_set(self, lib_set, partition, error_msg):
         for lib in lib_set.values():
@@ -2887,16 +3183,18 @@
             if all((user.partition != partition for user in lib.users_all)):
                 print(error_msg.format(lib.path), file=sys.stderr)
 
+
     def _warn_incorrect_partition(self, graph):
         self._warn_incorrect_partition_lib_set(
-                graph.lib_pt[PT_VENDOR], PT_VENDOR,
-                'warning: {}: This is a vendor library with framework-only '
-                'usages.')
+            graph.lib_pt[PT_VENDOR], PT_VENDOR,
+            'warning: {}: This is a vendor library with framework-only '
+            'usages.')
 
         self._warn_incorrect_partition_lib_set(
-                graph.lib_pt[PT_SYSTEM], PT_SYSTEM,
-                'warning: {}: This is a framework library with vendor-only '
-                'usages.')
+            graph.lib_pt[PT_SYSTEM], PT_SYSTEM,
+            'warning: {}: This is a framework library with vendor-only '
+            'usages.')
+
 
     @staticmethod
     def _extract_simple_vndk_result(vndk_result):
@@ -2918,6 +3216,7 @@
             getattr(results, tag).update(getattr(vndk_result, field_name))
         return results
 
+
     def _print_tags(self, vndk_lib, full, file=sys.stdout):
         if full:
             result_tags = _VNDK_RESULT_FIELD_NAMES
@@ -2933,19 +3232,18 @@
             for lib in sorted_lib_path_list(libs):
                 print(tag, lib, file=file)
 
+
     def _print_make(self, vndk_lib, file=sys.stdout):
         def get_module_name(path):
-            name = os.path.basename(path)
-            root, ext = os.path.splitext(name)
-            return root
+            return os.path.splitext(os.path.basename(path))[0]
 
         def get_module_names(lib_set):
-            return sorted({ get_module_name(lib.path) for lib in lib_set })
+            return sorted({get_module_name(lib.path) for lib in lib_set})
 
         results = self._extract_simple_vndk_result(vndk_lib)
         vndk_sp = get_module_names(results.vndk_sp)
         vndk_sp_ext = get_module_names(results.vndk_sp_ext)
-        extra_vendor_libs= get_module_names(results.extra_vendor_libs)
+        extra_vendor_libs = get_module_names(results.extra_vendor_libs)
 
         def format_module_names(module_names):
             return '\\\n    ' +  ' \\\n    '.join(module_names)
@@ -2964,6 +3262,7 @@
 
         file.write(template)
 
+
     def _print_file_size_output(self, graph, vndk_lib, file=sys.stderr):
         def collect_tags(lib):
             tags = []
@@ -2979,9 +3278,10 @@
 
         # Print the file size of all ELF files.
         for lib in sorted(graph.all_libs()):
-            writer.writerow((lib.path, collect_tags(lib), lib.elf.file_size,
-                             lib.elf.ro_seg_file_size, lib.elf.ro_seg_mem_size,
-                             lib.elf.rw_seg_file_size, lib.elf.rw_seg_mem_size))
+            writer.writerow((
+                lib.path, collect_tags(lib), lib.elf.file_size,
+                lib.elf.ro_seg_file_size, lib.elf.ro_seg_mem_size,
+                lib.elf.rw_seg_file_size, lib.elf.rw_seg_mem_size))
 
         # Calculate the summation of each sets.
         def calc_total_size(lib_set):
@@ -3027,17 +3327,17 @@
         writer.writerow(SEPARATOR)
         writer.writerow(['Total', None] + calc_total_size(graph.all_libs()))
 
+
     def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
+        generic_refs, graph, tagged_paths, _ = self.create_from_args(args)
 
         if args.warn_incorrect_partition:
             self._warn_incorrect_partition(graph)
 
         # Compute vndk heuristics.
         vndk_lib = graph.compute_degenerated_vndk(
-                generic_refs, tagged_paths, args.action_ineligible_vndk_sp,
-                args.action_ineligible_vndk)
+            generic_refs, tagged_paths, args.action_ineligible_vndk_sp,
+            args.action_ineligible_vndk)
 
         # Print results.
         if args.output_format == 'make':
@@ -3055,15 +3355,17 @@
 class DepsInsightCommand(VNDKCommandBase):
     def __init__(self):
         super(DepsInsightCommand, self).__init__(
-                'deps-insight', help='Generate HTML to show dependencies')
+            'deps-insight', help='Generate HTML to show dependencies')
+
 
     def add_argparser_options(self, parser):
         super(DepsInsightCommand, self).add_argparser_options(parser)
 
         parser.add_argument('--module-info')
 
-        parser.add_argument(
-                '--output', '-o', help='output directory')
+        parser.add_argument('-o', '--output', required=True,
+                            help='output directory')
+
 
     @staticmethod
     def serialize_data(libs, vndk_lib, module_info):
@@ -3130,27 +3432,28 @@
 
         return (strs, mods)
 
+
     def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
+        generic_refs, graph, tagged_paths, _ = self.create_from_args(args)
 
         module_info = ModuleInfo.load_from_path_or_default(args.module_info)
 
         # Compute vndk heuristics.
         vndk_lib = graph.compute_degenerated_vndk(
-                generic_refs, tagged_paths, args.action_ineligible_vndk_sp,
-                args.action_ineligible_vndk)
+            generic_refs, tagged_paths, args.action_ineligible_vndk_sp,
+            args.action_ineligible_vndk)
 
         # Serialize data.
-        strs, mods = self.serialize_data(list(graph.all_libs()), vndk_lib,
-                                         module_info)
+        strs, mods = self.serialize_data(
+            list(graph.all_libs()), vndk_lib, module_info)
 
         # Generate output files.
         makedirs(args.output, exist_ok=True)
         script_dir = os.path.dirname(os.path.abspath(__file__))
         for name in ('index.html', 'insight.css', 'insight.js'):
-            shutil.copyfile(os.path.join(script_dir, 'assets', 'insight', name),
-                            os.path.join(args.output, name))
+            shutil.copyfile(
+                os.path.join(script_dir, 'assets', 'insight', name),
+                os.path.join(args.output, name))
 
         with open(os.path.join(args.output, 'insight-data.js'), 'w') as f:
             f.write('''(function () {
@@ -3165,40 +3468,53 @@
 class DepsCommand(ELFGraphCommand):
     def __init__(self):
         super(DepsCommand, self).__init__(
-                'deps', help='Print binary dependencies for debugging')
+            'deps', help='Print binary dependencies for debugging')
+
 
     def add_argparser_options(self, parser):
         super(DepsCommand, self).add_argparser_options(parser)
 
         parser.add_argument(
-                '--revert', action='store_true',
-                help='print usage dependency')
+            '--revert', action='store_true',
+            help='print usage dependency')
 
         parser.add_argument(
-                '--leaf', action='store_true',
-                help='print binaries without dependencies or usages')
+            '--leaf', action='store_true',
+            help='print binaries without dependencies or usages')
 
         parser.add_argument(
-                '--symbols', action='store_true',
-                help='print symbols')
+            '--symbols', action='store_true',
+            help='print symbols')
+
+        parser.add_argument(
+            '--path-filter',
+            help='filter paths by a regular expression')
 
         parser.add_argument('--module-info')
 
+
     def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
+        _, graph, _, _ = self.create_from_args(args)
 
         module_info = ModuleInfo.load_from_path_or_default(args.module_info)
 
+        if args.path_filter:
+            path_filter = re.compile(args.path_filter)
+        else:
+            path_filter = None
+
+        if args.symbols:
+            def collect_symbols(user, definer):
+                return user.get_dep_linked_symbols(definer)
+        else:
+            def collect_symbols(user, definer):
+                return ()
+
         results = []
         for partition in range(NUM_PARTITIONS):
             for name, lib in graph.lib_pt[partition].items():
-                if args.symbols:
-                    def collect_symbols(user, definer):
-                        return user.get_dep_linked_symbols(definer)
-                else:
-                    def collect_symbols(user, definer):
-                        return ()
+                if path_filter and not path_filter.match(name):
+                    continue
 
                 data = []
                 if args.revert:
@@ -3237,7 +3553,8 @@
 class DepsClosureCommand(ELFGraphCommand):
     def __init__(self):
         super(DepsClosureCommand, self).__init__(
-                'deps-closure', help='Find transitive closure of dependencies')
+            'deps-closure', help='Find transitive closure of dependencies')
+
 
     def add_argparser_options(self, parser):
         super(DepsClosureCommand, self).add_argparser_options(parser)
@@ -3257,6 +3574,7 @@
         parser.add_argument('--enumerate', action='store_true',
                             help='print closure for each lib instead of union')
 
+
     def print_deps_closure(self, root_libs, graph, is_excluded_libs,
                            is_reverted, indent):
         if is_reverted:
@@ -3269,8 +3587,7 @@
 
 
     def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
+        _, graph, _, _ = self.create_from_args(args)
 
         # Find root/excluded libraries by their paths.
         def report_error(path):
@@ -3302,14 +3619,16 @@
 class DepsUnresolvedCommand(ELFGraphCommand):
     def __init__(self):
         super(DepsUnresolvedCommand, self).__init__(
-                'deps-unresolved',
-                help='Show unresolved dt_needed entries or symbols')
+            'deps-unresolved',
+            help='Show unresolved dt_needed entries or symbols')
+
 
     def add_argparser_options(self, parser):
         super(DepsUnresolvedCommand, self).add_argparser_options(parser)
         parser.add_argument('--module-info')
         parser.add_argument('--path-filter')
 
+
     def _dump_unresolved(self, lib, module_info, delimiter):
         if not lib.unresolved_symbols and not lib.unresolved_dt_needed:
             return
@@ -3323,9 +3642,9 @@
         for symbol in sorted(lib.unresolved_symbols):
             print('\tUNRESOLVED_SYMBOL:', symbol)
 
+
     def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
+        _, graph, _, _ = self.create_from_args(args)
         module_info = ModuleInfo.load_from_path_or_default(args.module_info)
 
         libs = graph.all_libs()
@@ -3342,14 +3661,11 @@
 class ApkDepsCommand(ELFGraphCommand):
     def __init__(self):
         super(ApkDepsCommand, self).__init__(
-                'apk-deps', help='Print APK dependencies for debugging')
+            'apk-deps', help='Print APK dependencies for debugging')
 
-    def add_argparser_options(self, parser):
-        super(ApkDepsCommand, self).add_argparser_options(parser)
 
     def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
+        _, graph, _, _ = self.create_from_args(args)
 
         apk_deps = scan_apk_dep(graph, args.system, args.vendor)
 
@@ -3366,14 +3682,17 @@
         super(CheckDepCommandBase, self).__init__(*args, **kwargs)
         self.delimiter = ''
 
+
     def add_argparser_options(self, parser):
         super(CheckDepCommandBase, self).add_argparser_options(parser)
         parser.add_argument('--module-info')
 
+
     def _print_delimiter(self):
         print(self.delimiter, end='')
         self.delimiter = '\n'
 
+
     def _dump_dep(self, lib, bad_deps, module_info):
         self._print_delimiter()
         print(lib.path)
@@ -3386,6 +3705,7 @@
             for symbol in lib.get_dep_linked_symbols(dep):
                 print('\t\t' + symbol)
 
+
     def _dump_apk_dep(self, apk_path, bad_deps, module_info):
         self._print_delimiter()
         print(apk_path)
@@ -3400,7 +3720,7 @@
 class CheckDepCommand(CheckDepCommandBase):
     def __init__(self):
         super(CheckDepCommand, self).__init__(
-                'check-dep', help='Check the eligible dependencies')
+            'check-dep', help='Check the eligible dependencies')
 
 
     def add_argparser_options(self, parser):
@@ -3470,8 +3790,8 @@
                               .format(lib.path, dep.path),
                               file=sys.stderr)
                     elif dep_properties.vndk:
-                        print('error: vendor lib "{}" depends on vndk "{}" but '
-                              'it must be copied to /system/lib[64]/vndk.'
+                        print('error: vendor lib "{}" depends on vndk "{}" '
+                              'but it must be copied to /system/lib[64]/vndk.'
                               .format(lib.path, dep.path),
                               file=sys.stderr)
                     else:
@@ -3486,7 +3806,7 @@
         return num_errors
 
 
-    def _check_dt_needed_ordering(self, graph, module_info):
+    def _check_dt_needed_ordering(self, graph):
         """Check DT_NEEDED entries order of all libraries"""
 
         num_errors = 0
@@ -3540,25 +3860,25 @@
 
     def main(self, args):
         generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
+            self.create_from_args(args)
 
         tagged_paths = TaggedPathDict.create_from_csv_path(
-                args.tag_file, vndk_lib_dirs)
+            args.tag_file, vndk_lib_dirs)
         tagged_libs = TaggedLibDict.create_from_graph(
-                graph, tagged_paths, generic_refs)
+            graph, tagged_paths, generic_refs)
 
         module_info = ModuleInfo.load_from_path_or_default(args.module_info)
 
         lib_properties_path = \
-                LibProperties.get_lib_properties_file_path(args.tag_file)
+            LibProperties.get_lib_properties_file_path(args.tag_file)
         lib_properties = \
-                LibProperties.load_from_path_or_default(lib_properties_path)
+            LibProperties.load_from_path_or_default(lib_properties_path)
 
         num_errors = self._check_vendor_dep(graph, tagged_libs, lib_properties,
                                             module_info)
 
         if args.check_dt_needed_ordering:
-            num_errors += self._check_dt_needed_ordering(graph, module_info)
+            num_errors += self._check_dt_needed_ordering(graph)
 
         if args.check_apk:
             num_errors += self._check_apk_dep(graph, args.system, args.vendor,
@@ -3567,139 +3887,113 @@
         return 0 if num_errors == 0 else 1
 
 
-class CheckEligibleListCommand(CheckDepCommandBase):
+class DumpDexStringCommand(Command):
     def __init__(self):
-        super(CheckEligibleListCommand, self).__init__(
-                'check-eligible-list', help='Check the eligible list')
+        super(DumpDexStringCommand, self).__init__(
+            'dump-dex-string',
+            help='Dump string literals defined in a dex file')
 
 
-    def _check_eligible_vndk_dep(self, graph, tagged_libs, module_info):
-        """Check whether eligible sets are self-contained."""
-        num_errors = 0
+    def add_argparser_options(self, parser):
+        super(DumpDexStringCommand, self).add_argparser_options(parser)
 
-        indirect_libs = (tagged_libs.ll_ndk_indirect |
-                         tagged_libs.vndk_sp_indirect_private |
-                         tagged_libs.fwk_only_rs)
-
-        eligible_libs = (tagged_libs.ll_ndk | tagged_libs.vndk_sp |
-                         tagged_libs.vndk_sp_indirect | tagged_libs.vndk)
-
-        # Check eligible vndk is self-contained.
-        for lib in sorted(eligible_libs):
-            bad_deps = []
-            for dep in lib.deps_all:
-                if dep not in eligible_libs and dep not in indirect_libs:
-                    print('error: eligible lib "{}" should not depend on '
-                          'non-eligible lib "{}".'.format(lib.path, dep.path),
-                          file=sys.stderr)
-                    bad_deps.append(dep)
-                    num_errors += 1
-            if bad_deps:
-                self._dump_dep(lib, bad_deps, module_info)
-
-        # Check the libbinder dependencies.
-        for lib in sorted(eligible_libs):
-            bad_deps = []
-            for dep in lib.deps_all:
-                if os.path.basename(dep.path) == 'libbinder.so':
-                    print('error: eligible lib "{}" should not depend on '
-                          'libbinder.so.'.format(lib.path), file=sys.stderr)
-                    bad_deps.append(dep)
-                    num_errors += 1
-            if bad_deps:
-                self._dump_dep(lib, bad_deps, module_info)
-
-        return num_errors
+        parser.add_argument('dex_file', help='path to an input dex file')
 
 
     def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
-
-        tagged_paths = TaggedPathDict.create_from_csv_path(
-                args.tag_file, vndk_lib_dirs)
-        tagged_libs = TaggedLibDict.create_from_graph(
-                graph, tagged_paths, generic_refs)
-
-        module_info = ModuleInfo.load_from_path_or_default(args.module_info)
-
-        num_errors = self._check_eligible_vndk_dep(graph, tagged_libs,
-                                                   module_info)
-        return 0 if num_errors == 0 else 1
+        for string in DexFileReader.enumerate_dex_strings(args.dex_file):
+            try:
+                print(string)
+            except (UnicodeEncodeError, UnicodeDecodeError):
+                print(repr(string))
 
 
 class DepGraphCommand(ELFGraphCommand):
     def __init__(self):
         super(DepGraphCommand, self).__init__(
-                'dep-graph', help='Show the eligible dependencies graph')
+            'dep-graph', help='Visualize violating dependencies with HTML')
+
 
     def add_argparser_options(self, parser):
-        super(DepGraphCommand, self).add_argparser_options(parser)
+        super(DepGraphCommand, self).add_argparser_options(
+            parser, is_tag_file_required=True)
 
-        parser.add_argument('--output', '-o', help='output directory')
+        parser.add_argument('-o', '--output', required=True,
+                            help='output directory')
 
-    def _get_tag_from_lib(self, lib, tagged_paths):
-        tag_hierarchy = dict()
+
+    @staticmethod
+    def _create_tag_hierarchy():
+        hierarchy = dict()
         for tag in TaggedPathDict.TAGS:
             if tag in {'sp_hal', 'sp_hal_dep', 'vnd_only'}:
-                tag_hierarchy[tag] = 'vendor.private.{}'.format(tag)
+                hierarchy[tag] = 'vendor.private.{}'.format(tag)
             else:
                 vendor_visible = TaggedPathDict.is_tag_visible('vnd_only', tag)
                 pub = 'public' if vendor_visible else 'private'
-                tag_hierarchy[tag] = 'system.{}.{}'.format(pub, tag)
+                hierarchy[tag] = 'system.{}.{}'.format(pub, tag)
+        return hierarchy
 
-        return tag_hierarchy[tagged_paths.get_path_tag(lib.path)]
 
-    def _check_if_allowed(self, my_tag, other_tag):
-        my = my_tag.split('.')
-        other = other_tag.split('.')
-        if my[0] == 'system' and other[0] == 'vendor':
+    @staticmethod
+    def _get_lib_tag(hierarchy, tagged_paths, lib):
+        return hierarchy[tagged_paths.get_path_tag(lib.path)]
+
+
+    @staticmethod
+    def _is_dep_allowed(user_tag, dep_tag):
+        user_partition, _, _ = user_tag.split('.')
+        dep_partition, dep_visibility, _ = dep_tag.split('.')
+        if user_partition == 'system' and dep_partition == 'vendor':
             return False
-        if my[0] == 'vendor' and other[0] == 'system' \
-                             and other[1] == 'private':
-            return False
+        if user_partition == 'vendor' and dep_partition == 'system':
+            if dep_visibility == 'private':
+                return False
         return True
 
+
     def _get_dep_graph(self, graph, tagged_paths):
+        hierarchy = self._create_tag_hierarchy()
+
+        # Build data and violate_libs.
         data = []
-        violate_libs = dict()
-        system_libs = graph.lib_pt[PT_SYSTEM].values()
-        vendor_libs = graph.lib_pt[PT_VENDOR].values()
-        for lib in itertools.chain(system_libs, vendor_libs):
-            tag = self._get_tag_from_lib(lib, tagged_paths)
-            violate_count = 0
+        violate_libs = collections.defaultdict(list)
+
+        for lib in graph.all_libs():
+            lib_tag = self._get_lib_tag(hierarchy, tagged_paths, lib)
             lib_item = {
                 'name': lib.path,
-                'tag': tag,
+                'tag': lib_tag,
                 'depends': [],
                 'violates': [],
             }
+            violate_count = 0
             for dep in lib.deps_all:
-                if self._check_if_allowed(tag,
-                        self._get_tag_from_lib(dep, tagged_paths)):
+                dep_tag = self._get_lib_tag(hierarchy, tagged_paths, dep)
+                if self._is_dep_allowed(lib_tag, dep_tag):
                     lib_item['depends'].append(dep.path)
                 else:
-                    lib_item['violates'].append([dep.path, lib.get_dep_linked_symbols(dep)])
-                    violate_count += 1;
+                    lib_item['violates'].append([
+                        dep.path, lib.get_dep_linked_symbols(dep)])
+                    violate_count += 1
             lib_item['violate_count'] = violate_count
             if violate_count > 0:
-                if not tag in violate_libs:
-                    violate_libs[tag] = []
-                violate_libs[tag].append((lib.path, violate_count))
+                violate_libs[lib_tag].append((lib.path, violate_count))
             data.append(lib_item)
+
+        # Sort data and violate_libs.
+        data.sort(
+            key=lambda lib_item: (lib_item['tag'], lib_item['violate_count']))
+        for libs in violate_libs.values():
+            libs.sort(key=lambda violate_item: violate_item[1], reverse=True)
+
         return data, violate_libs
 
-    def main(self, args):
-        generic_refs, graph, tagged_paths, vndk_lib_dirs = \
-                self.create_from_args(args)
 
-        tagged_paths = TaggedPathDict.create_from_csv_path(
-                args.tag_file, vndk_lib_dirs)
+    def main(self, args):
+        _, graph, tagged_paths, _ = self.create_from_args(args)
+
         data, violate_libs = self._get_dep_graph(graph, tagged_paths)
-        data.sort(key=lambda lib_item: (lib_item['tag'],
-                                        lib_item['violate_count']))
-        for libs in violate_libs.values():
-            libs.sort(key=lambda libs: libs[1], reverse=True)
 
         makedirs(args.output, exist_ok=True)
         script_dir = os.path.dirname(os.path.abspath(__file__))
@@ -3707,8 +4001,8 @@
             shutil.copyfile(os.path.join(script_dir, 'assets', 'visual', name),
                             os.path.join(args.output, name))
         with open(os.path.join(args.output, 'dep-data.js'), 'w') as f:
-            f.write('var violatedLibs = ' + json.dumps(violate_libs) +
-                    '\nvar depData = ' + json.dumps(data) + ';')
+            f.write('var violatedLibs = ' + json.dumps(violate_libs) + ';\n')
+            f.write('var depData = ' + json.dumps(data) + ';\n')
 
         return 0
 
@@ -3721,7 +4015,7 @@
     def register_subcmd(cmd):
         subcmds[cmd.name] = cmd
         cmd.add_argparser_options(
-                subparsers.add_parser(cmd.name, help=cmd.help))
+            subparsers.add_parser(cmd.name, help=cmd.help))
 
     register_subcmd(ELFDumpCommand())
     register_subcmd(CreateGenericRefCommand())
@@ -3732,8 +4026,8 @@
     register_subcmd(DepsUnresolvedCommand())
     register_subcmd(ApkDepsCommand())
     register_subcmd(CheckDepCommand())
-    register_subcmd(CheckEligibleListCommand())
     register_subcmd(DepGraphCommand())
+    register_subcmd(DumpDexStringCommand())
 
     args = parser.parse_args()
     if not args.subcmd:
diff --git a/vndk/tools/header-checker/Android.bp b/vndk/tools/header-checker/Android.bp
index d06fd93..8edebdd 100644
--- a/vndk/tools/header-checker/Android.bp
+++ b/vndk/tools/header-checker/Android.bp
@@ -18,112 +18,31 @@
     name: "header-checker-defaults",
 
     defaults: [
-        "clang-defaults",
+        "llvm-build-host-tools-defaults",
     ],
 
     cflags: [
         "-Wall",
         "-Werror",
+        "-Wno-unused-parameter",
         "-DGOOGLE_PROTOBUF_NO_RTTI",
-        "-UNDEBUG"
+        "-UNDEBUG",
     ],
 
     cppflags: [
-        "-std=c++14",
+        "-fno-exceptions",
+        "-fno-rtti",
+        "-std=c++17",
     ],
 
     target: {
         windows: {
-            enabled: false
-        }
-    }
-}
-
-cc_defaults {
-    name: "header-checker-lib-defaults",
-
-    static_libs: [
-        "libclangToolingCore",
-        "libclangTooling",
-        "libclangFrontendTool",
-        "libclangFrontend",
-        "libclangDriver",
-        "libclangIndex",
-        "libclangSerialization",
-        "libclangCodeGen",
-        "libclangRewriteFrontend",
-        "libclangRewrite",
-        "libclangParse",
-        "libclangSema",
-        "libclangStaticAnalyzerFrontend",
-        "libclangStaticAnalyzerCheckers",
-        "libclangStaticAnalyzerMPIChecker",
-        "libclangStaticAnalyzerCore",
-        "libclangAnalysis",
-        "libclangEdit",
-        "libclangAST",
-        "libclangLex",
-        "libclangBasic",
-        "libLLVMIRReader",
-        "libLLVMAsmParser",
-        "libLLVMAsmPrinter",
-        "libLLVMBitReader",
-        "libLLVMBitWriter",
-        "libLLVMMC",
-        "libLLVMMCParser",
-        "libLLVMCore",
-        "libLLVMOption",
-        "libLLVMProfileData",
-        "libLLVMObject",
-        "libLLVMMCDisassembler",
-        "libLLVMSupport",
-    ],
-
-    shared_libs: [
-        "libprotobuf-cpp-full",
-    ],
-}
-
-cc_defaults {
-    name: "header-abi-linker-lib-defaults",
-
-    static_libs: [
-        "libheader-abi-util",
-        "libLLVMObject",
-        "libLLVMBitReader",
-        "libLLVMMC",
-        "libLLVMMCParser",
-        "libLLVMCore",
-        "libLLVMSupport",
-    ],
-
-    shared_libs: [
-        "libprotobuf-cpp-full",
-    ],
-}
-
-cc_library_static {
-    name: "libheader-checker-proto",
-    host_supported: true,
-    export_include_dirs: ["."],
-
-    srcs: [
-        "proto/abi_dump.proto",
-        "proto/abi_diff.proto",
-    ],
-
-    proto: {
-        export_proto_headers: true,
-        type: "full",
+            enabled: false,
+        },
     },
 
-    cflags: [
-        "-Wall",
-        "-Werror",
-        "-Wcast-qual",
-        "-Wno-long-long",
-        "-Wno-unused-parameter",
-    ],
+    compile_multilib: "64",
+    stl: "none",
 }
 
 cc_binary_host {
@@ -131,16 +50,49 @@
 
     defaults: [
         "header-checker-defaults",
-        "header-checker-lib-defaults",
     ],
 
     srcs: [
-        "header-abi-dumper/src/*.cpp",
+        "header-abi-dumper/src/abi_wrappers.cpp",
+        "header-abi-dumper/src/ast_processing.cpp",
+        "header-abi-dumper/src/diagnostic_consumer.cpp",
+        "header-abi-dumper/src/fake_decl_source.cpp",
+        "header-abi-dumper/src/fixed_argv.cpp",
+        "header-abi-dumper/src/frontend_action.cpp",
+        "header-abi-dumper/src/frontend_action_factory.cpp",
+        "header-abi-dumper/src/header_checker.cpp",
     ],
 
     static_libs: [
         "libheader-abi-util",
         "libheader-checker-proto",
+        "libjsoncpp",
+    ],
+
+    shared_libs: [
+        "libprotobuf-cpp-full",
+        "libLLVM_host",
+        "libclang_cxx_host",
+        "libc++_host",
+    ],
+}
+
+cc_defaults {
+    name: "header-abi-linker-defaults",
+
+    defaults: ["header-checker-defaults"],
+
+    static_libs: [
+        "libheader-abi-util",
+        "libheader-checker-proto",
+        "libjsoncpp",
+    ],
+
+    shared_libs: [
+        "libprotobuf-cpp-full",
+        "libLLVM_host",
+        "libclang_cxx_host",
+        "libc++_host",
     ],
 }
 
@@ -149,15 +101,11 @@
 
     defaults: [
         "header-checker-defaults",
-        "header-abi-linker-lib-defaults",
+        "header-abi-linker-defaults",
     ],
 
     srcs: [
-        "header-abi-linker/src/*.cpp",
-    ],
-
-    static_libs: [
-        "libheader-checker-proto",
+        "header-abi-linker/src/header_abi_linker.cpp",
     ],
 }
 
@@ -166,15 +114,13 @@
 
     defaults: [
         "header-checker-defaults",
-        "header-abi-linker-lib-defaults",
+        "header-abi-linker-defaults",
     ],
 
     srcs: [
-        "header-abi-diff/src/*.cpp",
-    ],
-
-    static_libs: [
-        "libheader-checker-proto",
+        "header-abi-diff/src/abi_diff.cpp",
+        "header-abi-diff/src/abi_diff_wrappers.cpp",
+        "header-abi-diff/src/header_abi_diff.cpp",
     ],
 }
 
@@ -183,47 +129,81 @@
 
     defaults: [
         "header-checker-defaults",
-        "header-abi-linker-lib-defaults",
+        "header-abi-linker-defaults",
     ],
 
     srcs: [
-        "merge-abi-diff/src/*.cpp",
-    ],
-
-    static_libs: [
-        "libheader-checker-proto",
+        "merge-abi-diff/src/merge_abi_diff.cpp",
     ],
 }
 
-cc_library_static {
+cc_library_host_static {
     name: "libheader-abi-util",
+
     defaults: [
         "header-checker-defaults",
     ],
-    host_supported: true,
-    export_include_dirs: ["header-abi-util/include"],
 
     srcs: [
-        "header-abi-util/src/*.cpp"
+        "header-abi-util/src/abi_diff_helpers.cpp",
+        "header-abi-util/src/api_level.cpp",
+        "header-abi-util/src/collect_exported_headers.cpp",
+        "header-abi-util/src/exported_symbol_set.cpp",
+        "header-abi-util/src/ir_representation.cpp",
+        "header-abi-util/src/ir_representation_json.cpp",
+        "header-abi-util/src/ir_representation_protobuf.cpp",
+        "header-abi-util/src/so_file_parser.cpp",
+        "header-abi-util/src/string_utils.cpp",
+        "header-abi-util/src/version_script_parser.cpp",
     ],
+
     static_libs: [
-        "libLLVMObject",
-        "libLLVMBitReader",
-        "libLLVMMC",
-        "libLLVMMCParser",
-        "libLLVMCore",
-        "libLLVMSupport",
         "libheader-checker-proto",
+        "libjsoncpp",
     ],
 
     shared_libs: [
+        "libLLVM_host",
+        "libc++_host",
         "libprotobuf-cpp-full",
     ],
 
-
     cflags: [
         "-Wcast-qual",
         "-Wno-long-long",
         "-Wno-unused-parameter",
     ],
+
+    export_include_dirs: ["header-abi-util/include"],
+}
+
+cc_test_host {
+    name: "libheader-abi-util_test",
+
+    defaults: [
+        "header-checker-defaults",
+    ],
+
+    srcs: [
+        "header-abi-util/src/api_level_test.cpp",
+        "header-abi-util/src/exported_symbol_set_test.cpp",
+        "header-abi-util/src/string_utils_test.cpp",
+        "header-abi-util/src/version_script_parser_test.cpp",
+    ],
+
+    local_include_dirs: [
+        "header-abi-util/include",
+    ],
+
+    static_libs: [
+        "libgtest",
+        "libgtest_main",
+        "libheader-abi-util",
+    ],
+
+    shared_libs: [
+        "libc++_host",
+    ],
+
+    test_suites: ["general-tests"],
 }
diff --git a/vndk/tools/header-checker/OWNERS b/vndk/tools/header-checker/OWNERS
new file mode 100644
index 0000000..bf26553
--- /dev/null
+++ b/vndk/tools/header-checker/OWNERS
@@ -0,0 +1,3 @@
+andrewhsieh@google.com
+loganchien@google.com
+jchowdhary@google.com
diff --git a/vndk/tools/header-checker/TEST_MAPPING b/vndk/tools/header-checker/TEST_MAPPING
new file mode 100644
index 0000000..cce52c9
--- /dev/null
+++ b/vndk/tools/header-checker/TEST_MAPPING
@@ -0,0 +1,8 @@
+{
+  "presubmit" : [
+    {
+      "name" : "libheader-abi-util_test",
+      "host" : true
+    }
+  ]
+}
diff --git a/vndk/tools/header-checker/header-abi-diff/src/abi_diff.cpp b/vndk/tools/header-checker/header-abi-diff/src/abi_diff.cpp
index 936d905..a72636a 100644
--- a/vndk/tools/header-checker/header-abi-diff/src/abi_diff.cpp
+++ b/vndk/tools/header-checker/header-abi-diff/src/abi_diff.cpp
@@ -14,7 +14,7 @@
 
 #include "abi_diff.h"
 
-#include <header_abi_util.h>
+#include "header_abi_util.h"
 
 #include <llvm/Support/raw_ostream.h>
 
@@ -140,14 +140,14 @@
   auto old_enums_and_records_extracted = ExtractUserDefinedTypes(old_tu);
   auto new_enums_and_records_extracted = ExtractUserDefinedTypes(new_tu);
 
-  return CollectUserDefinedTypesInternal(
-      old_enums_and_records_extracted.second,
-      new_enums_and_records_extracted.second, old_types_map,
-      new_types_map, ir_diff_dumper) &&
-      CollectUserDefinedTypesInternal(old_enums_and_records_extracted.first,
-                                      new_enums_and_records_extracted.first,
-                                      old_types_map, new_types_map,
-                                      ir_diff_dumper);
+  return (CollectUserDefinedTypesInternal(
+              old_enums_and_records_extracted.second,
+              new_enums_and_records_extracted.second, old_types_map,
+              new_types_map, ir_diff_dumper) &&
+          CollectUserDefinedTypesInternal(
+              old_enums_and_records_extracted.first,
+              new_enums_and_records_extracted.first,
+              old_types_map, new_types_map, ir_diff_dumper));
 }
 
 template <typename T>
@@ -158,11 +158,11 @@
     const AbiElementMap<const abi_util::TypeIR *> &new_types_map,
     abi_util::IRDiffDumper *ir_diff_dumper) {
 
-  return Collect(old_ud_types_map, new_ud_types_map, nullptr, nullptr,
-                 ir_diff_dumper, old_types_map, new_types_map) &&
-      PopulateCommonElements(old_ud_types_map, new_ud_types_map, old_types_map,
-                             new_types_map, ir_diff_dumper,
-                             abi_util::DiffMessageIR::Unreferenced);
+  return (Collect(old_ud_types_map, new_ud_types_map, nullptr, nullptr,
+                  ir_diff_dumper, old_types_map, new_types_map) &&
+          PopulateCommonElements(old_ud_types_map, new_ud_types_map,
+                                 old_types_map, new_types_map, ir_diff_dumper,
+                                 abi_util::DiffMessageIR::Unreferenced));
 }
 
 template <typename T, typename ElfSymbolType>
@@ -210,12 +210,12 @@
   return true;
 }
 
-// Collect added and removed Elements. The elf set is needed since some symbols
-// might not have meta-data about them collected through the AST. For eg: if a
-// function Foo is defined in an assembly file on target A, but in a c/c++ file
-// on target B, foo does not have meta-data surrounding it when building target
-// A, this does not mean it is not in the ABI + API of the library.
-
+// Collect the added and removed elements. The ELF maps are needed because the
+// metadata for some symbols might be absent from AST.  For example, if a
+// function Foo() is defined in an assembly file on target A, but in a C/C++
+// file on target B. Even though Foo() does not have metadata surrounding it
+// when building target A, it doesn't mean that Foo() is not a part of the ABI
+// of the library.
 template <typename T>
 bool HeaderAbiDiff::Collect(
     const AbiElementMap<const T*> &old_elements_map,
@@ -226,12 +226,11 @@
     const AbiElementMap<const abi_util::TypeIR *> &old_types_map,
     const AbiElementMap<const abi_util::TypeIR *> &new_types_map) {
   if (!PopulateRemovedElements(
-      old_elements_map, new_elements_map, new_elf_map, ir_diff_dumper,
-      abi_util::DiffMessageIR::Removed, old_types_map) ||
-      !PopulateRemovedElements(new_elements_map, old_elements_map, old_elf_map,
-                               ir_diff_dumper,
-                               abi_util::IRDiffDumper::DiffKind::Added,
-                               new_types_map)) {
+          old_elements_map, new_elements_map, new_elf_map, ir_diff_dumper,
+          abi_util::DiffMessageIR::Removed, old_types_map) ||
+      !PopulateRemovedElements(
+          new_elements_map, old_elements_map, old_elf_map, ir_diff_dumper,
+          abi_util::IRDiffDumper::DiffKind::Added, new_types_map)) {
     llvm::errs() << "Populating functions in report failed\n";
     return false;
   }
@@ -248,10 +247,10 @@
   std::vector<const abi_util::ElfSymbolIR *> added_elements =
       abi_util::FindRemovedElements(new_symbols, old_symbols);
 
-  return PopulateElfElements(removed_elements, ir_diff_dumper,
-                             abi_util::IRDiffDumper::DiffKind::Removed) &&
-         PopulateElfElements(added_elements, ir_diff_dumper,
-                             abi_util::IRDiffDumper::DiffKind::Added);
+  return (PopulateElfElements(removed_elements, ir_diff_dumper,
+                              abi_util::IRDiffDumper::DiffKind::Removed) &&
+          PopulateElfElements(added_elements, ir_diff_dumper,
+                              abi_util::IRDiffDumper::DiffKind::Added));
 }
 
 bool HeaderAbiDiff::PopulateElfElements(
@@ -358,9 +357,10 @@
         [](const T *e) {return e->GetLinkerSetKey();})) {
       continue;
     }
-    abi_diff_wrappers::DiffWrapper<T> diff_wrapper(old_element, new_element,
-                                                   ir_diff_dumper, old_types,
-                                                   new_types, &type_cache_);
+
+    abi_diff_wrappers::DiffWrapper<T> diff_wrapper(
+        old_element, new_element, ir_diff_dumper, old_types, new_types,
+        diff_policy_options_, &type_cache_);
     if (!diff_wrapper.DumpDiff(diff_kind)) {
       llvm::errs() << "Failed to diff elements\n";
       return false;
diff --git a/vndk/tools/header-checker/header-abi-diff/src/abi_diff.h b/vndk/tools/header-checker/header-abi-diff/src/abi_diff.h
index 18e785d..4604b0f 100644
--- a/vndk/tools/header-checker/header-abi-diff/src/abi_diff.h
+++ b/vndk/tools/header-checker/header-abi-diff/src/abi_diff.h
@@ -12,14 +12,17 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include "abi_diff_wrappers.h"
+#ifndef ABI_DIFF_H_
+#define ABI_DIFF_H_
 
-#include <ir_representation.h>
+#include "abi_diff_wrappers.h"
+#include "ir_representation.h"
 
 #include <string>
 #include <vector>
 
 using abi_util::AbiElementMap;
+using abi_util::DiffPolicyOptions;
 
 class HeaderAbiDiff {
  public:
@@ -27,14 +30,17 @@
                 const std::string &old_dump, const std::string &new_dump,
                 const std::string &compatibility_report,
                 const std::set<std::string> &ignored_symbols,
+                const DiffPolicyOptions &diff_policy_options,
                 bool check_all_apis, abi_util::TextFormatIR text_format_old,
                 abi_util::TextFormatIR text_format_new,
                 abi_util::TextFormatIR text_format_diff)
       : lib_name_(lib_name), arch_(arch), old_dump_(old_dump),
         new_dump_(new_dump), cr_(compatibility_report),
-        ignored_symbols_(ignored_symbols), check_all_apis_(check_all_apis),
+        ignored_symbols_(ignored_symbols),
+        diff_policy_options_(diff_policy_options),
+        check_all_apis_(check_all_apis),
         text_format_old_(text_format_old), text_format_new_(text_format_new),
-        text_format_diff_(text_format_diff) { }
+        text_format_diff_(text_format_diff) {}
 
   abi_util::CompatibilityStatusIR GenerateCompatibilityReport();
 
@@ -46,13 +52,13 @@
 
   template <typename T, typename ElfSymbolType>
   bool CollectDynsymExportables(
-    const AbiElementMap<T> &old_exportables,
-    const AbiElementMap<T> &new_exportables,
-    const AbiElementMap<ElfSymbolType> &old_elf_symbols,
-    const AbiElementMap<ElfSymbolType> &new_elf_symbols,
-    const AbiElementMap<const abi_util::TypeIR *> &old_types_map,
-    const AbiElementMap<const abi_util::TypeIR *> &new_types_map,
-    abi_util::IRDiffDumper *ir_diff_dumper);
+      const AbiElementMap<T> &old_exportables,
+      const AbiElementMap<T> &new_exportables,
+      const AbiElementMap<ElfSymbolType> &old_elf_symbols,
+      const AbiElementMap<ElfSymbolType> &new_elf_symbols,
+      const AbiElementMap<const abi_util::TypeIR *> &old_types_map,
+      const AbiElementMap<const abi_util::TypeIR *> &new_types_map,
+      abi_util::IRDiffDumper *ir_diff_dumper);
 
   template <typename T>
   bool Collect(
@@ -134,9 +140,12 @@
   const std::string &new_dump_;
   const std::string &cr_;
   const std::set<std::string> &ignored_symbols_;
+  const DiffPolicyOptions &diff_policy_options_;
   bool check_all_apis_;
   std::set<std::string> type_cache_;
   abi_util::TextFormatIR text_format_old_;
   abi_util::TextFormatIR text_format_new_;
   abi_util::TextFormatIR text_format_diff_;
 };
+
+#endif  // ABI_DIFF_H_
diff --git a/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.cpp b/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.cpp
index e9e4cd2..4614bea 100644
--- a/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.cpp
+++ b/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.cpp
@@ -14,7 +14,7 @@
 
 #include "abi_diff_wrappers.h"
 
-#include <header_abi_util.h>
+#include "header_abi_util.h"
 
 #include <llvm/Support/raw_ostream.h>
 
@@ -33,7 +33,7 @@
     return false;
   }
   if (!type_cache_->insert(
-      oldp_->GetSelfType() + newp_->GetSelfType()).second) {
+          oldp_->GetSelfType() + newp_->GetSelfType()).second) {
     return true;
   }
   CompareRecordTypes(oldp_, newp_, &type_queue, diff_kind);
@@ -85,13 +85,13 @@
     abi_util::DiffMessageIR::DiffKind diff_kind) {
   std::deque<std::string> type_queue;
   type_queue.push_back(oldp_->GetName());
-  DiffStatus param_diffs = CompareFunctionParameters(oldp_->GetParameters(),
-                                                     newp_->GetParameters(),
-                                                     &type_queue, diff_kind);
-  DiffStatus return_type_diff =
-      CompareAndDumpTypeDiff(oldp_->GetReturnType(),
-                             newp_->GetReturnType(),
-                             &type_queue, diff_kind);
+
+  DiffStatus param_diffs = CompareFunctionParameters(
+      oldp_->GetParameters(), newp_->GetParameters(), &type_queue, diff_kind);
+
+  DiffStatus return_type_diff = CompareAndDumpTypeDiff(
+      oldp_->GetReturnType(), newp_->GetReturnType(), &type_queue, diff_kind);
+
   CompareTemplateInfo(oldp_->GetTemplateElements(),
                       newp_->GetTemplateElements(),
                       &type_queue, diff_kind);
@@ -111,4 +111,4 @@
   return true;
 }
 
-} // abi_diff_wrappers
+}  // namespace abi_diff_wrappers
diff --git a/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.h b/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.h
index 5376d2f..8a48452 100644
--- a/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.h
+++ b/vndk/tools/header-checker/header-abi-diff/src/abi_diff_wrappers.h
@@ -12,11 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef ABI_DIFF_WRAPPERS_H
-#define ABI_DIFF_WRAPPERS_H
+#ifndef ABI_DIFF_WRAPPERS_H_
+#define ABI_DIFF_WRAPPERS_H_
 
-#include <abi_diff_helpers.h>
-#include <ir_representation.h>
+#include "abi_diff_helpers.h"
+#include "ir_representation.h"
 
 #include <deque>
 
@@ -30,21 +30,21 @@
 static bool IgnoreSymbol(const T *element,
                          const std::set<std::string> &ignored_symbols,
                          F func) {
-  return ignored_symbols.find(func(element)) !=
-      ignored_symbols.end();
+  return ignored_symbols.find(func(element)) != ignored_symbols.end();
 }
 
 template <typename T>
 class DiffWrapper : public AbiDiffHelper {
-
  public:
   DiffWrapper(const T *oldp, const T *newp,
               abi_util::IRDiffDumper *ir_diff_dumper,
               const AbiElementMap<const abi_util::TypeIR *> &old_types,
               const AbiElementMap<const abi_util::TypeIR *> &new_types,
+              const abi_util::DiffPolicyOptions &diff_policy_options,
               std::set<std::string> *type_cache)
-      : AbiDiffHelper(old_types, new_types, type_cache, ir_diff_dumper),
-        oldp_(oldp), newp_(newp) { }
+      : AbiDiffHelper(old_types, new_types, diff_policy_options, type_cache,
+                      ir_diff_dumper),
+        oldp_(oldp), newp_(newp) {}
 
   bool DumpDiff(abi_util::IRDiffDumper::DiffKind diff_kind);
 
@@ -53,6 +53,6 @@
   const T *newp_;
 };
 
-} // abi_diff_wrappers
+}  // namespace abi_diff_wrappers
 
-#endif // ABI_DIFF_WRAPPERS_H
+#endif  // ABI_DIFF_WRAPPERS_H_
diff --git a/vndk/tools/header-checker/header-abi-diff/src/header_abi_diff.cpp b/vndk/tools/header-checker/header-abi-diff/src/header_abi_diff.cpp
index f576470..a3a3ab2 100644
--- a/vndk/tools/header-checker/header-abi-diff/src/header_abi_diff.cpp
+++ b/vndk/tools/header-checker/header-abi-diff/src/header_abi_diff.cpp
@@ -14,12 +14,12 @@
 
 #include "abi_diff.h"
 
-#include <fstream>
-
 #include <llvm/Support/CommandLine.h>
 #include <llvm/Support/FileSystem.h>
 #include <llvm/Support/raw_ostream.h>
 
+#include <fstream>
+
 static llvm::cl::OptionCategory header_checker_category(
     "header-abi-diff options");
 
@@ -85,27 +85,32 @@
                    " APIs."),
     llvm::cl::Optional, llvm::cl::cat(header_checker_category));
 
+static llvm::cl::opt<bool> consider_opaque_types_different(
+    "consider-opaque-types-different",
+    llvm::cl::desc("Consider opaque types with different names as different. "
+                   "This should not be used while comparing C++ library ABIs"),
+    llvm::cl::Optional, llvm::cl::cat(header_checker_category));
+
 static llvm::cl::opt<abi_util::TextFormatIR> text_format_old(
-    "text-format-old", llvm::cl::desc("Specify text format of old abi dump"),
+    "input-format-old", llvm::cl::desc("Specify input format of old abi dump"),
     llvm::cl::values(clEnumValN(abi_util::TextFormatIR::ProtobufTextFormat,
-                                "ProtobufTextFormat","ProtobufTextFormat"),
-                     clEnumValEnd),
-    llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
+                                "ProtobufTextFormat", "ProtobufTextFormat"),
+                     clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON")),
+    llvm::cl::init(abi_util::TextFormatIR::Json),
     llvm::cl::cat(header_checker_category));
 
 static llvm::cl::opt<abi_util::TextFormatIR> text_format_new(
-    "text-format-new", llvm::cl::desc("Specify text format of new abi dump"),
+    "input-format-new", llvm::cl::desc("Specify input format of new abi dump"),
     llvm::cl::values(clEnumValN(abi_util::TextFormatIR::ProtobufTextFormat,
-                                "ProtobufTextFormat", "ProtobugTextFormat"),
-                     clEnumValEnd),
-    llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
+                                "ProtobufTextFormat", "ProtobufTextFormat"),
+                     clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON")),
+    llvm::cl::init(abi_util::TextFormatIR::Json),
     llvm::cl::cat(header_checker_category));
 
 static llvm::cl::opt<abi_util::TextFormatIR> text_format_diff(
     "text-format-diff", llvm::cl::desc("Specify text format of abi-diff"),
     llvm::cl::values(clEnumValN(abi_util::TextFormatIR::ProtobufTextFormat,
-                                "ProtobufTextFormat", "ProtobufTextFormat"),
-                     clEnumValEnd),
+                                "ProtobufTextFormat", "ProtobufTextFormat")),
     llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
     llvm::cl::cat(header_checker_category));
 
@@ -127,13 +132,13 @@
 static const char kError[] = "\033[31;1merror: \033[0m";
 
 bool ShouldEmitWarningMessage(abi_util::CompatibilityStatusIR status) {
-  return (!allow_extensions &&
-      (status & abi_util::CompatibilityStatusIR::Extension)) ||
-      (!allow_unreferenced_changes &&
-      (status & abi_util::CompatibilityStatusIR::UnreferencedChanges)) ||
-      (!allow_unreferenced_elf_symbol_changes &&
-      (status & abi_util::CompatibilityStatusIR::ElfIncompatible)) ||
-      (status & abi_util::CompatibilityStatusIR::Incompatible);
+  return ((!allow_extensions &&
+           (status & abi_util::CompatibilityStatusIR::Extension)) ||
+          (!allow_unreferenced_changes &&
+           (status & abi_util::CompatibilityStatusIR::UnreferencedChanges)) ||
+          (!allow_unreferenced_elf_symbol_changes &&
+           (status & abi_util::CompatibilityStatusIR::ElfIncompatible)) ||
+          (status & abi_util::CompatibilityStatusIR::Incompatible));
 }
 
 int main(int argc, const char **argv) {
@@ -142,9 +147,11 @@
   if (llvm::sys::fs::exists(ignore_symbol_list)) {
     ignored_symbols = LoadIgnoredSymbols(ignore_symbol_list);
   }
+  abi_util::DiffPolicyOptions diff_policy_options(
+      consider_opaque_types_different);
   HeaderAbiDiff judge(lib_name, arch, old_dump, new_dump, compatibility_report,
-                      ignored_symbols, check_all_apis, text_format_old,
-                      text_format_new, text_format_diff);
+                      ignored_symbols, diff_policy_options, check_all_apis,
+                      text_format_old, text_format_new, text_format_diff);
 
   abi_util::CompatibilityStatusIR status = judge.GenerateCompatibilityReport();
 
@@ -189,7 +196,7 @@
                  << "'s ABI has "
                  << status_str
                  << unreferenced_change_str
-                 << " Please check compatiblity report at : "
+                 << " Please check compatibility report at: "
                  << compatibility_report << "\n"
                  << "******************************************************\n";
   }
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp b/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp
index 2fc0d71..e3b18fb 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp
+++ b/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp
@@ -14,15 +14,17 @@
 
 #include "abi_wrappers.h"
 
-#include <header_abi_util.h>
+#include "header_abi_util.h"
 
-#include <limits.h>
-#include <stdlib.h>
-#include <clang/Tooling/Core/QualTypeNames.h>
+#include <clang/AST/QualTypeNames.h>
 #include <clang/Index/CodegenNameGenerator.h>
 
 #include <string>
 
+#include <assert.h>
+#include <limits.h>
+#include <stdlib.h>
+
 using namespace abi_wrapper;
 
 ABIWrapper::ABIWrapper(
@@ -31,11 +33,11 @@
     const clang::CompilerInstance *cip,
     abi_util::IRDumper *ir_dumper,
     ast_util::ASTCaches *ast_caches)
-  : cip_(cip),
-    mangle_contextp_(mangle_contextp),
-    ast_contextp_(ast_contextp),
-    ir_dumper_(ir_dumper),
-    ast_caches_(ast_caches) { }
+    : cip_(cip),
+      mangle_contextp_(mangle_contextp),
+      ast_contextp_(ast_contextp),
+      ir_dumper_(ir_dumper),
+      ast_caches_(ast_caches) {}
 
 std::string ABIWrapper::GetCachedDeclSourceFile(
     const clang::Decl *decl, const clang::CompilerInstance *cip) {
@@ -67,8 +69,9 @@
   const clang::RecordDecl *record_decl =
       llvm::dyn_cast<clang::RecordDecl>(tag_decl);
 
-  if (record_decl != nullptr && (!record_decl->hasNameForLinkage() ||
-      record_decl->isAnonymousStructOrUnion())) {
+  if (record_decl != nullptr &&
+      (!record_decl->hasNameForLinkage() ||
+       record_decl->isAnonymousStructOrUnion())) {
     return record_decl;
   }
   return nullptr;
@@ -95,8 +98,7 @@
   bool is_ptr = base_type->isPointerType();
   bool is_reference = base_type->isReferenceType();
   bool is_array = base_type->isArrayType();
-  return is_array || is_ptr || is_reference ||
-      qual_type.hasLocalQualifiers();
+  return is_array || is_ptr || is_reference || qual_type.hasLocalQualifiers();
 }
 
 static clang::QualType GetReferencedType(const clang::QualType qual_type);
@@ -151,7 +153,7 @@
 }
 
 static abi_util::AccessSpecifierIR AccessClangToIR(
-    const clang::AccessSpecifier sp)  {
+    const clang::AccessSpecifier sp) {
   switch (sp) {
     case clang::AS_private: {
       return abi_util::AccessSpecifierIR::PrivateAccess;
@@ -194,18 +196,17 @@
   return qual_type.getNonReferenceType();
 }
 
-bool ABIWrapper::CreateExtendedType(
-    clang::QualType qual_type,
-    abi_util::TypeIR *typep) {
+bool ABIWrapper::CreateExtendedType(clang::QualType qual_type,
+                                    abi_util::TypeIR *typep) {
   const clang::QualType canonical_type = qual_type.getCanonicalType();
   // The source file is going to be set later anyway.
   return CreateBasicNamedAndTypedDecl(canonical_type, typep, "");
 }
 
-//This overload takes in a qualtype and adds its information to the abi-dump on
-//its own.
-bool ABIWrapper::CreateBasicNamedAndTypedDecl(
-    clang::QualType qual_type, const std::string &source_file) {
+// This overload takes in a qualtype and adds its information to the abi-dump on
+// its own.
+bool ABIWrapper::CreateBasicNamedAndTypedDecl(clang::QualType qual_type,
+                                              const std::string &source_file) {
   const std::string &type_key = GetKeyForTypeId(qual_type);
   const clang::QualType canonical_type = qual_type.getCanonicalType();
   const clang::Type *base_type = canonical_type.getTypePtr();
@@ -228,9 +229,12 @@
     llvm::errs() << "nullptr with valid type while creating basic type\n";
     return false;
   }
-  return type_and_status.should_create_type_ ?
-      CreateBasicNamedAndTypedDecl(canonical_type, typep.get(), source_file) &&
-      ir_dumper_->AddLinkableMessageIR(typep.get()) : true;
+  if (!type_and_status.should_create_type_) {
+    return true;
+  }
+  return (CreateBasicNamedAndTypedDecl(
+              canonical_type, typep.get(), source_file) &&
+          ir_dumper_->AddLinkableMessageIR(typep.get()));
 }
 
 std::string RecordDeclWrapper::GetMangledRTTI(
@@ -258,19 +262,18 @@
   return QualTypeToString(qual_type);
 }
 
-// CreateBasicNamedAndTypedDecl creates a BasicNamedAndTypedDecl : that'll
-// include all the generic information a basic type will have:
-// abi_dump::BasicNamedAndTypedDecl. Other methods fill in more specific
-// information, eg: RecordDecl, EnumDecl.
+// CreateBasicNamedAndTypedDecl creates a BasicNamedAndTypedDecl which will
+// include all the generic information of a basic type. Other methods will
+// create more specific information, e.g. RecordDecl, EnumDecl.
 bool ABIWrapper::CreateBasicNamedAndTypedDecl(
-    clang::QualType canonical_type,
-    abi_util::TypeIR *typep, const std::string &source_file) {
+    clang::QualType canonical_type, abi_util::TypeIR *typep,
+    const std::string &source_file) {
   // Cannot determine the size and alignment for template parameter dependent
   // types as well as incomplete types.
   const clang::Type *base_type = canonical_type.getTypePtr();
   assert(base_type != nullptr);
   clang::Type::TypeClass type_class = base_type->getTypeClass();
-  // Temporary Hack for auto type sizes. Not determinable.
+  // Temporary hack for auto type sizes. Not determinable.
   if ((type_class != clang::Type::Auto) && !base_type->isIncompleteType() &&
       !(base_type->isDependentType())) {
     std::pair<clang::CharUnits, clang::CharUnits> size_and_alignment =
@@ -284,8 +287,8 @@
       TypeNameWithFinalDestination(canonical_type);
   typep->SetName(type_name_with_destination);
   typep->SetLinkerSetKey(type_name_with_destination);
-  // default values are false, we don't set them since explicitly doing that
-  // makes the abi dumps more verbose.
+  // Default values are false, we don't set them since explicitly doing that
+  // makes the ABI dumps more verbose.
   // This type has a reference type if its a pointer / reference OR it has CVR
   // qualifiers.
   clang::QualType referenced_type = GetReferencedType(canonical_type);
@@ -296,7 +299,7 @@
   return CreateBasicNamedAndTypedDecl(referenced_type, source_file);
 }
 
-std::string ABIWrapper::GetTypeLinkageName(const clang::Type *typep)  {
+std::string ABIWrapper::GetTypeLinkageName(const clang::Type *typep) {
   assert(typep != nullptr);
   clang::QualType qt = typep->getCanonicalTypeInternal();
   return QualTypeToString(qt);
@@ -329,10 +332,10 @@
     return TypeAndCreationStatus(std::move(lvalue_reference_type_ir));
   }
   if (type_ptr->isRValueReferenceType()) {
-   auto rvalue_reference_type_ir =
-       std::make_unique<abi_util::RvalueReferenceTypeIR>();
-   rvalue_reference_type_ir->SetSourceFile(source_file);
-   return TypeAndCreationStatus(std::move(rvalue_reference_type_ir));
+    auto rvalue_reference_type_ir =
+        std::make_unique<abi_util::RvalueReferenceTypeIR>();
+    rvalue_reference_type_ir->SetSourceFile(source_file);
+    return TypeAndCreationStatus(std::move(rvalue_reference_type_ir));
   }
   if (type_ptr->isArrayType()) {
     auto array_type_ir = std::make_unique<abi_util::ArrayTypeIR>();
@@ -349,7 +352,7 @@
     return TypeAndCreationStatus(std::move(builtin_type_ir));
   }
   if (auto &&func_type_ptr =
-      llvm::dyn_cast<const clang::FunctionType>(type_ptr)) {
+          llvm::dyn_cast<const clang::FunctionType>(type_ptr)) {
     FunctionTypeWrapper function_type_wrapper(mangle_contextp_, ast_contextp_,
                                               cip_, func_type_ptr, ir_dumper_,
                                               ast_caches_, source_file);
@@ -361,7 +364,10 @@
   if (type_ptr->isRecordType()) {
     // If this record is anonymous, create it.
     const clang::RecordDecl *anon_record = GetAnonymousRecord(canonical_type);
-    if (anon_record && !CreateAnonymousRecord(anon_record)) {
+    // Avoid constructing RecordDeclWrapper with invalid record, which results
+    // in segmentation fault.
+    if (anon_record && !anon_record->isInvalidDecl() &&
+        !CreateAnonymousRecord(anon_record)) {
       llvm::errs() << "Anonymous record could not be created\n";
       ::exit(1);
     }
@@ -382,22 +388,20 @@
   return mangled_name;
 }
 
-std::string ABIWrapper::GetTagDeclQualifiedName(
-    const clang::TagDecl *decl) {
+std::string ABIWrapper::GetTagDeclQualifiedName(const clang::TagDecl *decl) {
   if (decl->getTypedefNameForAnonDecl()) {
     return decl->getTypedefNameForAnonDecl()->getQualifiedNameAsString();
   }
   return decl->getQualifiedNameAsString();
 }
 
-bool ABIWrapper::SetupTemplateArguments(
-    const clang::TemplateArgumentList *tl,
-    abi_util::TemplatedArtifactIR *ta,
-    const std::string &source_file) {
+bool ABIWrapper::SetupTemplateArguments(const clang::TemplateArgumentList *tl,
+                                        abi_util::TemplatedArtifactIR *ta,
+                                        const std::string &source_file) {
   abi_util::TemplateInfoIR template_info;
   for (int i = 0; i < tl->size(); i++) {
     const clang::TemplateArgument &arg = (*tl)[i];
-    //TODO: More comprehensive checking needed.
+    // TODO: More comprehensive checking needed.
     if (arg.getKind() != clang::TemplateArgument::Type) {
       continue;
     }
@@ -414,15 +418,15 @@
   return true;
 }
 
-std::string ABIWrapper::QualTypeToString(
-    const clang::QualType &sweet_qt) {
+std::string ABIWrapper::QualTypeToString(const clang::QualType &sweet_qt) {
   const clang::QualType salty_qt = sweet_qt.getCanonicalType();
   // clang::TypeName::getFullyQualifiedName removes the part of the type related
   // to it being a template parameter. Don't use it for dependent types.
   if (salty_qt.getTypePtr()->isDependentType()) {
     return salty_qt.getAsString();
   }
-  return clang::TypeName::getFullyQualifiedName(salty_qt, *ast_contextp_);
+  return clang::TypeName::getFullyQualifiedName(
+      salty_qt, *ast_contextp_, ast_contextp_->getPrintingPolicy());
 }
 
 FunctionTypeWrapper::FunctionTypeWrapper(
@@ -430,9 +434,10 @@
     const clang::CompilerInstance *compiler_instance_p,
     const clang::FunctionType *function_type, abi_util::IRDumper *ir_dumper,
     ast_util::ASTCaches *ast_caches, const std::string &source_file)
-  : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
-               ast_caches), function_type_(function_type),
-    source_file_(source_file) { }
+    : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
+                 ast_caches),
+      function_type_(function_type),
+      source_file_(source_file) {}
 
 bool FunctionTypeWrapper::SetupFunctionType(
     abi_util::FunctionTypeIR *function_type_ir) {
@@ -473,9 +478,9 @@
     const clang::FunctionDecl *decl,
     abi_util::IRDumper *ir_dumper,
     ast_util::ASTCaches *ast_caches)
-  : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
-               ast_caches),
-    function_decl_(decl) { }
+    : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
+                 ast_caches),
+      function_decl_(decl) {}
 
 bool FunctionDeclWrapper::SetupThisParameter(abi_util::FunctionIR *functionp,
                                              const std::string &source_file) {
@@ -527,7 +532,7 @@
 }
 
 bool FunctionDeclWrapper::SetupFunction(abi_util::FunctionIR *functionp,
-                                        const std::string &source_file)  {
+                                        const std::string &source_file) {
   // Go through all the parameters in the method and add them to the fields.
   // Also get the fully qualfied name.
   // TODO: Change this to get the complete function signature
@@ -543,9 +548,8 @@
       SetupTemplateInfo(functionp, source_file);
 }
 
-bool FunctionDeclWrapper::SetupTemplateInfo(
-    abi_util::FunctionIR *functionp,
-    const std::string &source_file)  {
+bool FunctionDeclWrapper::SetupTemplateInfo(abi_util::FunctionIR *functionp,
+                                            const std::string &source_file) {
   switch (function_decl_->getTemplatedKind()) {
     case clang::FunctionDecl::TK_FunctionTemplateSpecialization: {
       const clang::TemplateArgumentList *arg_list =
@@ -578,9 +582,9 @@
     const clang::CompilerInstance *compiler_instance_p,
     const clang::RecordDecl *decl, abi_util::IRDumper *ir_dumper,
     ast_util::ASTCaches *ast_caches)
-  : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
-               ast_caches),
-    record_decl_(decl) { }
+    : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
+                 ast_caches),
+      record_decl_(decl) {}
 
 bool RecordDeclWrapper::SetupRecordFields(abi_util::RecordTypeIR *recordp,
                                           const std::string &source_file) {
@@ -612,8 +616,7 @@
 }
 
 bool RecordDeclWrapper::SetupCXXBases(
-    abi_util::RecordTypeIR *cxxp,
-    const clang::CXXRecordDecl *cxx_record_decl) {
+    abi_util::RecordTypeIR *cxxp, const clang::CXXRecordDecl *cxx_record_decl) {
   if (!cxx_record_decl || !cxxp) {
     return false;
   }
@@ -633,6 +636,8 @@
   return true;
 }
 
+typedef std::map<uint64_t, clang::ThunkInfo> ThunkMap;
+
 bool RecordDeclWrapper::SetupRecordVTable(
     abi_util::RecordTypeIR *record_declp,
     const clang::CXXRecordDecl *cxx_record_decl) {
@@ -654,18 +659,30 @@
   }
   const clang::VTableLayout &vtable_layout =
       itanium_vtable_contextp->getVTableLayout(cxx_record_decl);
+  llvm::ArrayRef<clang::VTableLayout::VTableThunkTy> thunks =
+      vtable_layout.vtable_thunks();
+  ThunkMap thunk_map(thunks.begin(), thunks.end());
   abi_util::VTableLayoutIR vtable_ir_layout;
-  for (const auto &vtable_component : vtable_layout.vtable_components()) {
-    abi_util::VTableComponentIR added_component=
-        SetupRecordVTableComponent(vtable_component);
+
+  uint64_t index = 0;
+  for (auto vtable_component : vtable_layout.vtable_components()) {
+    clang::ThunkInfo thunk_info;
+    ThunkMap::iterator it = thunk_map.find(index);
+    if (it != thunk_map.end()) {
+      thunk_info = it->second;
+    }
+    abi_util::VTableComponentIR added_component =
+        SetupRecordVTableComponent(vtable_component, thunk_info);
     vtable_ir_layout.AddVTableComponent(std::move(added_component));
+    index++;
   }
   record_declp->SetVTableLayout(std::move(vtable_ir_layout));
   return true;
 }
 
 abi_util::VTableComponentIR RecordDeclWrapper::SetupRecordVTableComponent(
-    const clang::VTableComponent &vtable_component) {
+    const clang::VTableComponent &vtable_component,
+    const clang::ThunkInfo &thunk_info) {
   abi_util::VTableComponentIR::Kind kind =
       abi_util::VTableComponentIR::Kind::RTTI;
   std::string mangled_component_name = "";
@@ -673,6 +690,8 @@
   int64_t value = 0;
   clang::VTableComponent::Kind clang_component_kind =
       vtable_component.getKind();
+  bool is_pure = false;
+
   switch (clang_component_kind) {
     case clang::VTableComponent::CK_VCallOffset:
       kind = abi_util::VTableComponentIR::Kind::VCallOffset;
@@ -703,25 +722,40 @@
         const clang::CXXMethodDecl *method_decl =
             vtable_component.getFunctionDecl();
         assert(method_decl != nullptr);
+        is_pure = method_decl->isPure();
         switch (clang_component_kind) {
           case clang::VTableComponent::CK_FunctionPointer:
             kind = abi_util::VTableComponentIR::Kind::FunctionPointer;
-            mangled_component_name = GetMangledNameDecl(method_decl,
-                                                        mangle_contextp_);
-              break;
-          case clang::VTableComponent::CK_CompleteDtorPointer:
-            kind = abi_util::VTableComponentIR::Kind::CompleteDtorPointer;
-            mangle_contextp_->mangleCXXDtor(
-                vtable_component.getDestructorDecl(),
-                clang::CXXDtorType::Dtor_Complete, ostream);
+            if (thunk_info.isEmpty()) {
+              mangle_contextp_->mangleName(method_decl, ostream);
+            } else {
+              mangle_contextp_->mangleThunk(method_decl, thunk_info, ostream);
+            }
             ostream.flush();
             break;
+          case clang::VTableComponent::CK_CompleteDtorPointer:
           case clang::VTableComponent::CK_DeletingDtorPointer:
-            kind = abi_util::VTableComponentIR::Kind::DeletingDtorPointer;
-            mangle_contextp_->mangleCXXDtor(
-                vtable_component.getDestructorDecl(),
-                clang::CXXDtorType::Dtor_Deleting, ostream);
-            ostream.flush();
+            {
+              clang::CXXDtorType dtor_type;
+              if (clang_component_kind ==
+                  clang::VTableComponent::CK_CompleteDtorPointer) {
+                dtor_type = clang::CXXDtorType::Dtor_Complete;
+                kind = abi_util::VTableComponentIR::Kind::CompleteDtorPointer;
+              } else {
+                dtor_type = clang::CXXDtorType::Dtor_Deleting;
+                kind = abi_util::VTableComponentIR::Kind::DeletingDtorPointer;
+              }
+
+              if (thunk_info.isEmpty()) {
+                mangle_contextp_->mangleCXXDtor(
+                    vtable_component.getDestructorDecl(), dtor_type, ostream);
+              } else {
+                mangle_contextp_->mangleCXXDtorThunk(
+                    vtable_component.getDestructorDecl(), dtor_type,
+                    thunk_info.This, ostream);
+              }
+              ostream.flush();
+            }
             break;
           case clang::VTableComponent::CK_UnusedFunctionPointer:
             kind = abi_util::VTableComponentIR::Kind::UnusedFunctionPointer;
@@ -734,7 +768,8 @@
     default:
       break;
   }
-  return abi_util::VTableComponentIR(mangled_component_name, kind, value);
+  return abi_util::VTableComponentIR(mangled_component_name, kind, value,
+                                     is_pure);
 }
 
 bool RecordDeclWrapper::SetupTemplateInfo(
@@ -790,8 +825,8 @@
       SetupCXXRecordInfo(record_declp, source_file);
 }
 
-bool RecordDeclWrapper::SetupCXXRecordInfo(
-    abi_util::RecordTypeIR *record_declp, const std::string &source_file) {
+bool RecordDeclWrapper::SetupCXXRecordInfo(abi_util::RecordTypeIR *record_declp,
+                                           const std::string &source_file) {
   const clang::CXXRecordDecl *cxx_record_decl =
       clang::dyn_cast<clang::CXXRecordDecl>(record_decl_);
   if (!cxx_record_decl) {
@@ -802,7 +837,7 @@
       SetupRecordVTable(record_declp, cxx_record_decl);
 }
 
-// TODO: Can we use clang's ODR hash to do faster ODR checking ?
+// TODO: Can we use clang's ODR hash to do faster ODR checking?
 bool RecordDeclWrapper::GetRecordDecl() {
   auto abi_decl = std::make_unique<abi_util::RecordTypeIR>();
   std::string source_file = GetCachedDeclSourceFile(record_decl_, cip_);
@@ -825,9 +860,9 @@
     const clang::CompilerInstance *compiler_instance_p,
     const clang::EnumDecl *decl, abi_util::IRDumper *ir_dumper,
     ast_util::ASTCaches *ast_caches)
-  : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
-               ast_caches),
-    enum_decl_(decl) { }
+    : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
+                 ast_caches),
+      enum_decl_(decl) {}
 
 bool EnumDeclWrapper::SetupEnumFields(abi_util::EnumTypeIR *enump) {
   if (!enump) {
@@ -877,14 +912,13 @@
     const clang::CompilerInstance *compiler_instance_p,
     const clang::VarDecl *decl, abi_util::IRDumper *ir_dumper,
     ast_util::ASTCaches *ast_caches)
-  : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
-               ast_caches),
-    global_var_decl_(decl) { }
+    : ABIWrapper(mangle_contextp, ast_contextp, compiler_instance_p, ir_dumper,
+                 ast_caches),
+      global_var_decl_(decl) {}
 
-bool GlobalVarDeclWrapper::SetupGlobalVar(
-    abi_util::GlobalVarIR *global_varp,
-    const std::string &source_file) {
-  // Temporary fix : clang segfaults on trying to mangle global variable which
+bool GlobalVarDeclWrapper::SetupGlobalVar(abi_util::GlobalVarIR *global_varp,
+                                          const std::string &source_file) {
+  // Temporary fix: clang segfaults on trying to mangle global variable which
   // is a dependent sized array type.
   std::string mangled_name =
       GetMangledNameDecl(global_var_decl_, mangle_contextp_);
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.h b/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.h
index 4e1c2bc..3505020 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.h
+++ b/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.h
@@ -16,7 +16,7 @@
 #define ABI_WRAPPERS_H_
 
 #include "ast_util.h"
-#include <ir_representation.h>
+#include "ir_representation.h"
 
 #include <clang/AST/AST.h>
 #include <clang/AST/ASTConsumer.h>
@@ -28,10 +28,10 @@
 
 struct TypeAndCreationStatus {
   std::unique_ptr<abi_util::TypeIR> typep_;
-  bool should_create_type_; // Whether the type is to be created.
+  bool should_create_type_;  // Whether the type is to be created.
   TypeAndCreationStatus(std::unique_ptr<abi_util::TypeIR> &&typep,
                         bool should_create_type = true)
-      : typep_(std::move(typep)), should_create_type_(should_create_type) { }
+      : typep_(std::move(typep)), should_create_type_(should_create_type) {}
 };
 
 class ABIWrapper {
@@ -129,8 +129,9 @@
 
   std::string GetMangledRTTI(const clang::CXXRecordDecl *cxx_record_decl);
 
-  abi_util::VTableComponentIR SetupRecordVTableComponent(
-      const clang::VTableComponent &vtable_component);
+  abi_util::VTableComponentIR
+  SetupRecordVTableComponent(const clang::VTableComponent &vtable_component,
+                             const clang::ThunkInfo &thunk_info);
 
   bool SetupCXXRecordInfo(abi_util::RecordTypeIR *record_declp,
                           const std::string &source_file);
@@ -161,7 +162,6 @@
 
   bool SetupThisParameter(abi_util::FunctionIR *functionp,
                           const std::string &source_file);
-
 };
 
 class FunctionTypeWrapper : public ABIWrapper {
@@ -214,11 +214,12 @@
 
  private:
   const clang::VarDecl *global_var_decl_;
+
  private:
   bool SetupGlobalVar(abi_util::GlobalVarIR *global_varp,
                       const std::string &source_file);
 };
 
-} //end namespace abi_wrapper
+}  // namespace abi_wrapper
 
-#endif // ABI_WRAPPERS_H_
+#endif  // ABI_WRAPPERS_H_
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.cpp b/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.cpp
index 9cdc4a6..0aac0e3 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.cpp
+++ b/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.cpp
@@ -13,10 +13,11 @@
 // limitations under the License.
 
 #include "ast_processing.h"
+
 #include "abi_wrappers.h"
 
 #include <clang/Lex/Token.h>
-#include <clang/Tooling/Core/QualTypeNames.h>
+#include <clang/AST/QualTypeNames.h>
 #include <clang/Index/CodegenNameGenerator.h>
 
 #include <fstream>
@@ -30,22 +31,20 @@
 using abi_wrapper::GlobalVarDeclWrapper;
 
 HeaderASTVisitor::HeaderASTVisitor(
-    clang::MangleContext *mangle_contextp,
+    const HeaderCheckerOptions &options, clang::MangleContext *mangle_contextp,
     clang::ASTContext *ast_contextp,
     const clang::CompilerInstance *compiler_instance_p,
-    const std::set<std::string> &exported_headers,
-    const clang::Decl *tu_decl,
-    abi_util::IRDumper *ir_dumper,
+    const clang::Decl *tu_decl, abi_util::IRDumper *ir_dumper,
     ast_util::ASTCaches *ast_caches)
-  : mangle_contextp_(mangle_contextp),
-    ast_contextp_(ast_contextp),
-    cip_(compiler_instance_p),
-    exported_headers_(exported_headers),
-    tu_decl_(tu_decl),
-    ir_dumper_(ir_dumper),
-    ast_caches_(ast_caches) { }
+    : options_(options), mangle_contextp_(mangle_contextp),
+      ast_contextp_(ast_contextp), cip_(compiler_instance_p), tu_decl_(tu_decl),
+      ir_dumper_(ir_dumper), ast_caches_(ast_caches) {}
 
 bool HeaderASTVisitor::VisitRecordDecl(const clang::RecordDecl *decl) {
+  // Avoid segmentation fault in getASTRecordLayout.
+  if (decl->isInvalidDecl()) {
+    return true;
+  }
   // Skip forward declarations, dependent records. Also skip anonymous records
   // as they will be traversed through record fields.
   if (!decl->isThisDeclarationADefinition() ||
@@ -69,7 +68,7 @@
   EnumDeclWrapper enum_decl_wrapper(
       mangle_contextp_, ast_contextp_, cip_, decl, ir_dumper_, ast_caches_);
   return enum_decl_wrapper.GetEnumDecl();
- }
+}
 
 static bool MutateFunctionWithLinkageName(const abi_util::FunctionIR *function,
                                           abi_util::IRDumper *ir_dumper,
@@ -91,8 +90,15 @@
   return true;
 }
 
-static bool ShouldSkipFunctionDecl(const clang::FunctionDecl *decl) {
+bool HeaderASTVisitor::ShouldSkipFunctionDecl(const clang::FunctionDecl *decl) {
   if (!decl->getDefinition()) {
+    if (!options_.dump_function_declarations_ ||
+        options_.source_file_ != ABIWrapper::GetDeclSourceFile(decl, cip_)) {
+      return true;
+    }
+  }
+  // Skip explicitly deleted functions such as `Foo operator=(Foo) = delete;`.
+  if (decl->isDeleted()) {
     return true;
   }
   if (decl->getLinkageAndVisibility().getLinkage() !=
@@ -101,7 +107,12 @@
   }
   if (const clang::CXXMethodDecl *method_decl =
       llvm::dyn_cast<clang::CXXMethodDecl>(decl)) {
-    if (method_decl->getParent()->getTypeForDecl()->isDependentType()) {
+    const clang::CXXRecordDecl *record_decl = method_decl->getParent();
+    // Avoid segmentation fault in getThunkInfo in getAllManglings.
+    if (method_decl->isVirtual() && record_decl->isInvalidDecl()) {
+      return true;
+    }
+    if (record_decl->getTypeForDecl()->isDependentType()) {
       return true;
     }
   }
@@ -120,9 +131,8 @@
   if (ShouldSkipFunctionDecl(decl)) {
     return true;
   }
-  FunctionDeclWrapper function_decl_wrapper(mangle_contextp_, ast_contextp_,
-                                            cip_, decl, ir_dumper_,
-                                            ast_caches_);
+  FunctionDeclWrapper function_decl_wrapper(
+      mangle_contextp_, ast_contextp_, cip_, decl, ir_dumper_, ast_caches_);
   auto function_wrapper = function_decl_wrapper.GetFunctionDecl();
   // Destructors and Constructors can have more than 1 symbol generated from the
   // same Decl.
@@ -138,15 +148,14 @@
 }
 
 bool HeaderASTVisitor::VisitVarDecl(const clang::VarDecl *decl) {
-  if(!decl->hasGlobalStorage()||
-     decl->getType().getTypePtr()->isDependentType()) {
+  if (!decl->hasGlobalStorage() ||
+      decl->getType().getTypePtr()->isDependentType()) {
     // Non global / static variable declarations don't need to be dumped.
     return true;
   }
-  GlobalVarDeclWrapper global_var_decl_wrapper(mangle_contextp_, ast_contextp_,
-                                               cip_, decl, ir_dumper_,
-                                               ast_caches_);
-  return  global_var_decl_wrapper.GetGlobalVarDecl();
+  GlobalVarDeclWrapper global_var_decl_wrapper(
+      mangle_contextp_, ast_contextp_, cip_, decl, ir_dumper_, ast_caches_);
+  return global_var_decl_wrapper.GetGlobalVarDecl();
 }
 
 static bool AreHeadersExported(const std::set<std::string> &exported_headers) {
@@ -162,8 +171,9 @@
   ast_caches_->decl_to_source_file_cache_.insert(
       std::make_pair(decl, source_file));
   // If no exported headers are specified we assume the whole AST is exported.
-  if ((decl != tu_decl_) && AreHeadersExported(exported_headers_) &&
-      (exported_headers_.find(source_file) == exported_headers_.end())) {
+  const auto &exported_headers = options_.exported_headers_;
+  if ((decl != tu_decl_) && AreHeadersExported(exported_headers) &&
+      (exported_headers.find(source_file) == exported_headers.end())) {
     return true;
   }
   // If at all we're looking at the source file's AST decl node, it should be a
@@ -177,14 +187,8 @@
 }
 
 HeaderASTConsumer::HeaderASTConsumer(
-    clang::CompilerInstance *compiler_instancep,
-    const std::string &out_dump_name,
-    std::set<std::string> &exported_headers,
-    abi_util::TextFormatIR text_format)
-  : cip_(compiler_instancep),
-    out_dump_name_(out_dump_name),
-    exported_headers_(exported_headers),
-    text_format_(text_format){ }
+    clang::CompilerInstance *compiler_instancep, HeaderCheckerOptions &options)
+    : cip_(compiler_instancep), options_(options) {}
 
 void HeaderASTConsumer::HandleTranslationUnit(clang::ASTContext &ctx) {
   clang::PrintingPolicy policy(ctx.getPrintingPolicy());
@@ -199,12 +203,13 @@
   const std::string &translation_unit_source =
       ABIWrapper::GetDeclSourceFile(translation_unit, cip_);
   ast_util::ASTCaches ast_caches(translation_unit_source);
-  if (!exported_headers_.empty()) {
-    exported_headers_.insert(translation_unit_source);
+  if (!options_.exported_headers_.empty()) {
+    options_.exported_headers_.insert(translation_unit_source);
   }
   std::unique_ptr<abi_util::IRDumper> ir_dumper =
-      abi_util::IRDumper::CreateIRDumper(text_format_, out_dump_name_);
-  HeaderASTVisitor v(mangle_contextp.get(), &ctx, cip_, exported_headers_,
+      abi_util::IRDumper::CreateIRDumper(options_.text_format_,
+                                         options_.dump_name_);
+  HeaderASTVisitor v(options_, mangle_contextp.get(), &ctx, cip_,
                      translation_unit, ir_dumper.get(), &ast_caches);
 
   if (!v.TraverseDecl(translation_unit) || !ir_dumper->Dump()) {
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.h b/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.h
index b798c97..4e8cd59 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.h
+++ b/vndk/tools/header-checker/header-abi-dumper/src/ast_processing.h
@@ -16,7 +16,7 @@
 #define AST_PROCESSING_H_
 
 #include "ast_util.h"
-#include <ir_representation.h>
+#include "header_checker.h"
 
 #include <clang/AST/AST.h>
 #include <clang/AST/ASTConsumer.h>
@@ -30,10 +30,10 @@
 class HeaderASTVisitor
     : public clang::RecursiveASTVisitor<HeaderASTVisitor> {
  public:
-  HeaderASTVisitor(clang::MangleContext *mangle_contextp,
+  HeaderASTVisitor(const HeaderCheckerOptions &options,
+                   clang::MangleContext *mangle_contextp,
                    clang::ASTContext *ast_contextp,
                    const clang::CompilerInstance *compiler_instance_p,
-                   const std::set<std::string> &exported_headers,
                    const clang::Decl *tu_decl,
                    abi_util::IRDumper *ir_dumper,
                    ast_util::ASTCaches *ast_caches);
@@ -49,15 +49,15 @@
   bool TraverseDecl(clang::Decl *decl);
 
   // Enable recursive traversal of template instantiations.
-  bool shouldVisitTemplateInstantiations() const {
-    return true;
-  }
+  bool shouldVisitTemplateInstantiations() const { return true; }
 
  private:
+  bool ShouldSkipFunctionDecl(const clang::FunctionDecl *decl);
+
+  const HeaderCheckerOptions &options_;
   clang::MangleContext *mangle_contextp_;
   clang::ASTContext *ast_contextp_;
   const clang::CompilerInstance *cip_;
-  const std::set<std::string> &exported_headers_;
   // To optimize recursion into only exported abi.
   const clang::Decl *tu_decl_;
   abi_util::IRDumper *ir_dumper_;
@@ -69,17 +69,13 @@
 class HeaderASTConsumer : public clang::ASTConsumer {
  public:
   HeaderASTConsumer(clang::CompilerInstance *compiler_instancep,
-                    const std::string &out_dump_name,
-                    std::set<std::string> &exported_headers,
-                    abi_util::TextFormatIR text_format);
+                    HeaderCheckerOptions &options);
 
   void HandleTranslationUnit(clang::ASTContext &ctx) override;
 
  private:
   clang::CompilerInstance *cip_;
-  const std::string &out_dump_name_;
-  std::set<std::string> &exported_headers_;
-  abi_util::TextFormatIR text_format_;
+  HeaderCheckerOptions &options_;
 };
 
-#endif // AST_PROCESSING_H_
+#endif  // AST_PROCESSING_H_
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/ast_util.h b/vndk/tools/header-checker/header-abi-dumper/src/ast_util.h
index 32b4654..74057c5 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/ast_util.h
+++ b/vndk/tools/header-checker/header-abi-dumper/src/ast_util.h
@@ -11,8 +11,9 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-#ifndef AST_UTIL
-#define AST_UTIL
+
+#ifndef AST_UTIL_H_
+#define AST_UTIL_H_
 
 #include <clang/AST/AST.h>
 
@@ -24,9 +25,8 @@
 constexpr static char type_id_prefix[] = "type-";
 
 struct ASTCaches {
-
   ASTCaches(const std::string &translation_unit_source)
-      : translation_unit_source_(translation_unit_source) { };
+      : translation_unit_source_(translation_unit_source) {}
 
   std::string GetTypeId(const std::string &qual_type) {
     auto type_id_it = qual_type_to_type_id_cache_.find(qual_type);
@@ -45,5 +45,6 @@
   uint64_t max_type_id_ = 0;
 };
 
-}
-#endif
+}  // namespace ast_util
+
+#endif  // AST_UTIL_H_
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/diagnostic_consumer.cpp b/vndk/tools/header-checker/header-abi-dumper/src/diagnostic_consumer.cpp
new file mode 100644
index 0000000..e99e9b0
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-dumper/src/diagnostic_consumer.cpp
@@ -0,0 +1,64 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "diagnostic_consumer.h"
+
+#include <clang/Basic/DiagnosticCategories.h>
+#include <clang/Basic/DiagnosticIDs.h>
+#include <clang/Lex/LexDiagnostic.h>
+
+HeaderCheckerDiagnosticConsumer::HeaderCheckerDiagnosticConsumer(
+    std::unique_ptr<clang::DiagnosticConsumer> wrapped)
+    : wrapped_(std::move(wrapped)) {}
+
+void HeaderCheckerDiagnosticConsumer::clear() {
+  // Default implementation resets warning/error count.
+  DiagnosticConsumer::clear();
+  wrapped_->clear();
+}
+
+void HeaderCheckerDiagnosticConsumer::BeginSourceFile(
+    const clang::LangOptions &lang_opts,
+    const clang::Preprocessor *preprocessor) {
+  wrapped_->BeginSourceFile(lang_opts, preprocessor);
+}
+
+void HeaderCheckerDiagnosticConsumer::EndSourceFile() {
+  wrapped_->EndSourceFile();
+}
+
+void HeaderCheckerDiagnosticConsumer::finish() { wrapped_->finish(); }
+
+bool HeaderCheckerDiagnosticConsumer::IncludeInDiagnosticCounts() const {
+  return false;
+}
+
+void HeaderCheckerDiagnosticConsumer::HandleDiagnostic(
+    clang::DiagnosticsEngine::Level level, const clang::Diagnostic &info) {
+  if (level < clang::DiagnosticsEngine::Level::Error) {
+    return;
+  }
+  unsigned id = info.getID();
+  if (id == clang::diag::err_pp_hash_error ||
+      id == clang::diag::fatal_too_many_errors) {
+    return;
+  }
+  unsigned category = clang::DiagnosticIDs::getCategoryNumberForDiag(id);
+  if (category == clang::diag::DiagCat_Semantic_Issue) {
+    return;
+  }
+  // Default implementation increases warning/error count.
+  DiagnosticConsumer::HandleDiagnostic(level, info);
+  wrapped_->HandleDiagnostic(level, info);
+}
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/diagnostic_consumer.h b/vndk/tools/header-checker/header-abi-dumper/src/diagnostic_consumer.h
new file mode 100644
index 0000000..927c8ca
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-dumper/src/diagnostic_consumer.h
@@ -0,0 +1,37 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef DIAGNOSTIC_CONSUMER_H_
+#define DIAGNOSTIC_CONSUMER_H_
+
+#include <clang/Basic/Diagnostic.h>
+
+class HeaderCheckerDiagnosticConsumer : public clang::DiagnosticConsumer {
+ private:
+  std::unique_ptr<clang::DiagnosticConsumer> wrapped_;
+
+ public:
+  HeaderCheckerDiagnosticConsumer(
+      std::unique_ptr<clang::DiagnosticConsumer> wrapped);
+  void clear() override;
+  void BeginSourceFile(const clang::LangOptions &lang_opts,
+                       const clang::Preprocessor *preprocessor) override;
+  void EndSourceFile() override;
+  void finish() override;
+  bool IncludeInDiagnosticCounts() const override;
+  void HandleDiagnostic(clang::DiagnosticsEngine::Level level,
+                        const clang::Diagnostic &info) override;
+};
+
+#endif  // DIAGNOSTIC_CONSUMER_H_
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/fake_decl_source.cpp b/vndk/tools/header-checker/header-abi-dumper/src/fake_decl_source.cpp
new file mode 100644
index 0000000..417433c
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-dumper/src/fake_decl_source.cpp
@@ -0,0 +1,200 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "fake_decl_source.h"
+
+#include <clang/Lex/Preprocessor.h>
+#include <clang/Sema/Lookup.h>
+
+FakeDeclSource::FakeDeclSource(const clang::CompilerInstance &ci) : ci_(ci) {}
+
+clang::CXXRecordDecl *
+FakeDeclSource::CreateCXXRecordDecl(const clang::DeclarationName &name,
+                                    clang::DeclContext *decl_context) {
+  clang::CXXRecordDecl *cxx_record_decl = clang::CXXRecordDecl::Create(
+      ci_.getASTContext(), clang::TTK_Struct, decl_context,
+      clang::SourceLocation(), clang::SourceLocation(),
+      name.getAsIdentifierInfo(), /* PrevDecl */ nullptr);
+  cxx_record_decl->setInvalidDecl(true);
+
+  return cxx_record_decl;
+}
+
+clang::ClassTemplateDecl *
+FakeDeclSource::CreateClassTemplateDecl(clang::CXXRecordDecl *cxx_record_decl,
+                                        clang::DeclContext *decl_context) {
+  clang::ASTContext &ast = ci_.getASTContext();
+
+  // Declare `template<typename ...T> struct RecordName` in decl_context.
+  clang::TemplateTypeParmDecl *parm = clang::TemplateTypeParmDecl::Create(
+      ast, decl_context, clang::SourceLocation(), clang::SourceLocation(),
+      /* Depth */ 0, /* Position */ 0, /* Id */ nullptr,
+      /* Typename */ true, /* ParameterPack */ true);
+  parm->setInvalidDecl(true);
+
+  clang::NamedDecl *parm_array[1] = {parm};
+  clang::TemplateParameterList *parm_list =
+      clang::TemplateParameterList::Create(
+          ast, clang::SourceLocation(), clang::SourceLocation(), parm_array,
+          clang::SourceLocation(), /* RequiresClause */ nullptr);
+
+  clang::ClassTemplateDecl *class_template_decl =
+      clang::ClassTemplateDecl::Create(
+          ast, decl_context, clang::SourceLocation(),
+          cxx_record_decl->getDeclName(), parm_list, cxx_record_decl,
+          /* AssociatedConstraints */ nullptr);
+
+  cxx_record_decl->setDescribedClassTemplate(class_template_decl);
+  class_template_decl->setInvalidDecl(true);
+
+  return class_template_decl;
+}
+
+clang::NamespaceDecl *
+FakeDeclSource::CreateNamespaceDecl(const clang::DeclarationName &name,
+                                    clang::DeclContext *decl_context) {
+  clang::NamespaceDecl *namespace_decl = clang::NamespaceDecl::Create(
+      ci_.getASTContext(), decl_context, /* Inline */ false,
+      clang::SourceLocation(), clang::SourceLocation(),
+      name.getAsIdentifierInfo(), /* PrevDecl */ nullptr);
+  namespace_decl->setInvalidDecl(true);
+
+  return namespace_decl;
+}
+
+clang::NamedDecl *
+FakeDeclSource::CreateDecl(clang::Sema::LookupNameKind kind,
+                           const clang::DeclarationNameInfo &name_info,
+                           clang::DeclContext *decl_context) {
+  const clang::DeclarationName &name = name_info.getName();
+  if (name.getNameKind() != clang::DeclarationName::Identifier) {
+    return nullptr;
+  }
+
+  clang::NamedDecl *decl;
+  switch (kind) {
+  case clang::Sema::LookupOrdinaryName:
+  case clang::Sema::LookupTagName: {
+    clang::CXXRecordDecl *cxx_record_decl =
+        CreateCXXRecordDecl(name, decl_context);
+    // If `<` follows the type name, the type must be a template.
+    // Otherwise, the compiler takes it as a syntax error.
+    const clang::Token &next_token = ci_.getPreprocessor().LookAhead(0);
+    if (next_token.is(clang::tok::less)) {
+      decl = CreateClassTemplateDecl(cxx_record_decl, decl_context);
+    } else {
+      decl = cxx_record_decl;
+    }
+    break;
+  }
+  case clang::Sema::LookupNestedNameSpecifierName:
+    decl = CreateNamespaceDecl(name, decl_context);
+    break;
+  default:
+    decl = nullptr;
+  }
+
+  if (decl) {
+    decl_context->addDecl(decl);
+  }
+  return decl;
+}
+
+clang::DeclContext *
+FakeDeclSource::ResolveDeclContext(clang::DeclContext *member_context,
+                                   clang::Scope *scope,
+                                   clang::NestedNameSpecifier *nns) {
+  if (member_context) {
+    return member_context;
+  }
+
+  if (nns) {
+    switch (nns->getKind()) {
+    case clang::NestedNameSpecifier::Namespace:
+      return nns->getAsNamespace();
+    case clang::NestedNameSpecifier::NamespaceAlias:
+      return nns->getAsNamespaceAlias()->getNamespace();
+    case clang::NestedNameSpecifier::TypeSpec:
+    case clang::NestedNameSpecifier::TypeSpecWithTemplate:
+      return nns->getAsRecordDecl();
+    case clang::NestedNameSpecifier::Global:
+      return ci_.getASTContext().getTranslationUnitDecl();
+    case clang::NestedNameSpecifier::Identifier:
+    case clang::NestedNameSpecifier::Super:
+      break;
+    }
+  }
+
+  if (scope && scope->getEntity()) {
+    return scope->getEntity();
+  }
+
+  return ci_.getASTContext().getTranslationUnitDecl();
+}
+
+clang::TypoCorrection FakeDeclSource::CorrectTypo(
+    const clang::DeclarationNameInfo &typo, int lookup_kind,
+    clang::Scope *scope, clang::CXXScopeSpec *scope_spec,
+    clang::CorrectionCandidateCallback &ccc, clang::DeclContext *member_context,
+    bool entering_context, const clang::ObjCObjectPointerType *opt) {
+  // Skip function bodies.
+  if (scope && scope->getFnParent()) {
+    return clang::TypoCorrection();
+  }
+
+  clang::NestedNameSpecifier *nns = nullptr;
+  if (scope_spec && !scope_spec->isEmpty()) {
+    nns = scope_spec->getScopeRep();
+  }
+
+  clang::DeclContext *decl_context =
+      ResolveDeclContext(member_context, scope, nns);
+
+  clang::NamedDecl *decl =
+      CreateDecl(clang::Sema::LookupNameKind(lookup_kind), typo, decl_context);
+  if (decl == nullptr) {
+    return clang::TypoCorrection();
+  }
+
+  return clang::TypoCorrection(decl, nns);
+}
+
+bool FakeDeclSource::LookupUnqualified(clang::LookupResult &result,
+                                       clang::Scope *scope) {
+  // The compiler looks for redeclaration when it parses a known name.
+  if (result.isForRedeclaration()) {
+    return false;
+  }
+  // Skip function bodies.
+  if (scope && scope->getFnParent()) {
+    return false;
+  }
+
+  clang::DeclContext *decl_context;
+  if (scope && scope->getEntity()) {
+    decl_context = scope->getEntity();
+  } else {
+    decl_context = ci_.getASTContext().getTranslationUnitDecl();
+  }
+
+  clang::NamedDecl *decl = CreateDecl(result.getLookupKind(),
+                                      result.getLookupNameInfo(), decl_context);
+  if (decl == nullptr) {
+    return false;
+  }
+
+  result.addDecl(decl);
+  result.resolveKind();
+  return true;
+}
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/fake_decl_source.h b/vndk/tools/header-checker/header-abi-dumper/src/fake_decl_source.h
new file mode 100644
index 0000000..7d9cc79
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-dumper/src/fake_decl_source.h
@@ -0,0 +1,59 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <clang/Frontend/CompilerInstance.h>
+#include <clang/Sema/ExternalSemaSource.h>
+#include <clang/Sema/Sema.h>
+
+// This class creates fake declarations when the compiler queries for unknown
+// types.
+class FakeDeclSource : public clang::ExternalSemaSource {
+ private:
+  const clang::CompilerInstance &ci_;
+
+  clang::CXXRecordDecl *CreateCXXRecordDecl(const clang::DeclarationName &name,
+                                            clang::DeclContext *decl_context);
+
+  clang::ClassTemplateDecl *
+  CreateClassTemplateDecl(clang::CXXRecordDecl *cxx_record_decl,
+                          clang::DeclContext *decl_context);
+
+  clang::NamespaceDecl *CreateNamespaceDecl(const clang::DeclarationName &name,
+                                            clang::DeclContext *decl_context);
+
+  // This method creates a declaration in decl_context according to the lookup
+  // name kind and the declaration name kind. If this method doesn't support the
+  // kinds, it returns nullptr.
+  clang::NamedDecl *CreateDecl(clang::Sema::LookupNameKind kind,
+                               const clang::DeclarationNameInfo &name,
+                               clang::DeclContext *decl_context);
+
+  // Return the DeclContext for CorrectTypo to create a declaration in.
+  clang::DeclContext *ResolveDeclContext(clang::DeclContext *member_context,
+                                         clang::Scope *scope,
+                                         clang::NestedNameSpecifier *nns);
+
+ public:
+  FakeDeclSource(const clang::CompilerInstance &ci);
+
+  clang::TypoCorrection
+  CorrectTypo(const clang::DeclarationNameInfo &typo, int lookup_kind,
+              clang::Scope *scope, clang::CXXScopeSpec *scope_spec,
+              clang::CorrectionCandidateCallback &ccc,
+              clang::DeclContext *member_context, bool entering_context,
+              const clang::ObjCObjectPointerType *opt) override;
+
+  bool LookupUnqualified(clang::LookupResult &result,
+                         clang::Scope *scope) override;
+};
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.cpp b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.cpp
index f4dd282..6662fce 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.cpp
+++ b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.cpp
@@ -12,29 +12,47 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "frontend_action.h"
 
 #include "ast_processing.h"
-#include "frontend_action.h"
-#include <header_abi_util.h>
-#include <ir_representation.h>
+#include "diagnostic_consumer.h"
+#include "fake_decl_source.h"
+#include "header_abi_util.h"
+#include "ir_representation.h"
 
 #include <clang/AST/ASTConsumer.h>
 #include <clang/Frontend/CompilerInstance.h>
 #include <clang/Lex/Preprocessor.h>
+
 #include <llvm/ADT/STLExtras.h>
-#include <llvm/Support/FileSystem.h>
-#include <llvm/Support/Path.h>
 
 HeaderCheckerFrontendAction::HeaderCheckerFrontendAction(
-    const std::string &dump_name, std::set<std::string> &exported_headers,
-    abi_util::TextFormatIR text_format)
-  : dump_name_(dump_name), exported_headers_(exported_headers),
-    text_format_(text_format) { }
+    HeaderCheckerOptions &options)
+    : options_(options) {}
 
 std::unique_ptr<clang::ASTConsumer>
 HeaderCheckerFrontendAction::CreateASTConsumer(clang::CompilerInstance &ci,
                                                llvm::StringRef header_file) {
   // Create AST consumers.
-  return llvm::make_unique<HeaderASTConsumer>(&ci, dump_name_,
-                                              exported_headers_, text_format_);
+  return llvm::make_unique<HeaderASTConsumer>(&ci, options_);
+}
+
+bool HeaderCheckerFrontendAction::BeginInvocation(clang::CompilerInstance &ci) {
+  if (options_.suppress_errors_) {
+    ci.getFrontendOpts().SkipFunctionBodies = true;
+    clang::DiagnosticsEngine &diagnostics = ci.getDiagnostics();
+    diagnostics.setClient(
+        new HeaderCheckerDiagnosticConsumer(diagnostics.takeClient()),
+        /* ShouldOwnClient */ true);
+  }
+  return true;
+}
+
+bool HeaderCheckerFrontendAction::BeginSourceFileAction(
+    clang::CompilerInstance &ci) {
+  if (options_.suppress_errors_) {
+    ci.setExternalSemaSource(new FakeDeclSource(ci));
+    ci.getPreprocessor().SetSuppressIncludeNotFoundError(true);
+  }
+  return true;
 }
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.h b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.h
index 294c608..166e3b6 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.h
+++ b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action.h
@@ -15,7 +15,7 @@
 #ifndef FRONTEND_ACTION_H_
 #define FRONTEND_ACTION_H_
 
-#include <ir_representation.h>
+#include "header_checker.h"
 
 #include <clang/Frontend/FrontendAction.h>
 #include <llvm/ADT/StringRef.h>
@@ -32,19 +32,17 @@
 
 class HeaderCheckerFrontendAction : public clang::ASTFrontendAction {
  private:
-  const std::string &dump_name_;
-  std::set<std::string> &exported_headers_;
-  abi_util::TextFormatIR text_format_;
+  HeaderCheckerOptions &options_;
 
  public:
-  HeaderCheckerFrontendAction(
-      const std::string &dump_name,
-      std::set<std::string> &exported_headers,
-      abi_util::TextFormatIR text_format);
+  HeaderCheckerFrontendAction(HeaderCheckerOptions &options);
 
  protected:
   std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(
       clang::CompilerInstance &ci, llvm::StringRef header_file) override;
+
+  bool BeginInvocation(clang::CompilerInstance &ci) override;
+  bool BeginSourceFileAction(clang::CompilerInstance &ci) override;
 };
 
 #endif  // FRONTEND_ACTION_H_
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.cpp b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.cpp
index 30372dc..bf1448a 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.cpp
+++ b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.cpp
@@ -19,13 +19,9 @@
 #include <clang/Frontend/FrontendActions.h>
 
 HeaderCheckerFrontendActionFactory::HeaderCheckerFrontendActionFactory(
-    const std::string &dump_name,
-    std::set<std::string> &exported_headers,
-    abi_util::TextFormatIR text_format)
-  : dump_name_(dump_name), exported_headers_(exported_headers),
-    text_format_(text_format) { }
+    HeaderCheckerOptions &options)
+    : options_(options) {}
 
 clang::FrontendAction *HeaderCheckerFrontendActionFactory::create() {
-  return new HeaderCheckerFrontendAction(dump_name_, exported_headers_,
-                                         text_format_);
+  return new HeaderCheckerFrontendAction(options_);
 }
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.h b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.h
index 0932372..1f470c9 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.h
+++ b/vndk/tools/header-checker/header-abi-dumper/src/frontend_action_factory.h
@@ -15,7 +15,9 @@
 #ifndef FRONTEND_ACTION_FACTORY_H_
 #define FRONTEND_ACTION_FACTORY_H_
 
-#include <ir_representation.h>
+#include "frontend_action.h"
+#include "ir_representation.h"
+
 #include <clang/Tooling/Tooling.h>
 
 #include <vector>
@@ -23,15 +25,10 @@
 class HeaderCheckerFrontendActionFactory
     : public clang::tooling::FrontendActionFactory {
  private:
-  const std::string &dump_name_;
-  std::set<std::string> &exported_headers_;
-  abi_util::TextFormatIR text_format_;
+  HeaderCheckerOptions &options_;
 
  public:
-  HeaderCheckerFrontendActionFactory(
-      const std::string &dump_name,
-      std::set<std::string> &exported_headers,
-      abi_util::TextFormatIR text_format);
+  HeaderCheckerFrontendActionFactory(HeaderCheckerOptions &options);
 
   clang::FrontendAction *create() override;
 };
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/header_checker.cpp b/vndk/tools/header-checker/header-abi-dumper/src/header_checker.cpp
index ce26fa7..25f352b 100644
--- a/vndk/tools/header-checker/header-abi-dumper/src/header_checker.cpp
+++ b/vndk/tools/header-checker/header-abi-dumper/src/header_checker.cpp
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "header_checker.h"
+
 #include "fixed_argv.h"
 #include "frontend_action_factory.h"
-
-#include <header_abi_util.h>
+#include "header_abi_util.h"
 
 #include <clang/Frontend/FrontendActions.h>
 #include <clang/Tooling/CommonOptionsParser.h>
@@ -51,12 +52,23 @@
     "no-filter", llvm::cl::desc("Do not filter any abi"), llvm::cl::Optional,
     llvm::cl::cat(header_checker_category));
 
-static llvm::cl::opt<abi_util::TextFormatIR> text_format(
-    "text-format", llvm::cl::desc("Specify text format of abi dump"),
+static llvm::cl::opt<bool> suppress_errors(
+    "suppress-errors",
+    llvm::cl::desc("Suppress preprocess and semantic errors"),
+    llvm::cl::Optional, llvm::cl::cat(header_checker_category));
+
+static llvm::cl::opt<bool> dump_function_declarations(
+    "dump-function-declarations",
+    llvm::cl::desc("Output the functions declared but not defined in the input "
+                   "file"),
+    llvm::cl::Optional, llvm::cl::cat(header_checker_category));
+
+static llvm::cl::opt<abi_util::TextFormatIR> output_format(
+    "output-format", llvm::cl::desc("Specify format of output dump file"),
     llvm::cl::values(clEnumValN(abi_util::TextFormatIR::ProtobufTextFormat,
                                 "ProtobufTextFormat", "ProtobufTextFormat"),
-                     clEnumValEnd),
-    llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
+                     clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON")),
+    llvm::cl::init(abi_util::TextFormatIR::Json),
     llvm::cl::cat(header_checker_category));
 
 // Hide irrelevant command line options defined in LLVM libraries.
@@ -73,7 +85,6 @@
   }
 }
 
-
 int main(int argc, const char **argv) {
   HideIrrelevantCommandLineOptions();
 
@@ -82,34 +93,41 @@
   FixedArgvRegistry::Apply(fixed_argv);
 
   // Create compilation database from command line arguments after "--".
+  std::string cmdline_error_msg;
   std::unique_ptr<clang::tooling::CompilationDatabase> compilations;
-
   {
     // loadFromCommandLine() may alter argc and argv, thus access fixed_argv
     // through FixedArgvAccess.
     FixedArgvAccess raw(fixed_argv);
-    compilations.reset(
+
+    compilations =
         clang::tooling::FixedCompilationDatabase::loadFromCommandLine(
-            raw.argc_, raw.argv_));
+            raw.argc_, raw.argv_, cmdline_error_msg);
   }
 
-  // Parse the command line options.
+  // Parse the command line options
   llvm::cl::ParseCommandLineOptions(
       fixed_argv.GetArgc(), fixed_argv.GetArgv(), "header-checker");
 
+  // Print an error message if we failed to create the compilation database
+  // from the command line arguments. This check is intentionally performed
+  // after `llvm::cl::ParseCommandLineOptions()` so that `-help` can work
+  // without `--`.
+  if (!compilations) {
+    if (cmdline_error_msg.empty()) {
+      llvm::errs() << "ERROR: Failed to parse clang command line options\n";
+    } else {
+      llvm::errs() << "ERROR: " << cmdline_error_msg << "\n";
+    }
+    ::exit(1);
+  }
+
   // Input header file existential check.
   if (!llvm::sys::fs::exists(header_file)) {
     llvm::errs() << "ERROR: Header file \"" << header_file << "\" not found\n";
     ::exit(1);
   }
 
-  // Check whether we can create compilation database and deduce compiler
-  // options from command line options.
-  if (!compilations) {
-    llvm::errs() << "ERROR: Clang compilation options not specified.\n";
-    ::exit(1);
-  }
-
   std::set<std::string> exported_headers;
   if (!no_filter) {
     exported_headers =
@@ -118,11 +136,12 @@
 
   // Initialize clang tools and run front-end action.
   std::vector<std::string> header_files{ header_file };
+  HeaderCheckerOptions options(abi_util::RealPath(header_file), out_dump,
+                               std::move(exported_headers), output_format,
+                               dump_function_declarations, suppress_errors);
 
   clang::tooling::ClangTool tool(*compilations, header_files);
   std::unique_ptr<clang::tooling::FrontendActionFactory> factory(
-      new HeaderCheckerFrontendActionFactory(out_dump, exported_headers,
-                                             text_format));
-
+      new HeaderCheckerFrontendActionFactory(options));
   return tool.run(factory.get());
 }
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/header_checker.h b/vndk/tools/header-checker/header-abi-dumper/src/header_checker.h
new file mode 100644
index 0000000..8fe4ebb
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-dumper/src/header_checker.h
@@ -0,0 +1,44 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef HEADER_CHECKER_H_
+#define HEADER_CHECKER_H_
+
+#include "ir_representation.h"
+
+#include <set>
+#include <string>
+
+class HeaderCheckerOptions {
+ public:
+  std::string source_file_;
+  std::string dump_name_;
+  std::set<std::string> exported_headers_;
+  abi_util::TextFormatIR text_format_;
+  bool dump_function_declarations_;
+  bool suppress_errors_;
+
+ public:
+  HeaderCheckerOptions(std::string source_file, std::string dump_name,
+                       std::set<std::string> exported_headers,
+                       abi_util::TextFormatIR text_format,
+                       bool dump_function_declarations, bool suppress_errors)
+      : source_file_(std::move(source_file)), dump_name_(std::move(dump_name)),
+        exported_headers_(std::move(exported_headers)),
+        text_format_(text_format),
+        dump_function_declarations_(dump_function_declarations),
+        suppress_errors_(suppress_errors) {}
+};
+
+#endif  // HEADER_CHECKER_H_
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/omp_header_data.h b/vndk/tools/header-checker/header-abi-dumper/src/omp_header_data.h
deleted file mode 100644
index e95b1a5..0000000
--- a/vndk/tools/header-checker/header-abi-dumper/src/omp_header_data.h
+++ /dev/null
@@ -1,221 +0,0 @@
-#ifndef OMP_HEADER_DATA_H_
-#define OMP_HEADER_DATA_H_
-
-const char OMP_HEADER_DATA[] = R"__SOURCE__(
-/*
- * include/50/omp.h.var
- */
-
-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef __OMP_H
-#   define __OMP_H
-
-#   define KMP_VERSION_MAJOR    5
-#   define KMP_VERSION_MINOR    0
-#   define KMP_VERSION_BUILD    20140926
-#   define KMP_BUILD_DATE       "No_Timestamp"
-
-#   ifdef __cplusplus
-    extern "C" {
-#   endif
-
-#   if defined(_WIN32)
-#       define __KAI_KMPC_CONVENTION __cdecl
-#   else
-#       define __KAI_KMPC_CONVENTION
-#   endif
-
-    /* schedule kind constants */
-    typedef enum omp_sched_t {
-	omp_sched_static  = 1,
-	omp_sched_dynamic = 2,
-	omp_sched_guided  = 3,
-	omp_sched_auto    = 4
-    } omp_sched_t;
-
-    /* set API functions */
-    extern void   __KAI_KMPC_CONVENTION  omp_set_num_threads (int);
-    extern void   __KAI_KMPC_CONVENTION  omp_set_dynamic     (int);
-    extern void   __KAI_KMPC_CONVENTION  omp_set_nested      (int);
-    extern void   __KAI_KMPC_CONVENTION  omp_set_max_active_levels (int);
-    extern void   __KAI_KMPC_CONVENTION  omp_set_schedule          (omp_sched_t, int);
-
-    /* query API functions */
-    extern int    __KAI_KMPC_CONVENTION  omp_get_num_threads  (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_dynamic      (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_nested       (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_max_threads  (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_thread_num   (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_num_procs    (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_in_parallel      (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_in_final         (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_active_level        (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_level               (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_ancestor_thread_num (int);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_team_size           (int);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_thread_limit        (void);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_max_active_levels   (void);
-    extern void   __KAI_KMPC_CONVENTION  omp_get_schedule            (omp_sched_t *, int *);
-    extern int    __KAI_KMPC_CONVENTION  omp_get_max_task_priority   (void);
-
-    /* lock API functions */
-    typedef struct omp_lock_t {
-        void * _lk;
-    } omp_lock_t;
-
-    extern void   __KAI_KMPC_CONVENTION  omp_init_lock    (omp_lock_t *);
-    extern void   __KAI_KMPC_CONVENTION  omp_set_lock     (omp_lock_t *);
-    extern void   __KAI_KMPC_CONVENTION  omp_unset_lock   (omp_lock_t *);
-    extern void   __KAI_KMPC_CONVENTION  omp_destroy_lock (omp_lock_t *);
-    extern int    __KAI_KMPC_CONVENTION  omp_test_lock    (omp_lock_t *);
-
-    /* nested lock API functions */
-    typedef struct omp_nest_lock_t {
-        void * _lk;
-    } omp_nest_lock_t;
-
-    extern void   __KAI_KMPC_CONVENTION  omp_init_nest_lock    (omp_nest_lock_t *);
-    extern void   __KAI_KMPC_CONVENTION  omp_set_nest_lock     (omp_nest_lock_t *);
-    extern void   __KAI_KMPC_CONVENTION  omp_unset_nest_lock   (omp_nest_lock_t *);
-    extern void   __KAI_KMPC_CONVENTION  omp_destroy_nest_lock (omp_nest_lock_t *);
-    extern int    __KAI_KMPC_CONVENTION  omp_test_nest_lock    (omp_nest_lock_t *);
-
-    /* lock hint type for dynamic user lock */
-    typedef enum omp_lock_hint_t {
-        omp_lock_hint_none           = 0,
-        omp_lock_hint_uncontended    = 1,
-        omp_lock_hint_contended      = (1<<1 ),
-        omp_lock_hint_nonspeculative = (1<<2 ),
-        omp_lock_hint_speculative    = (1<<3 ),
-        kmp_lock_hint_hle            = (1<<16),
-        kmp_lock_hint_rtm            = (1<<17),
-        kmp_lock_hint_adaptive       = (1<<18)
-    } omp_lock_hint_t;
-
-    /* hinted lock initializers */
-    extern void __KAI_KMPC_CONVENTION omp_init_lock_with_hint(omp_lock_t *, omp_lock_hint_t);
-    extern void __KAI_KMPC_CONVENTION omp_init_nest_lock_with_hint(omp_nest_lock_t *, omp_lock_hint_t);
-
-    /* time API functions */
-    extern double __KAI_KMPC_CONVENTION  omp_get_wtime (void);
-    extern double __KAI_KMPC_CONVENTION  omp_get_wtick (void);
-
-    /* OpenMP 4.0 */
-    extern int  __KAI_KMPC_CONVENTION  omp_get_default_device (void);
-    extern void __KAI_KMPC_CONVENTION  omp_set_default_device (int);
-    extern int  __KAI_KMPC_CONVENTION  omp_is_initial_device (void);
-    extern int  __KAI_KMPC_CONVENTION  omp_get_num_devices (void);
-    extern int  __KAI_KMPC_CONVENTION  omp_get_num_teams (void);
-    extern int  __KAI_KMPC_CONVENTION  omp_get_team_num (void);
-    extern int  __KAI_KMPC_CONVENTION  omp_get_cancellation (void);
-
-#   include <stdlib.h>
-    /* OpenMP 4.5 */
-    extern int   __KAI_KMPC_CONVENTION  omp_get_initial_device (void);
-    extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);
-    extern void  __KAI_KMPC_CONVENTION  omp_target_free(void *, int);
-    extern int   __KAI_KMPC_CONVENTION  omp_target_is_present(void *, int);
-    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy(void *, void *, size_t, size_t, size_t, int, int);
-    extern int   __KAI_KMPC_CONVENTION  omp_target_memcpy_rect(void *, void *, size_t, int, const size_t *,
-                                            const size_t *, const size_t *, const size_t *, const size_t *, int, int);
-    extern int   __KAI_KMPC_CONVENTION  omp_target_associate_ptr(void *, void *, size_t, size_t, int);
-    extern int   __KAI_KMPC_CONVENTION  omp_target_disassociate_ptr(void *, int);
-
-    /* kmp API functions */
-    extern int    __KAI_KMPC_CONVENTION  kmp_get_stacksize          (void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_stacksize          (int);
-    extern size_t __KAI_KMPC_CONVENTION  kmp_get_stacksize_s        (void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_stacksize_s        (size_t);
-    extern int    __KAI_KMPC_CONVENTION  kmp_get_blocktime          (void);
-    extern int    __KAI_KMPC_CONVENTION  kmp_get_library            (void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_blocktime          (int);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_library            (int);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_library_serial     (void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_library_turnaround (void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_library_throughput (void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_defaults           (char const *);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_disp_num_buffers   (int);
-
-    /* Intel affinity API */
-    typedef void * kmp_affinity_mask_t;
-
-    extern int    __KAI_KMPC_CONVENTION  kmp_set_affinity             (kmp_affinity_mask_t *);
-    extern int    __KAI_KMPC_CONVENTION  kmp_get_affinity             (kmp_affinity_mask_t *);
-    extern int    __KAI_KMPC_CONVENTION  kmp_get_affinity_max_proc    (void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_create_affinity_mask     (kmp_affinity_mask_t *);
-    extern void   __KAI_KMPC_CONVENTION  kmp_destroy_affinity_mask    (kmp_affinity_mask_t *);
-    extern int    __KAI_KMPC_CONVENTION  kmp_set_affinity_mask_proc   (int, kmp_affinity_mask_t *);
-    extern int    __KAI_KMPC_CONVENTION  kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
-    extern int    __KAI_KMPC_CONVENTION  kmp_get_affinity_mask_proc   (int, kmp_affinity_mask_t *);
-
-    /* OpenMP 4.0 affinity API */
-    typedef enum omp_proc_bind_t {
-        omp_proc_bind_false = 0,
-        omp_proc_bind_true = 1,
-        omp_proc_bind_master = 2,
-        omp_proc_bind_close = 3,
-        omp_proc_bind_spread = 4
-    } omp_proc_bind_t;
-
-    extern omp_proc_bind_t __KAI_KMPC_CONVENTION omp_get_proc_bind (void);
-
-    /* OpenMP 4.5 affinity API */
-    extern int  __KAI_KMPC_CONVENTION omp_get_num_places (void);
-    extern int  __KAI_KMPC_CONVENTION omp_get_place_num_procs (int);
-    extern void __KAI_KMPC_CONVENTION omp_get_place_proc_ids (int, int *);
-    extern int  __KAI_KMPC_CONVENTION omp_get_place_num (void);
-    extern int  __KAI_KMPC_CONVENTION omp_get_partition_num_places (void);
-    extern void __KAI_KMPC_CONVENTION omp_get_partition_place_nums (int *);
-
-    extern void * __KAI_KMPC_CONVENTION  kmp_malloc  (size_t);
-    extern void * __KAI_KMPC_CONVENTION  kmp_aligned_malloc  (size_t, size_t);
-    extern void * __KAI_KMPC_CONVENTION  kmp_calloc  (size_t, size_t);
-    extern void * __KAI_KMPC_CONVENTION  kmp_realloc (void *, size_t);
-    extern void   __KAI_KMPC_CONVENTION  kmp_free    (void *);
-
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_warnings_on(void);
-    extern void   __KAI_KMPC_CONVENTION  kmp_set_warnings_off(void);
-
-    /* OpenMP 5.0 Tool Control */
-    typedef enum omp_control_tool_result_t {
-        omp_control_tool_notool = -2,
-        omp_control_tool_nocallback = -1,
-        omp_control_tool_success = 0,
-        omp_control_tool_ignored = 1
-    } omp_control_tool_result_t;
-
-    typedef enum omp_control_tool_t {
-        omp_control_tool_start = 1,
-        omp_control_tool_pause = 2,
-        omp_control_tool_flush = 3,
-        omp_control_tool_end = 4
-    } omp_control_tool_t;
-
-    extern int __KAI_KMPC_CONVENTION omp_control_tool(int, int, void*);
-
-#   undef __KAI_KMPC_CONVENTION
-
-    /* Warning:
-       The following typedefs are not standard, deprecated and will be removed in a future release.
-    */
-    typedef int     omp_int_t;
-    typedef double  omp_wtime_t;
-
-#   ifdef __cplusplus
-    }
-#   endif
-
-#endif /* __OMP_H */
-)__SOURCE__";
-
-#endif  // OMP_HEADER_DATA_H_
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/workaround_fortify.cpp b/vndk/tools/header-checker/header-abi-dumper/src/workaround_fortify.cpp
deleted file mode 100644
index 39495c9..0000000
--- a/vndk/tools/header-checker/header-abi-dumper/src/workaround_fortify.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2018 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "fixed_argv.h"
-
-static void DisableFortifySource(FixedArgv &fixed_argv) {
-  // FIXME: Clang FORTIFY requires a version of clang at least as new as
-  // clang-3688880 (r285906). Since external/clang is currently r275480, we need
-  // to disable FORTIFY for this tool to function correctly.
-  fixed_argv.PushForwardArgs("-U_FORTIFY_SOURCE");
-}
-
-static FixedArgvRegistry X(DisableFortifySource);
diff --git a/vndk/tools/header-checker/header-abi-dumper/src/workaround_openmp.cpp b/vndk/tools/header-checker/header-abi-dumper/src/workaround_openmp.cpp
deleted file mode 100644
index cf583ed..0000000
--- a/vndk/tools/header-checker/header-abi-dumper/src/workaround_openmp.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (C) 2018 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "fixed_argv.h"
-#include "omp_header_data.h"
-
-#include <llvm/ADT/SmallString.h>
-#include <llvm/Support/FileSystem.h>
-#include <llvm/Support/Path.h>
-
-#include <fstream>
-#include <string>
-#include <system_error>
-
-#include <stdlib.h>
-
-static std::string openmp_include_dir;
-
-static void RemoveOpenMPIncludeDir() {
-  if (openmp_include_dir.empty()) {
-    return;
-  }
-
-  // Remove the <omp.h> header file.
-  llvm::SmallString<64> path;
-  llvm::sys::path::append(path, openmp_include_dir, "omp.h");
-  llvm::sys::fs::remove(llvm::Twine(path));
-
-  // Remove the directory.
-  llvm::sys::fs::remove(llvm::Twine(openmp_include_dir));
-}
-
-static std::error_code WriteFile(const char *path, const char *data,
-                                 size_t size) {
-  std::fstream output(path, std::ios_base::out | std::ios_base::trunc);
-  if (!output) {
-    return std::make_error_code(std::io_errc::stream);
-  }
-
-  output.write(data, size);
-  if (!output) {
-    return std::make_error_code(std::io_errc::stream);
-  }
-
-  return std::error_code();
-}
-
-static std::error_code CreateOpenMPIncludeDir() {
-  llvm::SmallString<64> path;
-
-  // Create a temporary directory for include fixes.
-  std::error_code error_code =
-      llvm::sys::fs::createUniqueDirectory("header-abi-dump-include", path);
-  if (error_code) {
-    return error_code;
-  }
-
-  openmp_include_dir = path.str();
-
-  // Register a directory cleanup callback.
-  ::atexit(RemoveOpenMPIncludeDir);
-
-  // Create <omp.h> and write the content.
-  llvm::sys::path::append(path, "omp.h");
-  return WriteFile(path.c_str(), OMP_HEADER_DATA, sizeof(OMP_HEADER_DATA) - 1);
-}
-
-static void SetupOpenMPIncludeDir(FixedArgv &fixed_argv) {
-  // FIXME: clang-3289846 does not have <omp.h>.  This workaround copies omp.h
-  // from LLVM 5.0+ and adds `-isystem` to header search paths.
-  if (fixed_argv.IsLastArgEqualFirstOption("-fopenmp", "-fno-openmp")) {
-    std::error_code ec = CreateOpenMPIncludeDir();
-    if (!ec) {
-      fixed_argv.PushForwardArgs("-isystem", openmp_include_dir.c_str());
-    }
-  }
-}
-
-static FixedArgvRegistry X(SetupOpenMPIncludeDir);
diff --git a/vndk/tools/header-checker/header-abi-linker/src/header_abi_linker.cpp b/vndk/tools/header-checker/header-abi-linker/src/header_abi_linker.cpp
index b57f6d3..3da1ac1 100644
--- a/vndk/tools/header-checker/header-abi-linker/src/header_abi_linker.cpp
+++ b/vndk/tools/header-checker/header-abi-linker/src/header_abi_linker.cpp
@@ -12,16 +12,19 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <header_abi_util.h>
-#include <ir_representation.h>
+#include "header_abi_util.h"
+#include "ir_representation.h"
+#include "so_file_parser.h"
+#include "version_script_parser.h"
 
 #include <llvm/Support/CommandLine.h>
 #include <llvm/Support/raw_ostream.h>
 
+#include <fstream>
+#include <functional>
+#include <iostream>
 #include <memory>
 #include <mutex>
-#include <fstream>
-#include <iostream>
 #include <string>
 #include <thread>
 #include <vector>
@@ -49,8 +52,17 @@
     "v", llvm::cl::desc("<version_script>"), llvm::cl::Optional,
     llvm::cl::cat(header_linker_category));
 
+static llvm::cl::list<std::string> excluded_symbol_versions(
+    "exclude-symbol-version", llvm::cl::Optional,
+    llvm::cl::cat(header_linker_category));
+
+static llvm::cl::list<std::string> excluded_symbol_tags(
+    "exclude-symbol-tag", llvm::cl::Optional,
+    llvm::cl::cat(header_linker_category));
+
 static llvm::cl::opt<std::string> api(
     "api", llvm::cl::desc("<api>"), llvm::cl::Optional,
+    llvm::cl::init("current"),
     llvm::cl::cat(header_linker_category));
 
 static llvm::cl::opt<std::string> arch(
@@ -65,12 +77,20 @@
     "so", llvm::cl::desc("<path to so file>"), llvm::cl::Optional,
     llvm::cl::cat(header_linker_category));
 
-static llvm::cl::opt<abi_util::TextFormatIR> text_format(
-    "text-format", llvm::cl::desc("Specify text format of abi dumps"),
+static llvm::cl::opt<abi_util::TextFormatIR> input_format(
+    "input-format", llvm::cl::desc("Specify format of input dump files"),
     llvm::cl::values(clEnumValN(abi_util::TextFormatIR::ProtobufTextFormat,
                                 "ProtobufTextFormat", "ProtobufTextFormat"),
-                     clEnumValEnd),
-    llvm::cl::init(abi_util::TextFormatIR::ProtobufTextFormat),
+                     clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON")),
+    llvm::cl::init(abi_util::TextFormatIR::Json),
+    llvm::cl::cat(header_linker_category));
+
+static llvm::cl::opt<abi_util::TextFormatIR> output_format(
+    "output-format", llvm::cl::desc("Specify format of output dump file"),
+    llvm::cl::values(clEnumValN(abi_util::TextFormatIR::ProtobufTextFormat,
+                                "ProtobufTextFormat", "ProtobufTextFormat"),
+                     clEnumValN(abi_util::TextFormatIR::Json, "Json", "JSON")),
+    llvm::cl::init(abi_util::TextFormatIR::Json),
     llvm::cl::cat(header_linker_category));
 
 class HeaderAbiLinker {
@@ -82,25 +102,30 @@
       const std::string &so_file,
       const std::string &linked_dump,
       const std::string &arch,
-      const std::string &api)
-    : dump_files_(dump_files), exported_header_dirs_(exported_header_dirs),
-    version_script_(version_script), so_file_(so_file),
-    out_dump_name_(linked_dump), arch_(arch), api_(api) {};
+      const std::string &api,
+      const std::vector<std::string> &excluded_symbol_versions,
+      const std::vector<std::string> &excluded_symbol_tags)
+      : dump_files_(dump_files), exported_header_dirs_(exported_header_dirs),
+        version_script_(version_script), so_file_(so_file),
+        out_dump_name_(linked_dump), arch_(arch), api_(api),
+        excluded_symbol_versions_(excluded_symbol_versions),
+        excluded_symbol_tags_(excluded_symbol_tags) {}
 
   bool LinkAndDump();
 
  private:
   template <typename T>
   bool LinkDecl(abi_util::IRDumper *dst,
-                       std::set<std::string> *link_set,
-                       std::set<std::string> *regex_matched_link_set,
-                       const std::regex *vs_regex,
-                       const abi_util::AbiElementMap<T> &src,
-                       bool use_version_script);
+                const abi_util::AbiElementMap<T> &src,
+                const std::function<bool(const std::string &)> &symbol_filter);
 
-  bool ParseVersionScriptFiles();
+  std::unique_ptr<abi_util::TextFormatToIRReader> ReadInputDumpFiles();
 
-  bool ParseSoFile();
+  bool ReadExportedSymbols();
+
+  bool ReadExportedSymbolsFromVersionScript();
+
+  bool ReadExportedSymbolsFromSharedObjectFile();
 
   bool LinkTypes(const abi_util::TextFormatToIRReader *ir_reader,
                  abi_util::IRDumper *ir_dumper);
@@ -111,8 +136,19 @@
   bool LinkGlobalVars(const abi_util::TextFormatToIRReader *ir_reader,
                       abi_util::IRDumper *ir_dumper);
 
-  bool AddElfSymbols(abi_util::IRDumper *ir_dumper);
+  bool LinkExportedSymbols(abi_util::IRDumper *ir_dumper);
 
+  bool LinkExportedSymbols(abi_util::IRDumper *ir_dumper,
+                           const abi_util::ExportedSymbolSet &exported_symbols);
+
+  template <typename SymbolMap>
+  bool LinkExportedSymbols(abi_util::IRDumper *ir_dumper,
+                           const SymbolMap &symbols);
+
+  // Check whether a symbol name is considered as exported.  If both
+  // `shared_object_symbols_` and `version_script_symbols_` exists, the symbol
+  // name must pass the `HasSymbol()` test in both cases.
+  bool IsSymbolExported(const std::string &name) const;
 
  private:
   const std::vector<std::string> &dump_files_;
@@ -122,38 +158,16 @@
   const std::string &out_dump_name_;
   const std::string &arch_;
   const std::string &api_;
-  // TODO: Add to a map of std::sets instead.
+  const std::vector<std::string> &excluded_symbol_versions_;
+  const std::vector<std::string> &excluded_symbol_tags_;
+
   std::set<std::string> exported_headers_;
-  std::set<std::string> types_set_;
-  std::set<std::string> function_decl_set_;
-  std::set<std::string> globvar_decl_set_;
-  // Version Script Regex Matching.
-  std::set<std::string> functions_regex_matched_set;
-  std::regex functions_vs_regex_;
-  // Version Script Regex Matching.
-  std::set<std::string> globvars_regex_matched_set;
-  std::regex globvars_vs_regex_;
+
+  // Exported symbols
+  std::unique_ptr<abi_util::ExportedSymbolSet> shared_object_symbols_;
+  std::unique_ptr<abi_util::ExportedSymbolSet> version_script_symbols_;
 };
 
-template <typename T, typename Iterable>
-static bool AddElfSymbols(abi_util::IRDumper *dst, const Iterable &symbols) {
-  for (auto &&symbol : symbols) {
-    T elf_symbol(symbol);
-    if (!dst->AddElfSymbolMessageIR(&elf_symbol)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-// To be called right after parsing the .so file / version script.
-bool HeaderAbiLinker::AddElfSymbols(abi_util::IRDumper *ir_dumper) {
-  return ::AddElfSymbols<abi_util::ElfFunctionIR>(ir_dumper,
-                                                  function_decl_set_) &&
-      ::AddElfSymbols<abi_util::ElfObjectIR>(ir_dumper,
-                                             globvar_decl_set_);
-}
-
 static void DeDuplicateAbiElementsThread(
     const std::vector<std::string> &dump_files,
     const std::set<std::string> *exported_headers,
@@ -161,7 +175,8 @@
     std::atomic<std::size_t> *cnt) {
   std::unique_ptr<abi_util::TextFormatToIRReader> local_reader =
       abi_util::TextFormatToIRReader::CreateTextFormatToIRReader(
-          text_format, exported_headers);
+          input_format, exported_headers);
+
   auto begin_it = dump_files.begin();
   std::size_t num_sources = dump_files.size();
   while (1) {
@@ -173,7 +188,7 @@
     for (auto it = begin_it; it != begin_it + end; it++) {
       std::unique_ptr<abi_util::TextFormatToIRReader> reader =
           abi_util::TextFormatToIRReader::CreateTextFormatToIRReader(
-              text_format, exported_headers);
+              input_format, exported_headers);
       assert(reader != nullptr);
       if (!reader->ReadDump(*it)) {
         llvm::errs() << "ReadDump failed\n";
@@ -183,36 +198,20 @@
       local_reader->MergeGraphs(*reader);
     }
   }
+
   std::lock_guard<std::mutex> lock(*greader_lock);
   greader->MergeGraphs(*local_reader);
 }
 
-bool HeaderAbiLinker::LinkAndDump() {
-  // If the user specifies that a version script should be used, use that.
-  if (!so_file_.empty()) {
-    exported_headers_ =
-        abi_util::CollectAllExportedHeaders(exported_header_dirs_);
-    if (!ParseSoFile()) {
-      llvm::errs() << "Couldn't parse so file\n";
-      return false;
-    }
-  } else if (!ParseVersionScriptFiles()) {
-    llvm::errs() << "Failed to parse stub files for exported symbols\n";
-    return false;
-  }
-  std::unique_ptr<abi_util::IRDumper> ir_dumper =
-      abi_util::IRDumper::CreateIRDumper(text_format, out_dump_name_);
-  assert(ir_dumper != nullptr);
-  AddElfSymbols(ir_dumper.get());
-  // Create a reader, on which we never actually call ReadDump(), since multiple
-  // dump files are associated with it.
+std::unique_ptr<abi_util::TextFormatToIRReader>
+HeaderAbiLinker::ReadInputDumpFiles() {
   std::unique_ptr<abi_util::TextFormatToIRReader> greader =
       abi_util::TextFormatToIRReader::CreateTextFormatToIRReader(
-          text_format, &exported_headers_);
+          input_format, &exported_headers_);
+
   std::size_t max_threads = std::thread::hardware_concurrency();
   std::size_t num_threads = kSourcesPerBatchThread < dump_files_.size() ?
-                    std::min(dump_files_.size() / kSourcesPerBatchThread,
-                             max_threads) : 0;
+      std::min(dump_files_.size() / kSourcesPerBatchThread, max_threads) : 0;
   std::vector<std::thread> threads;
   std::atomic<std::size_t> cnt(0);
   std::mutex greader_lock;
@@ -227,82 +226,64 @@
     thread.join();
   }
 
+  return greader;
+}
+
+bool HeaderAbiLinker::LinkAndDump() {
+  // Extract exported functions and variables from a shared lib or a version
+  // script.
+  if (!ReadExportedSymbols()) {
+    return false;
+  }
+
+  // Construct the list of exported headers for source location filtering.
+  exported_headers_ =
+      abi_util::CollectAllExportedHeaders(exported_header_dirs_);
+
+  // Read all input ABI dumps.
+  auto greader = ReadInputDumpFiles();
+
+  // Link input ABI dumps.
+  std::unique_ptr<abi_util::IRDumper> ir_dumper =
+      abi_util::IRDumper::CreateIRDumper(output_format, out_dump_name_);
+  assert(ir_dumper != nullptr);
+
+  if (!LinkExportedSymbols(ir_dumper.get())) {
+    return false;
+  }
+
   if (!LinkTypes(greader.get(), ir_dumper.get()) ||
       !LinkFunctions(greader.get(), ir_dumper.get()) ||
       !LinkGlobalVars(greader.get(), ir_dumper.get())) {
     llvm::errs() << "Failed to link elements\n";
     return false;
   }
+
   if (!ir_dumper->Dump()) {
-    llvm::errs() << "Serialization to ostream failed\n";
+    llvm::errs() << "Failed to serialize the linked output to ostream\n";
     return false;
   }
+
   return true;
 }
 
-static bool QueryRegexMatches(std::set<std::string> *regex_matched_link_set,
-                              const std::regex *vs_regex,
-                              const std::string &symbol) {
-  assert(regex_matched_link_set != nullptr);
-  assert(vs_regex != nullptr);
-  if (regex_matched_link_set->find(symbol) != regex_matched_link_set->end()) {
-    return false;
-  }
-  if (std::regex_search(symbol, *vs_regex)) {
-    regex_matched_link_set->insert(symbol);
-    return true;
-  }
-  return false;
-}
-
-static std::regex CreateRegexMatchExprFromSet(
-    const std::set<std::string> &link_set) {
-  std::string all_regex_match_str = "";
-  std::set<std::string>::iterator it = link_set.begin();
-  while (it != link_set.end()) {
-    std::string regex_match_str_find_glob =
-      abi_util::FindAndReplace(*it, "\\*", ".*");
-    all_regex_match_str += "(\\b" + regex_match_str_find_glob + "\\b)";
-    if (++it != link_set.end()) {
-      all_regex_match_str += "|";
-    }
-  }
-  if (all_regex_match_str == "") {
-    return std::regex();
-  }
-  return std::regex(all_regex_match_str);
-}
-
 template <typename T>
 bool HeaderAbiLinker::LinkDecl(
-    abi_util::IRDumper *dst, std::set<std::string> *link_set,
-    std::set<std::string> *regex_matched_link_set, const std::regex *vs_regex,
-    const  abi_util::AbiElementMap<T> &src, bool use_version_script_or_so) {
+    abi_util::IRDumper *dst, const abi_util::AbiElementMap<T> &src,
+    const std::function<bool(const std::string &)> &symbol_filter) {
   assert(dst != nullptr);
-  assert(link_set != nullptr);
   for (auto &&element : src) {
     // If we are not using a version script and exported headers are available,
     // filter out unexported abi.
     std::string source_file = element.second.GetSourceFile();
     // Builtin types will not have source file information.
     if (!exported_headers_.empty() && !source_file.empty() &&
-        exported_headers_.find(source_file) ==
-        exported_headers_.end()) {
+        exported_headers_.find(source_file) == exported_headers_.end()) {
       continue;
     }
-    const std::string &element_str = element.first;
-    // Check for the existence of the element in linked dump / symbol file.
-    if (use_version_script_or_so) {
-      std::set<std::string>::iterator it =
-          link_set->find(element_str);
-      if (it == link_set->end()) {
-        if (!QueryRegexMatches(regex_matched_link_set, vs_regex, element_str)) {
-          continue;
-        }
-      } else {
-        // We get a pre-filled link name set while using version script.
-        link_set->erase(*it); // Avoid multiple instances of the same symbol.
-      }
+    // Check for the existence of the element in version script / symbol file.
+    if (!symbol_filter(element.first)) {
+      continue;
     }
     if (!dst->AddLinkableMessageIR(&(element.second))) {
       llvm::errs() << "Failed to add element to linked dump\n";
@@ -315,110 +296,190 @@
 bool HeaderAbiLinker::LinkTypes(const abi_util::TextFormatToIRReader *reader,
                                 abi_util::IRDumper *ir_dumper) {
   assert(reader != nullptr);
-  assert(ir_dumper != nullptr);
-  // Even if version scripts are available we take in types, since the symbols
-  // in the version script might reference a type exposed by the library.
-  return LinkDecl(ir_dumper, &types_set_, nullptr,
-                  nullptr, reader->GetRecordTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr,
-               nullptr, reader->GetEnumTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr, nullptr,
-               reader->GetFunctionTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr,
-               nullptr, reader->GetBuiltinTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr,
-               nullptr, reader->GetPointerTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr,
-               nullptr, reader->GetRvalueReferenceTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr,
-               nullptr, reader->GetLvalueReferenceTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr,
-               nullptr, reader->GetArrayTypes(), false) &&
-      LinkDecl(ir_dumper, &types_set_, nullptr,
-               nullptr, reader->GetQualifiedTypes(), false);
+  auto no_filter = [](const std::string &symbol) { return true; };
+  return LinkDecl(ir_dumper, reader->GetRecordTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetEnumTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetFunctionTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetBuiltinTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetPointerTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetRvalueReferenceTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetLvalueReferenceTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetArrayTypes(), no_filter) &&
+         LinkDecl(ir_dumper, reader->GetQualifiedTypes(), no_filter);
+}
+
+bool HeaderAbiLinker::IsSymbolExported(const std::string &name) const {
+  if (shared_object_symbols_ && !shared_object_symbols_->HasSymbol(name)) {
+    return false;
+  }
+  if (version_script_symbols_ && !version_script_symbols_->HasSymbol(name)) {
+    return false;
+  }
+  return true;
 }
 
 bool HeaderAbiLinker::LinkFunctions(
     const abi_util::TextFormatToIRReader *reader,
     abi_util::IRDumper *ir_dumper) {
-
   assert(reader != nullptr);
-  return LinkDecl(ir_dumper, &function_decl_set_,
-                  &functions_regex_matched_set, &functions_vs_regex_,
-                  reader->GetFunctions(),
-                  (!version_script_.empty() || !so_file_.empty()));
+  auto symbol_filter = [this](const std::string &linker_set_key) {
+    return IsSymbolExported(linker_set_key);
+  };
+  return LinkDecl(ir_dumper, reader->GetFunctions(), symbol_filter);
 }
 
 bool HeaderAbiLinker::LinkGlobalVars(
     const abi_util::TextFormatToIRReader *reader,
     abi_util::IRDumper *ir_dumper) {
-
   assert(reader != nullptr);
-  return LinkDecl(ir_dumper, &globvar_decl_set_,
-                  &globvars_regex_matched_set, &globvars_vs_regex_,
-                  reader->GetGlobalVariables(),
-                  (!version_script.empty() || !so_file_.empty()));
+  auto symbol_filter = [this](const std::string &linker_set_key) {
+    return IsSymbolExported(linker_set_key);
+  };
+  return LinkDecl(ir_dumper, reader->GetGlobalVariables(), symbol_filter);
 }
 
-bool HeaderAbiLinker::ParseVersionScriptFiles() {
-  abi_util::VersionScriptParser version_script_parser(version_script_, arch_,
-                                                      api_);
-  if (!version_script_parser.Parse()) {
-    llvm::errs() << "Failed to parse version script\n";
-    return false;
+template <typename SymbolMap>
+bool HeaderAbiLinker::LinkExportedSymbols(abi_util::IRDumper *dst,
+                                          const SymbolMap &symbols) {
+  for (auto &&symbol : symbols) {
+    if (!IsSymbolExported(symbol.first)) {
+      continue;
+    }
+    if (!dst->AddElfSymbolMessageIR(&(symbol.second))) {
+      return false;
+    }
   }
-  function_decl_set_ = version_script_parser.GetFunctions();
-  globvar_decl_set_ = version_script_parser.GetGlobVars();
-  std::set<std::string> function_regexs =
-      version_script_parser.GetFunctionRegexs();
-  std::set<std::string> globvar_regexs =
-      version_script_parser.GetGlobVarRegexs();
-  functions_vs_regex_ = CreateRegexMatchExprFromSet(function_regexs);
-  globvars_vs_regex_ = CreateRegexMatchExprFromSet(globvar_regexs);
   return true;
 }
 
-bool HeaderAbiLinker::ParseSoFile() {
- auto Binary = llvm::object::createBinary(so_file_);
+bool HeaderAbiLinker::LinkExportedSymbols(
+    abi_util::IRDumper *ir_dumper,
+    const abi_util::ExportedSymbolSet &exported_symbols) {
+  return (LinkExportedSymbols(ir_dumper, exported_symbols.GetFunctions()) &&
+          LinkExportedSymbols(ir_dumper, exported_symbols.GetVars()));
+}
 
-  if (!Binary) {
-    llvm::errs() << "Couldn't really create object File \n";
-    return false;
+bool HeaderAbiLinker::LinkExportedSymbols(abi_util::IRDumper *ir_dumper) {
+  if (shared_object_symbols_) {
+    return LinkExportedSymbols(ir_dumper, *shared_object_symbols_);
   }
-  llvm::object::ObjectFile *objfile =
-      llvm::dyn_cast<llvm::object::ObjectFile>(&(*Binary.get().getBinary()));
-  if (!objfile) {
-    llvm::errs() << "Not an object file\n";
+
+  if (version_script_symbols_) {
+    return LinkExportedSymbols(ir_dumper, *version_script_symbols_);
+  }
+
+  return false;
+}
+
+bool HeaderAbiLinker::ReadExportedSymbols() {
+  if (so_file_.empty() && version_script_.empty()) {
+    llvm::errs() << "Either shared lib or version script must be specified.\n";
     return false;
   }
 
+  if (!so_file_.empty()) {
+    if (!ReadExportedSymbolsFromSharedObjectFile()) {
+      llvm::errs() << "Failed to parse the shared library (.so file): "
+                   << so_file_ << "\n";
+      return false;
+    }
+  }
+
+  if (!version_script_.empty()) {
+    if (!ReadExportedSymbolsFromVersionScript()) {
+      llvm::errs() << "Failed to parse the version script: " << version_script_
+                   << "\n";
+      return false;
+    }
+  }
+
+  return true;
+}
+
+bool HeaderAbiLinker::ReadExportedSymbolsFromVersionScript() {
+  std::optional<abi_util::ApiLevel> api_level = abi_util::ParseApiLevel(api_);
+  if (!api_level) {
+    llvm::errs() << "-api must be either \"current\" or an integer (e.g. 21)\n";
+    return false;
+  }
+
+  std::ifstream stream(version_script_, std::ios_base::in);
+  if (!stream) {
+    llvm::errs() << "Failed to open version script file\n";
+    return false;
+  }
+
+  abi_util::VersionScriptParser parser;
+  parser.SetArch(arch_);
+  parser.SetApiLevel(api_level.value());
+  for (auto &&version : excluded_symbol_versions_) {
+    parser.AddExcludedSymbolVersion(version);
+  }
+  for (auto &&tag : excluded_symbol_tags_) {
+    parser.AddExcludedSymbolTag(tag);
+  }
+
+  version_script_symbols_ = parser.Parse(stream);
+  if (!version_script_symbols_) {
+    llvm::errs() << "Failed to parse version script file\n";
+    return false;
+  }
+
+  return true;
+}
+
+bool HeaderAbiLinker::ReadExportedSymbolsFromSharedObjectFile() {
   std::unique_ptr<abi_util::SoFileParser> so_parser =
-      abi_util::SoFileParser::Create(objfile);
-  if (so_parser == nullptr) {
-    llvm::errs() << "Couldn't create soFile Parser\n";
+      abi_util::SoFileParser::Create(so_file_);
+  if (!so_parser) {
     return false;
   }
-  so_parser->GetSymbols();
-  function_decl_set_ = so_parser->GetFunctions();
-  globvar_decl_set_ = so_parser->GetGlobVars();
+
+  shared_object_symbols_ = so_parser->Parse();
+  if (!shared_object_symbols_) {
+    llvm::errs() << "Failed to parse shared object file\n";
+    return false;
+  }
+
   return true;
 }
 
+// Hide irrelevant command line options defined in LLVM libraries.
+static void HideIrrelevantCommandLineOptions() {
+  llvm::StringMap<llvm::cl::Option *> &map = llvm::cl::getRegisteredOptions();
+  for (llvm::StringMapEntry<llvm::cl::Option *> &p : map) {
+    if (p.second->Category == &header_linker_category) {
+      continue;
+    }
+    if (p.first().startswith("help")) {
+      continue;
+    }
+    p.second->setHiddenFlag(llvm::cl::Hidden);
+  }
+}
+
 int main(int argc, const char **argv) {
+  HideIrrelevantCommandLineOptions();
   llvm::cl::ParseCommandLineOptions(argc, argv, "header-linker");
+
   if (so_file.empty() && version_script.empty()) {
     llvm::errs() << "One of -so or -v needs to be specified\n";
     return -1;
   }
+
   if (no_filter) {
     static_cast<std::vector<std::string> &>(exported_header_dirs).clear();
   }
+
   HeaderAbiLinker Linker(dump_files, exported_header_dirs, version_script,
-                         so_file, linked_dump, arch, api);
+                         so_file, linked_dump, arch, api,
+                         excluded_symbol_versions,
+                         excluded_symbol_tags);
 
   if (!Linker.LinkAndDump()) {
     llvm::errs() << "Failed to link and dump elements\n";
     return -1;
   }
+
   return 0;
 }
diff --git a/vndk/tools/header-checker/header-abi-util/include/abi_diff_helpers.h b/vndk/tools/header-checker/header-abi-util/include/abi_diff_helpers.h
index 6403332..3fda326 100644
--- a/vndk/tools/header-checker/header-abi-util/include/abi_diff_helpers.h
+++ b/vndk/tools/header-checker/header-abi-util/include/abi_diff_helpers.h
@@ -1,7 +1,21 @@
-#ifndef ABI_DIFF_HELPERS
-#define ABI_DIFF_HELPERS
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
-#include <ir_representation.h>
+#ifndef ABI_DIFF_HELPERS_H_
+#define ABI_DIFF_HELPERS_H_
+
+#include "ir_representation.h"
 
 #include <deque>
 
@@ -19,15 +33,17 @@
   // There was a diff found, however it need not be added as a part of a diff
   // message, since it would have already been noted elsewhere.
   indirect_diff = 2,
+
+  opaque_diff = 3,
 };
 
-static inline DiffStatus operator| (DiffStatus f,DiffStatus s) {
+static inline DiffStatus operator|(DiffStatus f,DiffStatus s) {
   return static_cast<DiffStatus>(
       static_cast<std::underlying_type<DiffStatus>::type>(f) |
       static_cast<std::underlying_type<DiffStatus>::type>(s));
 }
 
-static inline DiffStatus operator& (DiffStatus f, DiffStatus s) {
+static inline DiffStatus operator&(DiffStatus f, DiffStatus s) {
   return static_cast<DiffStatus>(
       static_cast<std::underlying_type<DiffStatus>::type>(f) &
       static_cast<std::underlying_type<DiffStatus>::type>(s));
@@ -46,17 +62,26 @@
 
 std::string Unwind(const std::deque<std::string> *type_queue);
 
+struct DiffPolicyOptions {
+  DiffPolicyOptions(bool consider_opaque_types_different)
+      : consider_opaque_types_different_(consider_opaque_types_different) {}
+
+  bool consider_opaque_types_different_;
+};
+
 class AbiDiffHelper {
  public:
   AbiDiffHelper(
       const AbiElementMap<const abi_util::TypeIR *> &old_types,
       const AbiElementMap<const abi_util::TypeIR *> &new_types,
+      const DiffPolicyOptions &diff_policy_options,
       std::set<std::string> *type_cache,
       abi_util::IRDiffDumper *ir_diff_dumper = nullptr,
       AbiElementMap<MergeStatus> *local_to_global_type_id_map = nullptr)
       : old_types_(old_types), new_types_(new_types),
-        type_cache_(type_cache), ir_diff_dumper_(ir_diff_dumper),
-        local_to_global_type_id_map_(local_to_global_type_id_map) { }
+        diff_policy_options_(diff_policy_options), type_cache_(type_cache),
+        ir_diff_dumper_(ir_diff_dumper),
+        local_to_global_type_id_map_(local_to_global_type_id_map) {}
 
   DiffStatus CompareAndDumpTypeDiff(
       const std::string &old_type_str, const std::string &new_type_str,
@@ -100,10 +125,11 @@
 
   DiffStatus CompareBuiltinTypes(const abi_util::BuiltinTypeIR *old_type,
                                  const abi_util::BuiltinTypeIR *new_type);
+
   static void CompareEnumFields(
-    const std::vector<abi_util::EnumFieldIR> &old_fields,
-    const std::vector<abi_util::EnumFieldIR> &new_fields,
-    abi_util::EnumTypeDiffIR *enum_type_diff_ir);
+      const std::vector<abi_util::EnumFieldIR> &old_fields,
+      const std::vector<abi_util::EnumFieldIR> &new_fields,
+      abi_util::EnumTypeDiffIR *enum_type_diff_ir);
 
   DiffStatus CompareEnumTypes(const abi_util::EnumTypeIR *old_type,
                               const abi_util::EnumTypeIR *new_type,
@@ -116,7 +142,7 @@
                                   abi_util::DiffMessageIR::DiffKind diff_kind);
 
   void ReplaceRemovedFieldTypeIdsWithTypeNames(
-    std::vector<abi_util::RecordFieldIR *> *removed_fields);
+      std::vector<abi_util::RecordFieldIR *> *removed_fields);
 
   void ReplaceDiffedFieldTypeIdsWithTypeNames(
       abi_util::RecordFieldDiffIR *diffed_field);
@@ -127,10 +153,10 @@
 
   DiffStatusPair<std::unique_ptr<abi_util::RecordFieldDiffIR>>
   CompareCommonRecordFields(
-    const abi_util::RecordFieldIR *old_field,
-    const abi_util::RecordFieldIR *new_field,
-    std::deque<std::string> *type_queue,
-    abi_util::IRDiffDumper::DiffKind diff_kind);
+      const abi_util::RecordFieldIR *old_field,
+      const abi_util::RecordFieldIR *new_field,
+      std::deque<std::string> *type_queue,
+      abi_util::IRDiffDumper::DiffKind diff_kind);
 
   GenericFieldDiffInfo<abi_util::RecordFieldIR, abi_util::RecordFieldDiffIR>
       CompareRecordFields(
@@ -172,16 +198,19 @@
   bool AddToDiff(DiffType *mutable_diff, const DiffElement *oldp,
                  const DiffElement *newp,
                  std::deque<std::string> *type_queue = nullptr);
+
  protected:
   const AbiElementMap<const abi_util::TypeIR *> &old_types_;
   const AbiElementMap<const abi_util::TypeIR *> &new_types_;
-  std::set<std::string> *type_cache_ = nullptr;
-  abi_util::IRDiffDumper *ir_diff_dumper_ = nullptr;
-  AbiElementMap<MergeStatus> *local_to_global_type_id_map_ = nullptr;
+  const DiffPolicyOptions &diff_policy_options_;
+  std::set<std::string> *type_cache_;
+  abi_util::IRDiffDumper *ir_diff_dumper_;
+  AbiElementMap<MergeStatus> *local_to_global_type_id_map_;
 };
 
 void ReplaceTypeIdsWithTypeNames(
     const AbiElementMap<const TypeIR *> &type_graph, LinkableMessageIR *lm);
 
-} // namespace abi_util
-#endif
+}  // namespace abi_util
+
+#endif  // ABI_DIFF_HELPERS_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/api_level.h b/vndk/tools/header-checker/header-abi-util/include/api_level.h
new file mode 100644
index 0000000..11bcb66
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/include/api_level.h
@@ -0,0 +1,37 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef API_LEVEL_H_
+#define API_LEVEL_H_
+
+#include <optional>
+#include <string>
+
+
+namespace abi_util {
+
+
+using ApiLevel = int;
+
+
+constexpr ApiLevel FUTURE_API_LEVEL = 10000;
+
+
+std::optional<ApiLevel> ParseApiLevel(const std::string &api);
+
+
+}  // namespace abi_util
+
+
+#endif  // API_LEVEL_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/exported_symbol_set.h b/vndk/tools/header-checker/header-abi-util/include/exported_symbol_set.h
new file mode 100644
index 0000000..886cb54
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/include/exported_symbol_set.h
@@ -0,0 +1,100 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef EXPORTED_SYMBOL_SET_
+#define EXPORTED_SYMBOL_SET_
+
+#include "ir_representation.h"
+
+#include <functional>
+#include <map>
+#include <set>
+#include <string>
+
+
+namespace abi_util {
+
+
+class ExportedSymbolSet {
+ public:
+  using FunctionMap = std::map<std::string, ElfFunctionIR, std::less<>>;
+  using VarMap = std::map<std::string, ElfObjectIR, std::less<>>;
+  using NameSet = std::set<std::string, std::less<>>;
+  using GlobPatternSet = std::set<std::string, std::less<>>;
+
+
+ public:
+  ExportedSymbolSet() {}
+
+  const FunctionMap &GetFunctions() const {
+    return funcs_;
+  }
+
+  const VarMap &GetVars() const {
+    return vars_;
+  }
+
+  const GlobPatternSet &GetGlobPatterns() const {
+    return glob_patterns_;
+  }
+
+  const GlobPatternSet &GetDemangledCppGlobPatterns() const {
+    return demangled_cpp_glob_patterns_;
+  }
+
+  const NameSet &GetDemangledCppSymbols() const {
+    return demangled_cpp_symbols_;
+  }
+
+  bool HasSymbol(const std::string &symbol_name) const;
+
+  void AddFunction(const std::string &name,
+                   ElfSymbolIR::ElfSymbolBinding binding);
+
+  void AddVar(const std::string &name, ElfSymbolIR::ElfSymbolBinding binding);
+
+  void AddGlobPattern(const std::string &pattern) {
+    glob_patterns_.insert(pattern);
+  }
+
+  void AddDemangledCppGlobPattern(const std::string &pattern) {
+    demangled_cpp_glob_patterns_.insert(pattern);
+  }
+
+  void AddDemangledCppSymbol(const std::string &pattern) {
+    demangled_cpp_symbols_.insert(pattern);
+  }
+
+
+ private:
+  bool HasDemangledCppSymbolsOrPatterns() const {
+    return (!demangled_cpp_glob_patterns_.empty() ||
+            !demangled_cpp_symbols_.empty());
+  }
+
+
+ private:
+  FunctionMap funcs_;
+  VarMap vars_;
+
+  GlobPatternSet glob_patterns_;
+  GlobPatternSet demangled_cpp_glob_patterns_;
+  NameSet demangled_cpp_symbols_;
+};
+
+
+}  // namespace abi_util
+
+
+#endif  // EXPORTED_SYMBOL_SET_
diff --git a/vndk/tools/header-checker/header-abi-util/include/header_abi_util.h b/vndk/tools/header-checker/header-abi-util/include/header_abi_util.h
index aa5602f..aa55dad 100644
--- a/vndk/tools/header-checker/header-abi-util/include/header_abi_util.h
+++ b/vndk/tools/header-checker/header-abi-util/include/header_abi_util.h
@@ -12,11 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <llvm/Object/ELFObjectFile.h>
-#include <llvm/Object/ELFTypes.h>
-#include <llvm/Object/SymbolSize.h>
-#include <llvm/Support/Endian.h>
-#include <llvm/Support/raw_ostream.h>
+#ifndef HEADER_ABI_UTIL_H_
+#define HEADER_ABI_UTIL_H_
+
+#include "ir_representation.h"
 
 #include <map>
 #include <regex>
@@ -24,12 +23,6 @@
 #include <string>
 #include <vector>
 
-using llvm::object::ObjectFile;
-using llvm::object::ELFObjectFile;
-using llvm::object::ELFFile;
-using llvm::object::ELFType;
-using llvm::object::ELFDataTypeTypedefHelper;
-
 namespace abi_util {
 
 std::string RealPath(const std::string &path);
@@ -37,58 +30,6 @@
 std::set<std::string> CollectAllExportedHeaders(
     const std::vector<std::string> &exported_header_dirs);
 
-class VersionScriptParser {
- public:
-
-  enum LineScope {
-    global,
-    local,
-  };
-
-  VersionScriptParser(const std::string &version_script,
-                      const std::string &arch,
-                      const std::string &api);
-  bool Parse();
-
-  const std::set<std::string> &GetFunctions();
-
-  const std::set<std::string> &GetGlobVars();
-
-  const std::set<std::string> &GetFunctionRegexs();
-
-  const std::set<std::string> &GetGlobVarRegexs();
-
- private:
-
-  bool ParseInnerBlock(std::ifstream &symbol_ifstream);
-
-  LineScope GetLineScope(std::string &line, LineScope scope);
-
-  bool ParseSymbolLine(const std::string &line);
-
-  bool SymbolInArchAndApiVersion(const std::string &line,
-                                 const std::string &arch, int api);
-
-  bool SymbolExported(const std::string &line, const std::string &arch,
-                      int api);
-
-  int ApiStrToInt(const std::string &api);
-
-  void AddToVars(std::string &symbol);
-
-  void AddToFunctions(std::string &symbol);
-
- private:
-  const std::string &version_script_;
-  const std::string &arch_;
-  std::set<std::string> functions_;
-  std::set<std::string> globvars_;
-  // Added to speed up version script parsing and linking.
-  std::set<std::string> function_regexs_;
-  std::set<std::string> globvar_regexs_;
-  int api_;
-};
-
 inline std::string FindAndReplace(const std::string &candidate_str,
                                   const std::string &find_str,
                                   const std::string &replace_str) {
@@ -98,50 +39,17 @@
   return std::regex_replace(candidate_str, match_expr, replace_str);
 }
 
-
-class SoFileParser {
-public:
-    static std::unique_ptr<SoFileParser> Create(const ObjectFile *obj);
-    virtual const std::set<std::string> &GetFunctions() const = 0;
-    virtual const std::set<std::string> &GetGlobVars() const = 0;
-    virtual ~SoFileParser() {};
-    virtual void GetSymbols() = 0;
-};
-
-template<typename T>
-class ELFSoFileParser : public SoFileParser {
- public:
-  const std::set<std::string> &GetFunctions() const override;
-
-  const std::set<std::string> &GetGlobVars() const override;
-
-  LLVM_ELF_IMPORT_TYPES_ELFT(T)
-  typedef ELFFile<T> ELFO;
-  typedef typename ELFO::Elf_Sym Elf_Sym;
-
-  ELFSoFileParser(const ELFObjectFile<T> *obj) : obj_(obj) {}
-  virtual ~ELFSoFileParser() override {};
-  void GetSymbols() override;
- private:
-  const ELFObjectFile<T> *obj_;
-  std::set<std::string> functions_;
-  std::set<std::string> globvars_;
-
- private:
-  bool IsSymbolExported(const Elf_Sym *elf_sym) const;
-};
-
 template <typename T, typename K>
 std::vector<T> FindRemovedElements(
     const std::map<K, T> &old_elements_map,
     const std::map<K, T> &new_elements_map) {
   std::vector<T> removed_elements;
   for (auto &&map_element : old_elements_map) {
-      auto element_key = map_element.first;
-      auto new_element = new_elements_map.find(element_key);
-      if (new_element == new_elements_map.end()) {
-        removed_elements.emplace_back(map_element.second);
-      }
+    auto element_key = map_element.first;
+    auto new_element = new_elements_map.find(element_key);
+    if (new_element == new_elements_map.end()) {
+      removed_elements.emplace_back(map_element.second);
+    }
   }
   return removed_elements;
 }
@@ -189,4 +97,6 @@
   return common_elements;
 }
 
-} // namespace abi_util
+}  // namespace abi_util
+
+#endif  // HEADER_ABI_UTIL_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/ir_representation.h b/vndk/tools/header-checker/header-abi-util/include/ir_representation.h
index d91d7aa..886c39e 100644
--- a/vndk/tools/header-checker/header-abi-util/include/ir_representation.h
+++ b/vndk/tools/header-checker/header-abi-util/include/ir_representation.h
@@ -11,17 +11,18 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-#ifndef IR_
-#define IR_
+
+#ifndef IR_REPRESENTATION_H_
+#define IR_REPRESENTATION_H_
 
 #include <cassert>
-#include <map>
-#include <unordered_map>
-#include <memory>
 #include <list>
+#include <map>
+#include <memory>
 #include <regex>
 #include <set>
 #include <string>
+#include <unordered_map>
 #include <vector>
 
 // Classes which act as middle-men between clang AST parsing routines and
@@ -39,6 +40,7 @@
 
 enum TextFormatIR {
   ProtobufTextFormat = 0,
+  Json = 1,
 };
 
 enum CompatibilityStatusIR {
@@ -56,8 +58,8 @@
       static_cast<std::underlying_type<CompatibilityStatusIR>::type>(s));
 }
 
-static inline CompatibilityStatusIR operator&(
-    CompatibilityStatusIR f, CompatibilityStatusIR s) {
+static inline CompatibilityStatusIR operator&(CompatibilityStatusIR f,
+                                              CompatibilityStatusIR s) {
   return static_cast<CompatibilityStatusIR>(
       static_cast<std::underlying_type<CompatibilityStatusIR>::type>(f) &
       static_cast<std::underlying_type<CompatibilityStatusIR>::type>(s));
@@ -83,8 +85,19 @@
   GlobalVarKind
 };
 
+template <typename K, typename V>
+std::map<V, K> CreateInverseMap(const std::map<K, V> &m) {
+  std::map<V, K> inverse_map;
+  for (auto it : m) {
+    inverse_map[it.second] = it.first;
+  }
+  return inverse_map;
+}
+
 class LinkableMessageIR {
  public:
+  virtual ~LinkableMessageIR() {}
+
   const std::string &GetLinkerSetKey() const {
     return linker_set_key_;
   }
@@ -102,7 +115,7 @@
   }
 
   virtual LinkableMessageKind GetKind() const = 0;
-  virtual ~LinkableMessageIR() { };
+
  protected:
   // The source file where this message comes from. This will be an empty string
   // for built-in types.
@@ -112,6 +125,14 @@
 
 class ReferencesOtherType {
  public:
+  ReferencesOtherType(const std::string &referenced_type)
+      : referenced_type_(referenced_type) {}
+
+  ReferencesOtherType(std::string &&referenced_type)
+      : referenced_type_(std::move(referenced_type)) {}
+
+  ReferencesOtherType() {}
+
   void SetReferencedType(const std::string &referenced_type) {
     referenced_type_ = referenced_type;
   }
@@ -120,21 +141,14 @@
     return referenced_type_;
   }
 
-  ReferencesOtherType(const std::string &referenced_type)
-      : referenced_type_(referenced_type) { }
-
-  ReferencesOtherType(std::string &&referenced_type)
-      : referenced_type_(std::move(referenced_type)) { }
-
-  ReferencesOtherType() { }
-
  protected:
   std::string referenced_type_;
 };
 
-// TODO: Break this up into types with sizes and those without types ?
-class TypeIR : public LinkableMessageIR , public ReferencesOtherType {
+// TODO: Break this up into types with sizes and those without types?
+class TypeIR : public LinkableMessageIR, public ReferencesOtherType {
  public:
+  virtual ~TypeIR() {}
 
   void SetSelfType(const std::string &self_type) {
     self_type_ = self_type;
@@ -155,18 +169,19 @@
   void SetSize(uint64_t size) {
     size_ = size;
   }
+
   uint64_t GetSize() const {
-   return size_;
+    return size_;
   }
+
   void SetAlignment(uint32_t alignment) {
     alignment_ = alignment;
   }
+
   uint32_t GetAlignment() const {
     return alignment_;
   }
 
-  virtual ~TypeIR() { }
-
  protected:
   std::string name_;
   std::string self_type_;
@@ -185,7 +200,7 @@
   }
 
  protected:
-   std::string unique_id_;
+  std::string unique_id_;
 };
 
 class VTableComponentIR {
@@ -201,10 +216,11 @@
     UnusedFunctionPointer = 7
   };
 
-  VTableComponentIR(const std::string &name, Kind kind, int64_t value)
-      : component_name_(name), kind_(kind), value_(value) { }
+  VTableComponentIR(const std::string &name, Kind kind, int64_t value,
+                    bool is_pure)
+      : component_name_(name), kind_(kind), value_(value), is_pure_(is_pure) {}
 
-  VTableComponentIR() { }
+  VTableComponentIR() {}
 
   Kind GetKind() const {
     return kind_;
@@ -218,10 +234,15 @@
     return component_name_;
   }
 
+  bool GetIsPure() const {
+    return is_pure_;
+  }
+
  protected:
   std::string component_name_;
   Kind kind_;
   int64_t value_ = 0;
+  bool is_pure_;
 };
 
 class VTableLayoutIR {
@@ -245,10 +266,10 @@
 class CXXBaseSpecifierIR : public ReferencesOtherType {
  public:
   CXXBaseSpecifierIR(const std::string &type, bool is_virtual,
-                     AccessSpecifierIR access) :
-    ReferencesOtherType(type), is_virtual_(is_virtual), access_(access) { }
+                     AccessSpecifierIR access)
+      : ReferencesOtherType(type), is_virtual_(is_virtual), access_(access) {}
 
-  CXXBaseSpecifierIR() { }
+  CXXBaseSpecifierIR() {}
 
   bool IsVirtual() const {
     return is_virtual_;
@@ -266,12 +287,12 @@
 class TemplateElementIR : public ReferencesOtherType {
  public:
   TemplateElementIR(std::string &&type)
-      : ReferencesOtherType(std::move(type)) { }
+      : ReferencesOtherType(std::move(type)) {}
 
   TemplateElementIR(const std::string &type)
-      : ReferencesOtherType(type) { }
+      : ReferencesOtherType(type) {}
 
-  TemplateElementIR() { }
+  TemplateElementIR() {}
 };
 
 class TemplateInfoIR {
@@ -315,9 +336,9 @@
   RecordFieldIR(const std::string &name, const std::string &type,
                 uint64_t offset, AccessSpecifierIR access)
       : ReferencesOtherType(type), name_(name), offset_(offset),
-        access_(access) { }
+        access_(access) {}
 
-  RecordFieldIR() { }
+  RecordFieldIR() {}
 
   const std::string &GetName() const {
     return name_;
@@ -337,8 +358,8 @@
   AccessSpecifierIR access_ = AccessSpecifierIR::PublicAccess;
 };
 
-class RecordTypeIR: public TypeIR, public TemplatedArtifactIR,
-  public TagTypeIR {
+class RecordTypeIR : public TypeIR, public TemplatedArtifactIR,
+                     public TagTypeIR {
  public:
   enum RecordKind {
     struct_kind,
@@ -392,7 +413,7 @@
     return fields_;
   }
 
-   LinkableMessageKind GetKind() const override {
+  LinkableMessageKind GetKind() const override {
     return LinkableMessageKind::RecordTypeKind;
   }
 
@@ -428,7 +449,8 @@
 class EnumFieldIR {
  public:
   EnumFieldIR(const std::string &name, int value)
-      : name_(name), value_(value) { }
+      : name_(name), value_(value) {}
+
   const std::string &GetName() const {
     return name_;
   }
@@ -451,7 +473,7 @@
 
   void SetAccess(AccessSpecifierIR access) { access_ = access;}
 
-   LinkableMessageKind GetKind() const override {
+  LinkableMessageKind GetKind() const override {
     return LinkableMessageKind::EnumTypeKind;
   }
 
@@ -578,7 +600,7 @@
   bool is_volatile_;
 };
 
-class GlobalVarIR: public LinkableMessageIR , public ReferencesOtherType {
+class GlobalVarIR : public LinkableMessageIR , public ReferencesOtherType {
  public:
   // Add Methods to get information from the IR.
   void SetName(std::string &&name) {
@@ -612,9 +634,9 @@
 
 class ParamIR : public ReferencesOtherType {
  public:
-  ParamIR(const std::string &type, bool is_default, bool is_this_ptr) :
-    ReferencesOtherType(type) , is_default_(is_default),
-    is_this_ptr_(is_this_ptr) {}
+  ParamIR(const std::string &type, bool is_default, bool is_this_ptr)
+      : ReferencesOtherType(type) , is_default_(is_default),
+        is_this_ptr_(is_this_ptr) {}
 
   bool GetIsDefault() const {
     return is_default_;
@@ -650,6 +672,7 @@
   std::vector<ParamIR> &GetParameters() {
     return parameters_;
   }
+
  protected:
   std::string return_type_;  // return type reference
   std::vector<ParamIR> parameters_;
@@ -695,44 +718,65 @@
  public:
   enum ElfSymbolKind {
     ElfFunctionKind,
-    ElfObjectKind
+    ElfObjectKind,
   };
 
+  enum ElfSymbolBinding {
+    Weak,
+    Global,
+  };
+
+  enum ElfSymbolVisibility {
+    Default,
+    Protected,
+  };
+
+ public:
+  ElfSymbolIR(const std::string &name, ElfSymbolBinding binding)
+      : name_(name), binding_(binding) {}
+
+  virtual ~ElfSymbolIR() {}
+
   const std::string GetName() const {
     return name_;
   }
 
-  ElfSymbolIR(const std::string &name) : name_(name) { }
+  ElfSymbolBinding GetBinding() const {
+    return binding_;
+  }
 
   virtual ElfSymbolKind GetKind() const = 0;
 
-  virtual ~ElfSymbolIR() { }
-
  protected:
   std::string name_;
+  ElfSymbolBinding binding_;
 };
 
-class ElfFunctionIR : public ElfSymbolIR{
+class ElfFunctionIR : public ElfSymbolIR {
  public:
+  ElfFunctionIR(const std::string &name, ElfSymbolBinding binding)
+      : ElfSymbolIR(name, binding) {}
+
   ElfSymbolKind GetKind() const override {
     return ElfFunctionKind;
   }
-
-  ElfFunctionIR(const std::string &name) : ElfSymbolIR(name) { }
 };
 
 class ElfObjectIR : public ElfSymbolIR {
  public:
+  ElfObjectIR(const std::string &name, ElfSymbolBinding binding)
+      : ElfSymbolIR(name, binding) {}
+
   ElfSymbolKind GetKind() const override {
     return ElfObjectKind;
   }
-
-  ElfObjectIR(const std::string &name) : ElfSymbolIR(name) { }
 };
 
 class IRDumper {
  public:
-  IRDumper(const std::string &dump_path) : dump_path_(dump_path) { }
+  IRDumper(const std::string &dump_path) : dump_path_(dump_path) {}
+
+  virtual ~IRDumper() {}
 
   static std::unique_ptr<IRDumper> CreateIRDumper(
       TextFormatIR text_format, const std::string &dump_path);
@@ -743,21 +787,17 @@
 
   virtual bool Dump() = 0;
 
-  virtual ~IRDumper() {}
-
  protected:
   const std::string &dump_path_;
 };
 
 template <typename T>
-inline std::string GetReferencedTypeMapKey(
-    T &element) {
+inline std::string GetReferencedTypeMapKey(T &element) {
   return element.GetReferencedType();
 }
 
 template <>
-inline std::string GetReferencedTypeMapKey<ArrayTypeIR>(
-    ArrayTypeIR &element) {
+inline std::string GetReferencedTypeMapKey<ArrayTypeIR>(ArrayTypeIR &element) {
   return element.GetReferencedType() + ":" + std::to_string(element.GetSize());
 }
 
@@ -807,8 +847,12 @@
 
 class TextFormatToIRReader {
  public:
-
   struct MergeStatus {
+    MergeStatus(bool was_newly_added, const std::string &type_id)
+        : was_newly_added_(was_newly_added), type_id_(type_id) {}
+
+    MergeStatus() {}
+
     // type_id_ always has the global_type_id corresponding to the type this
     // MergeStatus corresponds to. For
     // generic reference types (pointers, qual types, l(r)value references etc),
@@ -816,14 +860,15 @@
     // parent  type_graph if the we decide to add the referencing type to the
     // parent post ODR checking.
     bool was_newly_added_ = false;
+
     std::string type_id_;
-    MergeStatus(bool was_newly_added, const std::string &type_id)
-        : was_newly_added_(was_newly_added), type_id_(type_id) { }
-    MergeStatus() { }
   };
 
+ public:
   TextFormatToIRReader(const std::set<std::string> *exported_headers)
-      : exported_headers_(exported_headers) { }
+      : exported_headers_(exported_headers) {}
+
+  virtual ~TextFormatToIRReader() {}
 
   const AbiElementMap<FunctionIR> &GetFunctions() const {
     return functions_;
@@ -845,13 +890,11 @@
     return enum_types_;
   }
 
-  const AbiElementMap<LvalueReferenceTypeIR> &
-      GetLvalueReferenceTypes() const {
+  const AbiElementMap<LvalueReferenceTypeIR> &GetLvalueReferenceTypes() const {
     return lvalue_reference_types_;
   }
 
-  const AbiElementMap<RvalueReferenceTypeIR> &
-      GetRvalueReferenceTypes() const {
+  const AbiElementMap<RvalueReferenceTypeIR> &GetRvalueReferenceTypes() const {
     return rvalue_reference_types_;
   }
 
@@ -884,26 +927,12 @@
   }
 
   const AbiElementUnorderedMap<std::list<const TypeIR *>> &
-      GetODRListMap() const {
-        return odr_list_map_;
+  GetODRListMap() const {
+    return odr_list_map_;
   }
 
   virtual bool ReadDump(const std::string &dump_file) = 0;
 
-  template <typename Iterator>
-  bool ReadDumps(Iterator begin, Iterator end) {
-    Iterator it = begin;
-    while(it != end) {
-      if (!ReadDump(*it)) {
-        return false;
-      }
-      ++it;
-    }
-    return true;
-  }
-
-  virtual ~TextFormatToIRReader() { }
-
   void Merge(TextFormatToIRReader &&addend) {
     MergeElements(&functions_, std::move(addend.functions_));
     MergeElements(&global_variables_, std::move(addend.global_variables_));
@@ -928,9 +957,9 @@
       AbiElementMap<T> *parent_map, const std::string  &updated_self_type_id);
 
   MergeStatus DoesUDTypeODRViolationExist(
-    const TypeIR *ud_type, const TextFormatToIRReader &addend,
-    const std::string ud_type_unique_id,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map_);
+      const TypeIR *ud_type, const TextFormatToIRReader &addend,
+      const std::string ud_type_unique_id,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map_);
 
   MergeStatus MergeReferencingTypeInternal(
       const TextFormatToIRReader &addend, ReferencesOtherType *references_type,
@@ -942,39 +971,39 @@
       const std::string  &updated_self_type_id);
 
   MergeStatus MergeGenericReferringType(
-    const TextFormatToIRReader &addend, const TypeIR *addend_node,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      const TextFormatToIRReader &addend, const TypeIR *addend_node,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   template <typename T>
   std::pair<MergeStatus, typename AbiElementMap<T>::iterator>
   UpdateUDTypeAccounting(
-    const T *addend_node, const TextFormatToIRReader &addend,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map,
-    AbiElementMap<T> *specific_type_map);
+      const T *addend_node, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map,
+      AbiElementMap<T> *specific_type_map);
 
   MergeStatus MergeTypeInternal(
-    const TypeIR *addend_node, const TextFormatToIRReader &addend,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      const TypeIR *addend_node, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   void MergeCFunctionLikeDeps(
-    const TextFormatToIRReader &addend, CFunctionLikeIR *cfunction_like_ir,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      const TextFormatToIRReader &addend, CFunctionLikeIR *cfunction_like_ir,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   MergeStatus MergeFunctionType(
-    const FunctionTypeIR *addend_node, const TextFormatToIRReader &addend,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      const FunctionTypeIR *addend_node, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   MergeStatus MergeEnumType(
-    const EnumTypeIR *addend_node, const TextFormatToIRReader &addend,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      const EnumTypeIR *addend_node, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   void MergeEnumDependencies(
       const TextFormatToIRReader &addend, EnumTypeIR *added_node,
       AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   MergeStatus MergeRecordAndDependencies(
-    const RecordTypeIR *addend_node, const TextFormatToIRReader &addend,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      const RecordTypeIR *addend_node, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   void MergeRecordDependencies(
       const TextFormatToIRReader &addend, RecordTypeIR *added_node,
@@ -1005,12 +1034,12 @@
       AbiElementMap<MergeStatus>  *local_to_global_type_id_map);
 
   void MergeFunctionDeps(
-    FunctionIR *added_node, const TextFormatToIRReader &addend,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      FunctionIR *added_node, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   void MergeFunction(
-    const FunctionIR *addend_node, const TextFormatToIRReader &addend,
-    AbiElementMap<MergeStatus> *local_to_global_type_id_map);
+      const FunctionIR *addend_node, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
   void MergeGraphs(const TextFormatToIRReader &addend);
 
@@ -1022,9 +1051,9 @@
       const TypeIR *addend_node, const TextFormatToIRReader &addend,
       AbiElementMap<MergeStatus> *local_to_global_type_id_map);
 
-  MergeStatus MergeType(const TypeIR *addend_type,
-                        const TextFormatToIRReader &addend,
-                        AbiElementMap<MergeStatus> *merged_types_cache);
+  MergeStatus MergeType(
+      const TypeIR *addend_type, const TextFormatToIRReader &addend,
+      AbiElementMap<MergeStatus> *merged_types_cache);
 
   std::string AllocateNewTypeId();
 
@@ -1033,13 +1062,15 @@
       const std::set<std::string> *exported_headers = nullptr);
 
  protected:
-
   template <typename Augend, typename Addend>
   inline void MergeElements(Augend *augend, Addend &&addend) {
     augend->insert(std::make_move_iterator(addend.begin()),
                    std::make_move_iterator(addend.end()));
   }
 
+  bool IsLinkableMessageInExportedHeaders(
+      const LinkableMessageIR *linkable_message) const;
+
   AbiElementList<RecordTypeIR> record_types_list_;
   AbiElementMap<FunctionIR> functions_;
   AbiElementMap<GlobalVarIR> global_variables_;
@@ -1069,16 +1100,19 @@
 
 class DiffMessageIR {
  public:
-
   enum DiffKind {
-    Extension, // Applicable for enums.
+    Extension,  // Applicable for enums.
     Added,
     Removed,
     Referenced,
     Unreferenced
   };
 
+ public:
+  virtual ~DiffMessageIR() {}
+
   virtual LinkableMessageKind Kind() const = 0;
+
   void SetName(const std::string &name) {
     name_ = name;
   }
@@ -1087,8 +1121,6 @@
     return name_;
   }
 
-  virtual ~DiffMessageIR() { }
-
  protected:
   std::string name_;
 };
@@ -1097,7 +1129,7 @@
  public:
   AccessSpecifierDiffIR(AccessSpecifierIR old_access,
                         AccessSpecifierIR new_access)
-      : old_access_(old_access), new_access_(new_access) { }
+      : old_access_(old_access), new_access_(new_access) {}
 
  protected:
   AccessSpecifierIR old_access_;
@@ -1108,7 +1140,7 @@
  public:
   TypeDiffIR(std::pair<uint64_t, uint64_t> &&sizes,
              std::pair<uint32_t, uint32_t> &&alignment)
-      : sizes_(std::move(sizes)), alignments_(std::move(alignment)) { }
+      : sizes_(std::move(sizes)), alignments_(std::move(alignment)) {}
 
   const std::pair<uint64_t, uint64_t> &GetSizes() const {
     return sizes_;
@@ -1127,7 +1159,7 @@
  public:
   VTableLayoutDiffIR(const VTableLayoutIR &old_layout,
                      const VTableLayoutIR &new_layout)
-      : old_layout_(old_layout), new_layout_(new_layout) { }
+      : old_layout_(old_layout), new_layout_(new_layout) {}
 
   const VTableLayoutIR &GetOldVTable() const {
     return old_layout_;
@@ -1146,7 +1178,8 @@
  public:
   RecordFieldDiffIR(const RecordFieldIR *old_field,
                     const RecordFieldIR *new_field)
-      : old_field_(old_field), new_field_(new_field) { }
+      : old_field_(old_field), new_field_(new_field) {}
+
   const RecordFieldIR *GetOldField() const {
     return old_field_;
   }
@@ -1165,7 +1198,8 @@
       const std::vector<CXXBaseSpecifierIR> &old_base_specifiers,
       const std::vector<CXXBaseSpecifierIR> &new_base_specifiers)
       : old_base_specifiers_(old_base_specifiers),
-        new_base_specifiers_(new_base_specifiers) { }
+        new_base_specifiers_(new_base_specifiers) {}
+
   const std::vector<CXXBaseSpecifierIR> &GetOldBases() const {
     return old_base_specifiers_;
   }
@@ -1260,7 +1294,7 @@
 class EnumFieldDiffIR {
  public:
   EnumFieldDiffIR(const EnumFieldIR *old_field, const EnumFieldIR *new_field)
-      : old_field_(old_field), new_field_(new_field) { }
+      : old_field_(old_field), new_field_(new_field) {}
 
   const EnumFieldIR *GetOldField() const {
     return old_field_;
@@ -1315,7 +1349,6 @@
         fields_added_.size() != 0) {
         return true;
     }
-
     return false;
   }
 
@@ -1323,7 +1356,6 @@
     if (fields_removed_.size() != 0 || fields_diff_.size() != 0) {
         return true;
     }
-
     return false;
   }
 
@@ -1348,17 +1380,17 @@
     return LinkableMessageKind::GlobalVarKind;
   }
 
- GlobalVarDiffIR(const GlobalVarIR *old_global_var,
-                 const GlobalVarIR *new_global_var)
-      : old_global_var_(old_global_var), new_global_var_(new_global_var) { }
+  GlobalVarDiffIR(const GlobalVarIR *old_global_var,
+                  const GlobalVarIR *new_global_var)
+      : old_global_var_(old_global_var), new_global_var_(new_global_var) {}
 
- const GlobalVarIR *GetOldGlobalVar() const {
-   return old_global_var_;
- }
+  const GlobalVarIR *GetOldGlobalVar() const {
+    return old_global_var_;
+  }
 
- const GlobalVarIR *GetNewGlobalVar() const {
-   return new_global_var_;
- }
+  const GlobalVarIR *GetNewGlobalVar() const {
+    return new_global_var_;
+  }
 
  protected:
   const GlobalVarIR *old_global_var_;
@@ -1367,14 +1399,14 @@
 
 class FunctionDiffIR : public DiffMessageIR {
  public:
+  FunctionDiffIR(const FunctionIR *old_function,
+                 const FunctionIR *new_function)
+      : old_function_(old_function), new_function_(new_function) {}
+
   LinkableMessageKind Kind() const override {
     return LinkableMessageKind::FunctionKind;
   }
 
-  FunctionDiffIR(const FunctionIR *old_function,
-                 const FunctionIR *new_function)
-      : old_function_(old_function), new_function_(new_function) { }
-
   const FunctionIR *GetOldFunction() const {
     return old_function_;
   }
@@ -1392,7 +1424,10 @@
  public:
   typedef DiffMessageIR::DiffKind DiffKind;
 
-  IRDiffDumper(const std::string &dump_path) : dump_path_(dump_path) { }
+ public:
+  IRDiffDumper(const std::string &dump_path) : dump_path_(dump_path) {}
+
+  virtual ~IRDiffDumper() {}
 
   virtual bool AddDiffMessageIR(const DiffMessageIR *,
                                 const std::string &type_stack,
@@ -1414,13 +1449,13 @@
 
   virtual CompatibilityStatusIR GetCompatibilityStatusIR() = 0;
 
-  virtual ~IRDiffDumper() {}
   static std::unique_ptr<IRDiffDumper> CreateIRDiffDumper(
       TextFormatIR, const std::string &dump_path);
+
  protected:
   const std::string &dump_path_;
 };
 
-} // namespace abi_util
+}  // namespace abi_util
 
-#endif // IR_
+#endif  // IR_REPRESENTATION_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/ir_representation_json.h b/vndk/tools/header-checker/header-abi-util/include/ir_representation_json.h
new file mode 100644
index 0000000..9b4c36f
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/include/ir_representation_json.h
@@ -0,0 +1,288 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef IR_REPRESENTATION_JSON_H_
+#define IR_REPRESENTATION_JSON_H_
+
+#include "ir_representation.h"
+
+#include <json/value.h>
+
+// Classes which act as middle-men between clang AST parsing routines and
+// message format specific dumpers.
+namespace abi_util {
+
+// These classes wrap constructors of Json::Value.
+class JsonArray : public Json::Value {
+ public:
+  JsonArray() : Json::Value(Json::ValueType::arrayValue) {}
+};
+
+class JsonObject : public Json::Value {
+ public:
+  JsonObject() : Json::Value(Json::ValueType::objectValue) {}
+
+  // This method inserts the key-value pair if the value is not equal to the
+  // omissible value.
+  // Omit false.
+  void Set(const std::string &key, bool value);
+
+  // Omit 0.
+  void Set(const std::string &key, uint64_t value);
+
+  // Omit 0.
+  void Set(const std::string &key, int64_t value);
+
+  // Omit "".
+  void Set(const std::string &key, const std::string &value);
+
+  // Omit [].
+  void Set(const std::string &key, const JsonArray &value);
+
+ private:
+  template <typename T>
+  inline void SetOmissible(const std::string &key, T value, T omissible_value) {
+    if (value != omissible_value) {
+      (*this)[key] = value;
+    } else {
+      removeMember(key);
+    }
+  }
+};
+
+class IRToJsonConverter {
+ private:
+  static void AddTemplateInfo(JsonObject &type_decl,
+                              const TemplatedArtifactIR *template_ir);
+
+  // BasicNamedAndTypedDecl
+  static void AddTypeInfo(JsonObject &type_decl, const TypeIR *type_ir);
+
+  static void AddRecordFields(JsonObject &record_type,
+                              const RecordTypeIR *record_ir);
+
+  static void AddBaseSpecifiers(JsonObject &record_type,
+                                const RecordTypeIR *record_ir);
+
+  static void AddVTableLayout(JsonObject &record_type,
+                              const RecordTypeIR *record_ir);
+
+  static void AddTagTypeInfo(JsonObject &type_decl,
+                             const TagTypeIR *tag_type_ir);
+
+  static void AddEnumFields(JsonObject &enum_type, const EnumTypeIR *enum_ir);
+
+ public:
+  static JsonObject ConvertEnumTypeIR(const EnumTypeIR *enump);
+
+  static JsonObject ConvertRecordTypeIR(const RecordTypeIR *recordp);
+
+  static JsonObject ConvertFunctionTypeIR(const FunctionTypeIR *function_typep);
+
+  static void AddFunctionParametersAndSetReturnType(
+      JsonObject &function, const CFunctionLikeIR *cfunction_like_ir);
+
+  static void AddFunctionParameters(JsonObject &function,
+                                    const CFunctionLikeIR *cfunction_like_ir);
+
+  static JsonObject ConvertFunctionIR(const FunctionIR *functionp);
+
+  static JsonObject ConvertGlobalVarIR(const GlobalVarIR *global_varp);
+
+  static JsonObject ConvertPointerTypeIR(const PointerTypeIR *pointerp);
+
+  static JsonObject ConvertQualifiedTypeIR(const QualifiedTypeIR *qualtypep);
+
+  static JsonObject ConvertBuiltinTypeIR(const BuiltinTypeIR *builtin_typep);
+
+  static JsonObject ConvertArrayTypeIR(const ArrayTypeIR *array_typep);
+
+  static JsonObject ConvertLvalueReferenceTypeIR(
+      const LvalueReferenceTypeIR *lvalue_reference_typep);
+
+  static JsonObject ConvertRvalueReferenceTypeIR(
+      const RvalueReferenceTypeIR *rvalue_reference_typep);
+};
+
+class JsonIRDumper : public IRDumper, public IRToJsonConverter {
+ public:
+  JsonIRDumper(const std::string &dump_path);
+
+  ~JsonIRDumper() override {}
+
+  bool AddLinkableMessageIR(const LinkableMessageIR *) override;
+
+  bool AddElfSymbolMessageIR(const ElfSymbolIR *) override;
+
+  bool Dump() override;
+
+ private:
+  JsonObject translation_unit_;
+};
+
+template <typename T> class JsonArrayRef;
+
+// This class loads values from a read-only JSON object.
+class JsonObjectRef {
+ public:
+  // The constructor sets ok to false if json_value is not an object.
+  JsonObjectRef(const Json::Value &json_value, bool &ok);
+
+  // This method gets a value from the object and checks the type.
+  // If the type mismatches, it sets ok_ to false and returns default value.
+  // If the key doesn't exist, it doesn't change ok_ and returns default value.
+  // Default to false.
+  bool GetBool(const std::string &key) const;
+
+  // Default to 0.
+  int64_t GetInt(const std::string &key) const;
+
+  // Default to 0.
+  uint64_t GetUint(const std::string &key) const;
+
+  // Default to "".
+  std::string GetString(const std::string &key) const;
+
+  // Default to {}.
+  JsonObjectRef GetObject(const std::string &key) const;
+
+  // Default to [].
+  JsonArrayRef<JsonObjectRef> GetObjects(const std::string &key) const;
+
+  JsonArrayRef<std::string> GetStrings(const std::string &key) const;
+
+ private:
+  typedef bool (Json::Value::*IsExpectedJsonType)() const;
+
+  const Json::Value &Get(const std::string &key,
+                         const Json::Value &default_value,
+                         IsExpectedJsonType is_expected_type) const;
+
+  const Json::Value &object_;
+  bool &ok_;
+};
+
+// This class loads elements as type T from a read-only JSON array.
+template <typename T> class JsonArrayRef {
+ public:
+  class Iterator {
+   public:
+    Iterator(const Json::Value &json_value, bool &ok, int index)
+        : array_(json_value), ok_(ok), index_(index) {}
+
+    Iterator &operator++() {
+      ++index_;
+      return *this;
+    }
+
+    bool operator!=(const Iterator &other) const {
+      return index_ != other.index_;
+    }
+
+    T operator*() const;
+
+   private:
+    const Json::Value &array_;
+    bool &ok_;
+    int index_;
+  };
+
+  // The caller ensures json_value.isArray() == true.
+  JsonArrayRef(const Json::Value &json_value, bool &ok)
+      : array_(json_value), ok_(ok) {}
+
+  Iterator begin() const { return Iterator(array_, ok_, 0); }
+
+  Iterator end() const { return Iterator(array_, ok_, array_.size()); }
+
+ private:
+  const Json::Value &array_;
+  bool &ok_;
+};
+
+template <>
+JsonObjectRef JsonArrayRef<JsonObjectRef>::Iterator::operator*() const;
+
+template <> std::string JsonArrayRef<std::string>::Iterator::operator*() const;
+
+class JsonToIRReader : public TextFormatToIRReader {
+ public:
+  JsonToIRReader(const std::set<std::string> *exported_headers)
+      : TextFormatToIRReader(exported_headers) {}
+
+  bool ReadDump(const std::string &dump_file) override;
+
+ private:
+  void ReadFunctions(const JsonObjectRef &tu);
+
+  void ReadGlobalVariables(const JsonObjectRef &tu);
+
+  void ReadEnumTypes(const JsonObjectRef &tu);
+
+  void ReadRecordTypes(const JsonObjectRef &tu);
+
+  void ReadFunctionTypes(const JsonObjectRef &tu);
+
+  void ReadPointerTypes(const JsonObjectRef &tu);
+
+  void ReadBuiltinTypes(const JsonObjectRef &tu);
+
+  void ReadQualifiedTypes(const JsonObjectRef &tu);
+
+  void ReadArrayTypes(const JsonObjectRef &tu);
+
+  void ReadLvalueReferenceTypes(const JsonObjectRef &tu);
+
+  void ReadRvalueReferenceTypes(const JsonObjectRef &tu);
+
+  void ReadElfFunctions(const JsonObjectRef &tu);
+
+  void ReadElfObjects(const JsonObjectRef &tu);
+
+  static void ReadTemplateInfo(const JsonObjectRef &type_decl,
+                               TemplatedArtifactIR *template_ir);
+
+  static void ReadTypeInfo(const JsonObjectRef &type_decl, TypeIR *type_ir);
+
+  static void ReadRecordFields(const JsonObjectRef &record_type,
+                               RecordTypeIR *record_ir);
+
+  static void ReadBaseSpecifiers(const JsonObjectRef &record_type,
+                                 RecordTypeIR *record_ir);
+
+  static void ReadVTableLayout(const JsonObjectRef &record_type,
+                               RecordTypeIR *record_ir);
+
+  static void ReadTagTypeInfo(const JsonObjectRef &type_decl,
+                              TagTypeIR *tag_type_ir);
+
+  static void ReadEnumFields(const JsonObjectRef &enum_type,
+                             EnumTypeIR *enum_ir);
+
+  static void ReadFunctionParametersAndReturnType(const JsonObjectRef &function,
+                                                  CFunctionLikeIR *function_ir);
+
+  static FunctionIR FunctionJsonToIR(const JsonObjectRef &function);
+
+  static FunctionTypeIR
+  FunctionTypeJsonToIR(const JsonObjectRef &function_type);
+
+  static RecordTypeIR RecordTypeJsonToIR(const JsonObjectRef &record_type);
+
+  static EnumTypeIR EnumTypeJsonToIR(const JsonObjectRef &enum_type);
+};
+
+}  // namespace abi_util
+
+#endif  // IR_REPRESENTATION_JSON_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/ir_representation_protobuf.h b/vndk/tools/header-checker/header-abi-util/include/ir_representation_protobuf.h
index b4d6880..bacd1c9 100644
--- a/vndk/tools/header-checker/header-abi-util/include/ir_representation_protobuf.h
+++ b/vndk/tools/header-checker/header-abi-util/include/ir_representation_protobuf.h
@@ -11,16 +11,17 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-#ifndef IR_PROTOBUF_
-#define IR_PROTOBUF_
 
-#include <ir_representation.h>
+#ifndef IR_REPRESENTATION_PROTOBUF_H_
+#define IR_REPRESENTATION_PROTOBUF_H_
+
+#include "ir_representation.h"
 
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunused-parameter"
 #pragma clang diagnostic ignored "-Wnested-anon-types"
-#include "proto/abi_dump.pb.h"
-#include "proto/abi_diff.pb.h"
+#include "abi_dump.pb.h"
+#include "abi_diff.pb.h"
 #pragma clang diagnostic pop
 
 #include <google/protobuf/text_format.h>
@@ -33,7 +34,7 @@
 
 inline abi_diff::CompatibilityStatus CompatibilityStatusIRToProtobuf(
     CompatibilityStatusIR status) {
-  switch(status) {
+  switch (status) {
     case CompatibilityStatusIR::Incompatible:
       return abi_diff::CompatibilityStatus::INCOMPATIBLE;
     case CompatibilityStatusIR::Extension:
@@ -44,6 +45,31 @@
   return abi_diff::CompatibilityStatus::COMPATIBLE;
 }
 
+inline abi_dump::ElfSymbolBinding ElfSymbolBindingIRToProtobuf(
+    ElfSymbolIR::ElfSymbolBinding binding) {
+  switch (binding) {
+    case ElfSymbolIR::ElfSymbolBinding::Global:
+      return abi_dump::ElfSymbolBinding::Global;
+    case ElfSymbolIR::ElfSymbolBinding::Weak:
+      return abi_dump::ElfSymbolBinding::Weak;
+  }
+  // We skip symbols of all other Bindings
+  // TODO: Add all bindings, don't leave out info
+  assert(0);
+}
+
+inline ElfSymbolIR::ElfSymbolBinding ElfSymbolBindingProtobufToIR(
+    abi_dump::ElfSymbolBinding binding) {
+  switch (binding) {
+    case abi_dump::ElfSymbolBinding::Global:
+      return ElfSymbolIR::ElfSymbolBinding::Global;
+    case abi_dump::ElfSymbolBinding::Weak:
+      return ElfSymbolIR::ElfSymbolBinding::Weak;
+  }
+  // We skip symbols of all other Bindings
+  assert(0);
+}
+
 inline abi_dump::AccessSpecifier AccessIRToProtobuf(AccessSpecifierIR access) {
   switch (access) {
     case AccessSpecifierIR::ProtectedAccess:
@@ -172,7 +198,7 @@
 class IRToProtobufConverter {
  private:
   static bool AddTemplateInformation(
-    abi_dump::TemplateInfo *ti, const abi_util::TemplatedArtifactIR *ta);
+      abi_dump::TemplateInfo *ti, const abi_util::TemplatedArtifactIR *ta);
 
   static bool AddTypeInfo(
       abi_dump::BasicNamedAndTypedDecl *type_info, const TypeIR *typep);
@@ -191,6 +217,7 @@
 
   static bool AddEnumFields(abi_dump::EnumType *enum_protobuf,
                             const EnumTypeIR *enum_ir);
+
  public:
   static abi_dump::EnumType ConvertEnumTypeIR(const EnumTypeIR *enump);
 
@@ -240,29 +267,30 @@
 
 class IRDiffToProtobufConverter {
  private:
-  static bool AddTypeInfoDiff(abi_diff::TypeInfoDiff *type_info_diff_protobuf,
-                              const TypeDiffIR *type_diff_ir);
+  static bool AddTypeInfoDiff(
+      abi_diff::TypeInfoDiff *type_info_diff_protobuf,
+      const TypeDiffIR *type_diff_ir);
 
   static bool AddVTableLayoutDiff(
-    abi_diff::VTableLayoutDiff *vtable_layout_diff_protobuf,
-    const VTableLayoutDiffIR *vtable_layout_diff_ir);
+      abi_diff::VTableLayoutDiff *vtable_layout_diff_protobuf,
+      const VTableLayoutDiffIR *vtable_layout_diff_ir);
 
   static bool AddBaseSpecifierDiffs(
-    abi_diff::CXXBaseSpecifierDiff *base_specifier_diff_protobuf,
-    const CXXBaseSpecifierDiffIR *base_specifier_diff_ir);
+      abi_diff::CXXBaseSpecifierDiff *base_specifier_diff_protobuf,
+      const CXXBaseSpecifierDiffIR *base_specifier_diff_ir);
 
   static bool AddRecordFields(
-    abi_diff::RecordTypeDiff *record_diff_protobuf,
-    const std::vector<const RecordFieldIR *> &record_fields_removed_ir,
-    bool removed);
+      abi_diff::RecordTypeDiff *record_diff_protobuf,
+      const std::vector<const RecordFieldIR *> &record_fields_removed_ir,
+      bool removed);
 
   static bool AddRecordFieldDiffs(
-    abi_diff::RecordTypeDiff *record_diff_protobuf,
-    const std::vector<RecordFieldDiffIR> &record_field_diff_ir);
+      abi_diff::RecordTypeDiff *record_diff_protobuf,
+      const std::vector<RecordFieldDiffIR> &record_field_diff_ir);
 
   static bool AddEnumUnderlyingTypeDiff(
-    abi_diff::UnderlyingTypeDiff *underlying_type_diff_protobuf,
-    const std::pair<std::string, std::string> *underlying_type_diff_ir);
+      abi_diff::UnderlyingTypeDiff *underlying_type_diff_protobuf,
+      const std::pair<std::string, std::string> *underlying_type_diff_ir);
 
  public:
   static abi_diff::RecordTypeDiff ConvertRecordTypeDiffIR(
@@ -310,7 +338,9 @@
 
  public:
   ProtobufIRDumper(const std::string &dump_path)
-      : IRDumper(dump_path), tu_ptr_(new abi_dump::TranslationUnit()) { }
+      : IRDumper(dump_path), tu_ptr_(new abi_dump::TranslationUnit()) {}
+
+  ~ProtobufIRDumper() override {}
 
   bool AddLinkableMessageIR(const LinkableMessageIR *) override;
 
@@ -318,18 +348,19 @@
 
   bool Dump() override;
 
-  ~ProtobufIRDumper() override { }
-
  private:
   std::unique_ptr<abi_dump::TranslationUnit> tu_ptr_;
 };
 
 
 class ProtobufTextFormatToIRReader : public TextFormatToIRReader {
- public:
+ private:
+  template <typename T>
+  using RepeatedPtrField = google::protobuf::RepeatedPtrField<T>;
 
+ public:
   ProtobufTextFormatToIRReader(const std::set<std::string> *exported_headers)
-      : TextFormatToIRReader(exported_headers) { }
+      : TextFormatToIRReader(exported_headers) {}
 
   bool ReadDump(const std::string &dump_file) override;
 
@@ -356,9 +387,9 @@
 
   void ReadRvalueReferenceTypes(const abi_dump::TranslationUnit &tu);
 
-  void ReadElfFunctions (const abi_dump::TranslationUnit &tu);
+  void ReadElfFunctions(const abi_dump::TranslationUnit &tu);
 
-  void ReadElfObjects (const abi_dump::TranslationUnit &tu);
+  void ReadElfObjects(const abi_dump::TranslationUnit &tu);
 
   void ReadTypeInfo(const abi_dump::BasicNamedAndTypedDecl &type_info,
                     TypeIR *typep);
@@ -369,32 +400,34 @@
       const abi_dump::FunctionType &function_type_protobuf);
 
   RecordTypeIR RecordTypeProtobufToIR(
-       const abi_dump::RecordType &record_type_protobuf);
+      const abi_dump::RecordType &record_type_protobuf);
 
   std::vector<RecordFieldIR> RecordFieldsProtobufToIR(
-    const google::protobuf::RepeatedPtrField<abi_dump::RecordFieldDecl> &rfp);
+      const RepeatedPtrField<abi_dump::RecordFieldDecl> &rfp);
 
   std::vector<CXXBaseSpecifierIR> RecordCXXBaseSpecifiersProtobufToIR(
-    const google::protobuf::RepeatedPtrField<abi_dump::CXXBaseSpecifier> &rbs);
+      const RepeatedPtrField<abi_dump::CXXBaseSpecifier> &rbs);
 
   std::vector<EnumFieldIR> EnumFieldsProtobufToIR(
-       const google::protobuf::RepeatedPtrField<abi_dump::EnumFieldDecl> &efp);
+      const RepeatedPtrField<abi_dump::EnumFieldDecl> &efp);
 
   EnumTypeIR EnumTypeProtobufToIR(
-       const abi_dump::EnumType &enum_type_protobuf);
+      const abi_dump::EnumType &enum_type_protobuf);
 
   VTableLayoutIR VTableLayoutProtobufToIR(
-    const abi_dump::VTableLayout &vtable_layout_protobuf);
+      const abi_dump::VTableLayout &vtable_layout_protobuf);
 
   TemplateInfoIR TemplateInfoProtobufToIR(
-       const abi_dump::TemplateInfo &template_info_protobuf);
+      const abi_dump::TemplateInfo &template_info_protobuf);
 };
 
 class ProtobufIRDiffDumper : public IRDiffDumper {
  public:
   ProtobufIRDiffDumper(const std::string &dump_path)
       : IRDiffDumper(dump_path),
-        diff_tu_(new abi_diff::TranslationUnitDiff()) { }
+        diff_tu_(new abi_diff::TranslationUnitDiff()) {}
+
+  ~ProtobufIRDiffDumper() override {}
 
   bool AddDiffMessageIR(const DiffMessageIR *, const std::string &type_stack,
                         DiffKind diff_kind) override;
@@ -412,9 +445,7 @@
 
   bool Dump() override;
 
-   CompatibilityStatusIR GetCompatibilityStatusIR() override;
-
-   ~ProtobufIRDiffDumper() override { }
+  CompatibilityStatusIR GetCompatibilityStatusIR() override;
 
  private:
   // User defined types.
@@ -449,6 +480,6 @@
   std::unique_ptr<abi_diff::TranslationUnitDiff> diff_tu_;
 };
 
-} // abi_util
+}  // namespace abi_util
 
-#endif // IR_PROTOBUF_
+#endif  // IR_REPRESENTATION_PROTOBUF_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/so_file_parser.h b/vndk/tools/header-checker/header-abi-util/include/so_file_parser.h
new file mode 100644
index 0000000..3f5eeca
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/include/so_file_parser.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SO_FILE_PARSER_H_
+#define SO_FILE_PARSER_H_
+
+#include "exported_symbol_set.h"
+#include "ir_representation.h"
+
+#include <memory>
+#include <map>
+#include <string>
+
+
+namespace abi_util {
+
+
+class SoFileParser {
+ public:
+  static std::unique_ptr<SoFileParser> Create(const std::string &so_file_path);
+
+  virtual ~SoFileParser() {}
+
+  virtual std::unique_ptr<ExportedSymbolSet> Parse() = 0;
+};
+
+
+}  // namespace abi_util
+
+
+#endif  // SO_FILE_PARSER_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/stl_utils.h b/vndk/tools/header-checker/header-abi-util/include/stl_utils.h
new file mode 100644
index 0000000..3a520ad
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/include/stl_utils.h
@@ -0,0 +1,33 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STL_UTILS_H_
+#define STL_UTILS_H_
+
+
+namespace abi_util {
+
+
+class FreeDeleter {
+ public:
+  inline void operator()(void *ptr) const {
+    ::free(ptr);
+  }
+};
+
+
+}  // namespace abi_util
+
+
+#endif  // STL_UTILS_
diff --git a/vndk/tools/header-checker/header-abi-util/include/string_utils.h b/vndk/tools/header-checker/header-abi-util/include/string_utils.h
new file mode 100644
index 0000000..d222a43
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/include/string_utils.h
@@ -0,0 +1,43 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STRING_UTILS_H_
+#define STRING_UTILS_H_
+
+#include <optional>
+#include <string>
+#include <vector>
+
+
+namespace abi_util {
+
+
+std::string_view Trim(std::string_view s);
+
+bool StartsWith(std::string_view s, std::string_view prefix);
+
+bool EndsWith(std::string_view s, std::string_view suffix);
+
+std::vector<std::string_view> Split(std::string_view s,
+                                    std::string_view delim_chars);
+
+std::optional<int> ParseInt(const std::string &s);
+
+bool IsGlobPattern(std::string_view s);
+
+
+}  // namespace abi_util
+
+
+#endif  // STRING_UTILS_H_
diff --git a/vndk/tools/header-checker/header-abi-util/include/version_script_parser.h b/vndk/tools/header-checker/header-abi-util/include/version_script_parser.h
new file mode 100644
index 0000000..7becddf
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/include/version_script_parser.h
@@ -0,0 +1,131 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef VERSION_SCRIPT_PARSER_H_
+#define VERSION_SCRIPT_PARSER_H_
+
+#include "api_level.h"
+#include "exported_symbol_set.h"
+#include "ir_representation.h"
+
+#include <functional>
+#include <map>
+#include <set>
+#include <string>
+
+
+namespace abi_util {
+
+
+class VersionScriptParser {
+ private:
+  enum class LineScope {
+    GLOBAL,
+    LOCAL,
+  };
+
+
+  struct ParsedTags {
+   public:
+    unsigned has_arch_tags_ : 1;
+    unsigned has_current_arch_tag_ : 1;
+    unsigned has_introduced_tags_ : 1;
+    unsigned has_excluded_tags_ : 1;
+    unsigned has_future_tag_ : 1;
+    unsigned has_var_tag_ : 1;
+    ApiLevel introduced_;
+
+
+   public:
+    ParsedTags()
+        : has_arch_tags_(0), has_current_arch_tag_(0), has_introduced_tags_(0),
+          has_excluded_tags_(0), has_future_tag_(0), has_var_tag_(0),
+          introduced_(-1) {}
+  };
+
+
+ public:
+  class ErrorHandler {
+   public:
+    virtual ~ErrorHandler();
+
+    virtual void OnError(int line_no, const std::string &error_msg) = 0;
+  };
+
+
+ public:
+  VersionScriptParser();
+
+  void SetArch(const std::string &arch);
+
+  void SetApiLevel(ApiLevel api_level) {
+    api_level_ = api_level;
+  }
+
+  void AddExcludedSymbolVersion(const std::string &version) {
+    excluded_symbol_versions_.insert(version);
+  }
+
+  void AddExcludedSymbolTag(const std::string &tag) {
+    excluded_symbol_tags_.insert(tag);
+  }
+
+  void SetErrorHandler(std::unique_ptr<ErrorHandler> error_handler) {
+    error_handler_ = std::move(error_handler);
+  }
+
+  std::unique_ptr<ExportedSymbolSet> Parse(std::istream &version_script_stream);
+
+
+ private:
+  bool ReadLine(std::string &line);
+
+  bool ParseVersionBlock(bool ignore_symbols);
+
+  bool ParseSymbolLine(const std::string &line, bool is_cpp_symbol);
+
+  ParsedTags ParseSymbolTags(const std::string &line);
+
+  bool IsSymbolExported(const ParsedTags &tags);
+
+
+ private:
+  void ReportError(const std::string &error_msg) {
+    if (error_handler_) {
+      error_handler_->OnError(line_no_, error_msg);
+    }
+  }
+
+
+ private:
+  std::unique_ptr<ErrorHandler> error_handler_;
+
+  std::string arch_;
+  std::string introduced_arch_tag_;
+  ApiLevel api_level_;
+
+  std::set<std::string, std::less<>> excluded_symbol_versions_;
+  std::set<std::string, std::less<>> excluded_symbol_tags_;
+
+  std::istream *stream_;
+  int line_no_;
+
+  std::unique_ptr<ExportedSymbolSet> exported_symbols_;
+};
+
+
+}  // namespace abi_util
+
+
+#endif  // VERSION_SCRIPT_PARSER_H_
diff --git a/vndk/tools/header-checker/header-abi-util/src/abi_diff_helpers.cpp b/vndk/tools/header-checker/header-abi-util/src/abi_diff_helpers.cpp
index 3985c5b..2518825 100644
--- a/vndk/tools/header-checker/header-abi-util/src/abi_diff_helpers.cpp
+++ b/vndk/tools/header-checker/header-abi-util/src/abi_diff_helpers.cpp
@@ -1,5 +1,19 @@
-#include <abi_diff_helpers.h>
-#include <header_abi_util.h>
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "abi_diff_helpers.h"
+#include "header_abi_util.h"
 
 #include <llvm/Support/raw_ostream.h>
 
@@ -26,9 +40,9 @@
 }
 
 static void TypeQueueCheckAndPop(std::deque<std::string> *type_queue) {
- if (type_queue && !type_queue->empty()) {
-      type_queue->pop_back();
-    }
+  if (type_queue && !type_queue->empty()) {
+    type_queue->pop_back();
+  }
 }
 
 static bool IsAccessDownGraded(abi_util::AccessSpecifierIR old_access,
@@ -72,8 +86,7 @@
 }
 
 static void ReplaceEnumTypeIRTypeIdsWithTypeNames(
-    const AbiElementMap<const TypeIR *> &type_graph,
-    EnumTypeIR *enum_type_ir) {
+    const AbiElementMap<const TypeIR *> &type_graph, EnumTypeIR *enum_type_ir) {
   // Replace underlying type.
   enum_type_ir->SetUnderlyingType(
       ConvertTypeIdToString(type_graph, enum_type_ir->GetUnderlyingType()));
@@ -119,21 +132,20 @@
     LinkableMessageIR *lm) {
   switch (lm->GetKind()) {
     case FunctionKind:
-      ReplaceFunctionTypeIdsWithTypeNames(type_graph,
-                                          static_cast<FunctionIR *>(lm));
+      ReplaceFunctionTypeIdsWithTypeNames(
+          type_graph, static_cast<FunctionIR *>(lm));
       break;
     case GlobalVarKind:
-      ReplaceGlobalVarTypeIdsWithTypeNames(type_graph,
-                                           static_cast<GlobalVarIR *>(lm));
+      ReplaceGlobalVarTypeIdsWithTypeNames(
+          type_graph, static_cast<GlobalVarIR *>(lm));
       break;
     case RecordTypeKind:
-      ReplaceRecordTypeIRTypeIdsWithTypeNames(type_graph,
-                                              static_cast<RecordTypeIR *>(lm));
-
+      ReplaceRecordTypeIRTypeIdsWithTypeNames(
+          type_graph, static_cast<RecordTypeIR *>(lm));
       break;
     case EnumTypeKind:
-     ReplaceEnumTypeIRTypeIdsWithTypeNames(type_graph,
-                                           static_cast<EnumTypeIR *>(lm));
+      ReplaceEnumTypeIRTypeIdsWithTypeNames(
+          type_graph, static_cast<EnumTypeIR *>(lm));
       break;
     default:
       // This method should not be called on any other LinkableMessage
@@ -165,8 +177,8 @@
 
   enum_type_diff_ir->SetFieldsRemoved(std::move(removed_fields));
 
-  std::vector<std::pair<
-      const abi_util::EnumFieldIR *, const abi_util::EnumFieldIR *>> cf =
+  std::vector<std::pair<const abi_util::EnumFieldIR *,
+                        const abi_util::EnumFieldIR *>> cf =
       abi_util::FindCommonElements(old_fields_map, new_fields_map);
   std::vector<abi_util::EnumFieldDiffIR> enum_field_diffs;
   for (auto &&common_fields : cf) {
@@ -181,8 +193,8 @@
 
 DiffStatus AbiDiffHelper::CompareEnumTypes(
     const abi_util::EnumTypeIR *old_type, const abi_util::EnumTypeIR *new_type,
-     std::deque<std::string> *type_queue,
-     abi_util::DiffMessageIR::DiffKind diff_kind) {
+    std::deque<std::string> *type_queue,
+    abi_util::DiffMessageIR::DiffKind diff_kind) {
   if (old_type->GetUniqueId() != new_type->GetUniqueId()) {
     return DiffStatus::direct_diff;
   }
@@ -209,12 +221,34 @@
   return DiffStatus::no_diff;
 }
 
+static std::string RemoveThunkInfoFromMangledName(const std::string &name) {
+  if (name.find("_ZTv") != 0 && name.find("_ZTh") != 0 &&
+      name.find("_ZTc") != 0) {
+    return name;
+  }
+  size_t base_name_pos = name.find("N");
+  if (base_name_pos == std::string::npos) {
+    return name;
+  }
+  return "_Z" + name.substr(base_name_pos);
+}
+
 bool AbiDiffHelper::CompareVTableComponents(
     const abi_util::VTableComponentIR &old_component,
     const abi_util::VTableComponentIR &new_component) {
-  return old_component.GetName() == new_component.GetName() &&
-      old_component.GetValue() == new_component.GetValue() &&
-      old_component.GetKind() == new_component.GetKind();
+  // Vtable components in prebuilts/abi-dumps/vndk/28 don't have thunk info.
+  if (old_component.GetName() != new_component.GetName()) {
+    if (RemoveThunkInfoFromMangledName(old_component.GetName()) ==
+        RemoveThunkInfoFromMangledName(new_component.GetName())) {
+      llvm::errs() << "WARNING: Ignore difference between "
+                   << old_component.GetName() << " and "
+                   << new_component.GetName() << "\n";
+    } else {
+      return false;
+    }
+  }
+  return old_component.GetValue() == new_component.GetValue() &&
+         old_component.GetKind() == new_component.GetKind();
 }
 
 bool AbiDiffHelper::CompareVTables(
@@ -350,9 +384,8 @@
       abi_util::FindCommonElements(old_fields_map, new_fields_map);
   bool common_field_diff_exists = false;
   for (auto &&common_fields : cf) {
-    auto diffed_field_ptr = CompareCommonRecordFields(common_fields.first,
-                                                      common_fields.second,
-                                                      type_queue, diff_kind);
+    auto diffed_field_ptr = CompareCommonRecordFields(
+        common_fields.first, common_fields.second, type_queue, diff_kind);
     if (!common_field_diff_exists &&
         (diffed_field_ptr.first &
         (DiffStatus::direct_diff | DiffStatus::indirect_diff))) {
@@ -500,7 +533,7 @@
     return DiffStatus::indirect_diff;
   }
 
-  return  DiffStatus::no_diff;
+  return DiffStatus::no_diff;
 }
 
 DiffStatus AbiDiffHelper::CompareRecordTypes(
@@ -518,7 +551,7 @@
   }
   DiffStatus final_diff_status = DiffStatus::no_diff;
   record_type_diff_ir->SetName(old_type->GetName());
-  if (old_type->GetAccess() != new_type->GetAccess()) {
+  if (IsAccessDownGraded(old_type->GetAccess(), new_type->GetAccess())) {
     final_diff_status = DiffStatus::indirect_diff;
     record_type_diff_ir->SetAccessDiff(
         std::make_unique<abi_util::AccessSpecifierDiffIR>(
@@ -541,10 +574,9 @@
   }
   auto &old_fields_dup = old_type->GetFields();
   auto &new_fields_dup = new_type->GetFields();
-  auto field_status_and_diffs =
-      CompareRecordFields(old_fields_dup, new_fields_dup,
-                          type_queue, diff_kind);
-  // TODO: combine this with base class diffs as well.
+  auto field_status_and_diffs = CompareRecordFields(
+      old_fields_dup, new_fields_dup, type_queue, diff_kind);
+  // TODO: Combine this with base class diffs as well.
   final_diff_status = final_diff_status | field_status_and_diffs.diff_status_;
 
   std::vector<abi_util::CXXBaseSpecifierIR> old_bases = old_type->GetBases();
@@ -589,17 +621,17 @@
       llvm::errs() << "AddDiffMessage on record type failed\n";
       ::exit(1);
     }
-  } // Records cannot be 'extended' compatibly, without a certain amount of
-    // risk.
+  }
+
   final_diff_status = final_diff_status |
       CompareTemplateInfo(old_type->GetTemplateElements(),
                           new_type->GetTemplateElements(),
                           type_queue, diff_kind);
 
-  return
-      (final_diff_status &
-      (DiffStatus::direct_diff | DiffStatus::indirect_diff)) ?
-        DiffStatus::indirect_diff : DiffStatus::no_diff;
+  // Records cannot be 'extended' compatibly, without a certain amount of risk.
+  return ((final_diff_status &
+           (DiffStatus::direct_diff | DiffStatus::indirect_diff)) ?
+          DiffStatus::indirect_diff : DiffStatus::no_diff);
 }
 
 DiffStatus AbiDiffHelper::CompareLvalueReferenceTypes(
@@ -659,11 +691,8 @@
     const abi_util::BuiltinTypeIR *new_type) {
   // If the size, alignment and is_unsigned are the same, return no_diff
   // else return direct_diff.
-  uint64_t old_signedness = old_type->IsUnsigned();
-  uint64_t new_signedness = new_type->IsUnsigned();
-
   if (!CompareSizeAndAlignment(old_type, new_type) ||
-      old_signedness != new_signedness ||
+      old_type->IsUnsigned() != new_type->IsUnsigned() ||
       old_type->IsIntegralType() != new_type->IsIntegralType()) {
     return DiffStatus::direct_diff;
   }
@@ -713,11 +742,10 @@
   }
 
   if (kind == abi_util::LinkableMessageKind::EnumTypeKind) {
-      return CompareEnumTypes(
-          static_cast<const abi_util::EnumTypeIR *>(old_type),
-          static_cast<const abi_util::EnumTypeIR *>(new_type),
-          type_queue, diff_kind);
-
+    return CompareEnumTypes(
+        static_cast<const abi_util::EnumTypeIR *>(old_type),
+        static_cast<const abi_util::EnumTypeIR *>(new_type),
+        type_queue, diff_kind);
   }
 
   if (kind == abi_util::LinkableMessageKind::LvalueReferenceTypeKind) {
@@ -725,7 +753,6 @@
         static_cast<const abi_util::LvalueReferenceTypeIR *>(old_type),
         static_cast<const abi_util::LvalueReferenceTypeIR *>(new_type),
         type_queue, diff_kind);
-
   }
 
   if (kind == abi_util::LinkableMessageKind::RvalueReferenceTypeKind) {
@@ -770,28 +797,31 @@
     const std::string &old_type_id, const std::string &new_type_id,
     std::deque<std::string> *type_queue,
     abi_util::DiffMessageIR::DiffKind diff_kind) {
-
   // Check the map for type ids which have already been compared
   // These types have already been diffed, return without further comparison.
   if (!type_cache_->insert(old_type_id + new_type_id).second) {
     return DiffStatus::no_diff;
-  } else {
-    TypeQueueCheckAndPushBack(type_queue,
-                              ConvertTypeIdToString(old_types_,old_type_id));
   }
+
+  TypeQueueCheckAndPushBack(
+      type_queue, ConvertTypeIdToString(old_types_,old_type_id));
+
   AbiElementMap<const abi_util::TypeIR *>::const_iterator old_it =
       old_types_.find(old_type_id);
   AbiElementMap<const abi_util::TypeIR *>::const_iterator new_it =
       new_types_.find(new_type_id);
+
   if (old_it == old_types_.end() || new_it == new_types_.end()) {
     TypeQueueCheckAndPop(type_queue);
     // One of the types were hidden, we cannot compare further.
+    if (diff_policy_options_.consider_opaque_types_different_) {
+      return DiffStatus::opaque_diff;
+    }
     return DiffStatus::no_diff;
   }
-  abi_util::LinkableMessageKind old_kind =
-      old_it->second->GetKind();
-  abi_util::LinkableMessageKind new_kind =
-      new_it->second->GetKind();
+
+  abi_util::LinkableMessageKind old_kind = old_it->second->GetKind();
+  abi_util::LinkableMessageKind new_kind = new_it->second->GetKind();
   DiffStatus diff_status = DiffStatus::no_diff;
   if (old_kind != new_kind) {
     diff_status = CompareDistinctKindMessages(old_it->second, new_it->second);
@@ -799,8 +829,19 @@
     diff_status = CompareAndDumpTypeDiff(old_it->second , new_it->second ,
                                          old_kind, type_queue, diff_kind);
   }
+
   TypeQueueCheckAndPop(type_queue);
+
+  if (diff_policy_options_.consider_opaque_types_different_ &&
+      diff_status == DiffStatus::opaque_diff) {
+    // If `-considered-opaque-types-different` is specified and the comparison
+    // of `referenced_type` results in `opaque_diff`, then check the type name
+    // at this level.
+    return (old_it->second->GetName() == new_it->second->GetName() ?
+            DiffStatus::no_diff : DiffStatus::direct_diff);
+  }
+
   return diff_status;
 }
 
-} // namespace abi_util
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/api_level.cpp b/vndk/tools/header-checker/header-abi-util/src/api_level.cpp
new file mode 100644
index 0000000..dc0b216
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/api_level.cpp
@@ -0,0 +1,34 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "api_level.h"
+
+#include "string_utils.h"
+
+#include <cassert>
+#include <string>
+
+
+namespace abi_util {
+
+
+std::optional<ApiLevel> ParseApiLevel(const std::string &api_level_str) {
+  if (api_level_str == "current") {
+    return FUTURE_API_LEVEL;
+  }
+  return ParseInt(api_level_str);
+}
+
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/api_level_test.cpp b/vndk/tools/header-checker/header-abi-util/src/api_level_test.cpp
new file mode 100644
index 0000000..3f6008c
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/api_level_test.cpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "api_level.h"
+
+#include <gtest/gtest.h>
+
+
+namespace abi_util {
+
+
+TEST(ApiLevelTest, ParseApiLevel) {
+  EXPECT_FALSE(ParseApiLevel(""));
+  EXPECT_FALSE(ParseApiLevel("A"));
+
+  EXPECT_TRUE(ParseApiLevel("current").has_value());
+  EXPECT_EQ(FUTURE_API_LEVEL, ParseApiLevel("current").value());
+
+  EXPECT_TRUE(ParseApiLevel("16").has_value());
+  EXPECT_EQ(16l, ParseApiLevel("16").value());
+}
+
+
+}  // namespace abi_util
+
diff --git a/vndk/tools/header-checker/header-abi-util/src/collect_exported_headers.cpp b/vndk/tools/header-checker/header-abi-util/src/collect_exported_headers.cpp
index afdf76b..0b6b079 100644
--- a/vndk/tools/header-checker/header-abi-util/src/collect_exported_headers.cpp
+++ b/vndk/tools/header-checker/header-abi-util/src/collect_exported_headers.cpp
@@ -12,11 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <header_abi_util.h>
+#include "header_abi_util.h"
 
-#include <llvm/Support/raw_ostream.h>
 #include <llvm/Support/FileSystem.h>
 #include <llvm/Support/Path.h>
+#include <llvm/Support/raw_ostream.h>
 
 #include <set>
 #include <string>
@@ -25,16 +25,13 @@
 namespace abi_util {
 
 static bool ShouldSkipFile(llvm::StringRef &file_name) {
- // Ignore swap files and hidden files / dirs. Do not recurse into them too.
-  // We should also not look at source files. Many projects include source
-  // files in their exports.
-  if (file_name.empty() || file_name.startswith(".") ||
-      file_name.endswith(".swp") || file_name.endswith(".swo") ||
-      file_name.endswith("#") || file_name.endswith(".cpp") ||
-      file_name.endswith(".cc") || file_name.endswith(".c")) {
-    return true;
-  }
-  return false;
+  // Ignore swap files, hidden files, and hidden directories. Do not recurse
+  // into hidden directories either. We should also not look at source files.
+  // Many projects include source files in their exports.
+  return (file_name.empty() || file_name.startswith(".") ||
+          file_name.endswith(".swp") || file_name.endswith(".swo") ||
+          file_name.endswith("#") || file_name.endswith(".cpp") ||
+          file_name.endswith(".cc") || file_name.endswith(".c"));
 }
 
 std::string RealPath(const std::string &path) {
@@ -51,10 +48,10 @@
   llvm::sys::fs::recursive_directory_iterator walker(dir_name, ec);
   // Default construction - end of directory.
   llvm::sys::fs::recursive_directory_iterator end;
-  llvm::sys::fs::file_status status;
   for ( ; walker != end; walker.increment(ec)) {
     if (ec) {
-      llvm::errs() << "Failed to walk dir : " << dir_name << "\n";
+      llvm::errs() << "Failed to walk directory: " << dir_name << ": "
+                   << ec.message() << "\n";
       return false;
     }
 
@@ -69,13 +66,14 @@
       continue;
     }
 
-    if (walker->status(status)) {
-      llvm::errs() << "Failed to stat file : " << file_path << "\n";
+    llvm::ErrorOr<llvm::sys::fs::basic_file_status> status = walker->status();
+    if (!status) {
+      llvm::errs() << "Failed to stat file: " << file_path << "\n";
       return false;
     }
 
-    if ((status.type() != llvm::sys::fs::file_type::symlink_file) &&
-        !llvm::sys::fs::is_regular_file(status)) {
+    if ((status->type() != llvm::sys::fs::file_type::symlink_file) &&
+        (status->type() != llvm::sys::fs::file_type::regular_file)) {
       // Ignore non regular files, except symlinks.
       continue;
     }
@@ -97,4 +95,4 @@
   return exported_headers;
 }
 
-} // namespace abi_util
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/exported_symbol_set.cpp b/vndk/tools/header-checker/header-abi-util/src/exported_symbol_set.cpp
new file mode 100644
index 0000000..13958eb
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/exported_symbol_set.cpp
@@ -0,0 +1,99 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "exported_symbol_set.h"
+
+#include "ir_representation.h"
+#include "stl_utils.h"
+#include "string_utils.h"
+
+#include <fnmatch.h>
+#include <cxxabi.h>
+
+
+namespace abi_util {
+
+
+static inline bool IsCppSymbol(const std::string &name) {
+  return StartsWith(name, "_Z");
+}
+
+
+static inline bool HasMatchingGlobPattern(
+    const ExportedSymbolSet::GlobPatternSet &patterns, const char *text) {
+  for (auto &&pattern : patterns) {
+    if (fnmatch(pattern.c_str(), text, 0) == 0) {
+      return true;
+    }
+  }
+  return false;
+}
+
+
+static inline bool HasMatchingGlobPattern(
+    const ExportedSymbolSet::GlobPatternSet &patterns,
+    const std::string &text) {
+  return HasMatchingGlobPattern(patterns, text.c_str());
+}
+
+
+void ExportedSymbolSet::AddFunction(const std::string &name,
+                                    ElfSymbolIR::ElfSymbolBinding binding) {
+  funcs_.emplace(name, ElfFunctionIR(name, binding));
+}
+
+
+void ExportedSymbolSet::AddVar(const std::string &name,
+                               ElfSymbolIR::ElfSymbolBinding binding) {
+  vars_.emplace(name, ElfObjectIR(name, binding));
+}
+
+
+bool ExportedSymbolSet::HasSymbol(const std::string &name) const {
+  if (funcs_.find(name) != funcs_.end()) {
+    return true;
+  }
+
+  if (vars_.find(name) != vars_.end()) {
+    return true;
+  }
+
+  if (HasMatchingGlobPattern(glob_patterns_, name)) {
+    return true;
+  }
+
+  if (IsCppSymbol(name) && HasDemangledCppSymbolsOrPatterns()) {
+    std::unique_ptr<char, FreeDeleter> demangled_name_c_str(
+        abi::__cxa_demangle(name.c_str(), nullptr, nullptr, nullptr));
+
+    if (demangled_name_c_str) {
+      std::string_view demangled_name(demangled_name_c_str.get());
+
+      if (demangled_cpp_symbols_.find(demangled_name) !=
+          demangled_cpp_symbols_.end()) {
+        return true;
+      }
+
+      if (HasMatchingGlobPattern(demangled_cpp_glob_patterns_,
+                                 demangled_name_c_str.get())) {
+        return true;
+      }
+    }
+  }
+
+  return false;
+}
+
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/exported_symbol_set_test.cpp b/vndk/tools/header-checker/header-abi-util/src/exported_symbol_set_test.cpp
new file mode 100644
index 0000000..f292996
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/exported_symbol_set_test.cpp
@@ -0,0 +1,132 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "exported_symbol_set.h"
+
+#include "ir_representation.h"
+
+#include <gtest/gtest.h>
+
+
+namespace abi_util {
+
+
+TEST(ExportedSymbolSetTest, AddFunction) {
+  ExportedSymbolSet symbols;
+  symbols.AddFunction("global", ElfSymbolIR::ElfSymbolBinding::Global);
+  symbols.AddFunction("weak", ElfSymbolIR::ElfSymbolBinding::Weak);
+
+  const ExportedSymbolSet::FunctionMap &funcs = symbols.GetFunctions();
+
+  ASSERT_NE(funcs.end(), funcs.find("global"));
+  EXPECT_EQ(ElfSymbolIR::ElfSymbolBinding::Global,
+            funcs.at("global").GetBinding());
+
+  ASSERT_NE(funcs.end(), funcs.find("weak"));
+  EXPECT_EQ(ElfSymbolIR::ElfSymbolBinding::Weak,
+            funcs.at("weak").GetBinding());
+}
+
+
+TEST(ExportedSymbolSetTest, AddVar) {
+  ExportedSymbolSet symbols;
+  symbols.AddVar("global", ElfSymbolIR::ElfSymbolBinding::Global);
+  symbols.AddVar("weak", ElfSymbolIR::ElfSymbolBinding::Weak);
+
+  const ExportedSymbolSet::VarMap &vars = symbols.GetVars();
+
+  ASSERT_NE(vars.end(), vars.find("global"));
+  EXPECT_EQ(ElfSymbolIR::ElfSymbolBinding::Global,
+            vars.at("global").GetBinding());
+
+  ASSERT_NE(vars.end(), vars.find("weak"));
+  EXPECT_EQ(ElfSymbolIR::ElfSymbolBinding::Weak,
+            vars.at("weak").GetBinding());
+}
+
+
+TEST(ExportedSymbolSetTest, AddGlobPattern) {
+  ExportedSymbolSet symbols;
+  symbols.AddGlobPattern("test1*");
+
+  const ExportedSymbolSet::GlobPatternSet &globs = symbols.GetGlobPatterns();
+  ASSERT_NE(globs.end(), globs.find("test1*"));
+}
+
+
+TEST(ExportedSymbolSetTest, AddDemangledCppGlobPattern) {
+  ExportedSymbolSet symbols;
+  symbols.AddDemangledCppGlobPattern("test1*");
+
+  const ExportedSymbolSet::GlobPatternSet &globs =
+      symbols.GetDemangledCppGlobPatterns();
+  ASSERT_NE(globs.end(), globs.find("test1*"));
+}
+
+
+TEST(ExportedSymbolSetTest, AddDemangledCppSymbol) {
+  ExportedSymbolSet symbols;
+  symbols.AddDemangledCppSymbol("Test::test()");
+
+  const ExportedSymbolSet::NameSet &names = symbols.GetDemangledCppSymbols();
+  ASSERT_NE(names.end(), names.find("Test::test()"));
+}
+
+
+TEST(ExportedSymbolSetTest, HasSymbol) {
+  ExportedSymbolSet symbols;
+
+  symbols.AddFunction("global_func", ElfSymbolIR::ElfSymbolBinding::Global);
+  symbols.AddVar("global_var", ElfSymbolIR::ElfSymbolBinding::Global);
+
+  symbols.AddGlobPattern("test_glob1_*");
+  symbols.AddGlobPattern("test_glob2_[Aa]");
+  symbols.AddGlobPattern("test_glob3_?");
+
+  symbols.AddDemangledCppGlobPattern("Test1::*");
+  symbols.AddDemangledCppGlobPattern("Test2::[Aa]()");
+  symbols.AddDemangledCppGlobPattern("Test3::?()");
+  symbols.AddDemangledCppSymbol("Test4::test()");
+
+  // Test literal names
+  EXPECT_TRUE(symbols.HasSymbol("global_func"));
+  EXPECT_TRUE(symbols.HasSymbol("global_var"));
+
+  EXPECT_FALSE(symbols.HasSymbol(""));
+  EXPECT_FALSE(symbols.HasSymbol("no_such_function"));
+
+  // Test glob patterns
+  EXPECT_TRUE(symbols.HasSymbol("test_glob1_a"));
+  EXPECT_TRUE(symbols.HasSymbol("test_glob2_A"));
+  EXPECT_TRUE(symbols.HasSymbol("test_glob2_a"));
+  EXPECT_TRUE(symbols.HasSymbol("test_glob3_b"));
+
+  EXPECT_FALSE(symbols.HasSymbol("test_glob2_Ax"));
+  EXPECT_FALSE(symbols.HasSymbol("test_glob2_B"));
+  EXPECT_FALSE(symbols.HasSymbol("test_glob3_Bx"));
+
+  // Test C++ names and patterns
+  EXPECT_TRUE(symbols.HasSymbol("_ZN5Test14testEv"));
+  EXPECT_TRUE(symbols.HasSymbol("_ZN5Test21AEv"));
+  EXPECT_TRUE(symbols.HasSymbol("_ZN5Test21aEv"));
+  EXPECT_TRUE(symbols.HasSymbol("_ZN5Test31bEv"));
+  EXPECT_TRUE(symbols.HasSymbol("_ZN5Test44testEv"));
+
+  EXPECT_FALSE(symbols.HasSymbol("_ZN5Test22AxEv"));
+  EXPECT_FALSE(symbols.HasSymbol("_ZN5Test21bEv"));
+  EXPECT_FALSE(symbols.HasSymbol("_ZN5Test32BxEv"));
+}
+
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/ir_representation.cpp b/vndk/tools/header-checker/header-abi-util/src/ir_representation.cpp
index 8ccb5be..26dc22e 100644
--- a/vndk/tools/header-checker/header-abi-util/src/ir_representation.cpp
+++ b/vndk/tools/header-checker/header-abi-util/src/ir_representation.cpp
@@ -12,14 +12,16 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <abi_diff_helpers.h>
-#include <ir_representation.h>
-#include <ir_representation_protobuf.h>
+#include "ir_representation.h"
+
+#include "abi_diff_helpers.h"
+#include "ir_representation_json.h"
+#include "ir_representation_protobuf.h"
 
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunused-parameter"
 #pragma clang diagnostic ignored "-Wnested-anon-types"
-#include "proto/abi_dump.pb.h"
+#include "abi_dump.pb.h"
 #pragma clang diagnostic pop
 
 #include <google/protobuf/text_format.h>
@@ -30,7 +32,6 @@
 #include <string>
 #include <memory>
 
-
 namespace abi_util {
 
 using MergeStatus = TextFormatToIRReader::MergeStatus;
@@ -40,8 +41,9 @@
   switch (text_format) {
     case TextFormatIR::ProtobufTextFormat:
       return std::make_unique<ProtobufIRDumper>(dump_path);
+    case TextFormatIR::Json:
+      return std::make_unique<JsonIRDumper>(dump_path);
     default:
-      // Nothing else is supported yet.
       llvm::errs() << "Text format not supported yet\n";
       return nullptr;
   }
@@ -65,16 +67,16 @@
   switch (text_format) {
     case TextFormatIR::ProtobufTextFormat:
       return std::make_unique<ProtobufTextFormatToIRReader>(exported_headers);
+    case TextFormatIR::Json:
+      return std::make_unique<JsonToIRReader>(exported_headers);
     default:
-      // Nothing else is supported yet.
       llvm::errs() << "Text format not supported yet\n";
       return nullptr;
   }
 }
 
-void TextFormatToIRReader::AddToODRListMap(
-    const std::string &key,
-    const TypeIR *value) {
+void TextFormatToIRReader::AddToODRListMap(const std::string &key,
+                                           const TypeIR *value) {
   auto map_it = odr_list_map_.find(key);
   if (map_it == odr_list_map_.end()) {
     odr_list_map_.emplace(key, std::list<const TypeIR *>({value}));
@@ -110,9 +112,9 @@
     const TypeIR *ud_type, const TextFormatToIRReader &addend,
     const std::string ud_type_unique_id_and_source,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map_) {
-  // Per entry in the map :
+  // Per entry in the map:
   // /-----------------------------------------------------------------------\
-  // | UDType->UniqueTagId + UdType->source File => list(const UDTypeIR *)|
+  // | UDType->UniqueTagId + UdType->source File => list(const UDTypeIR *)   |
   // \-----------------------------------------------------------------------/
   auto it = odr_list_map_.find(ud_type_unique_id_and_source);
   if (it == odr_list_map_.end()) {
@@ -123,21 +125,22 @@
     return MergeStatus(true, "");
   }
   std::set<std::string> type_cache;
-  AbiDiffHelper diff_helper(type_graph_, addend.type_graph_, &type_cache,
+  DiffPolicyOptions diff_policy_options(false) ;
+  AbiDiffHelper diff_helper(type_graph_, addend.type_graph_,
+                            diff_policy_options, &type_cache,
                             nullptr, local_to_global_type_id_map_);
   for (auto &contender_ud : it->second) {
     if (diff_helper.CompareAndDumpTypeDiff(contender_ud->GetSelfType(),
-                                           ud_type->GetSelfType())
-        == DiffStatus::no_diff) {
-      local_to_global_type_id_map_->emplace(ud_type->GetSelfType(),
-                                            MergeStatus(
-                                                false,
-                                                contender_ud->GetSelfType()));
+                                           ud_type->GetSelfType()) ==
+        DiffStatus::no_diff) {
+      local_to_global_type_id_map_->emplace(
+          ud_type->GetSelfType(),
+          MergeStatus(false, contender_ud->GetSelfType()));
       return MergeStatus(false, contender_ud->GetSelfType());
     }
   }
 #ifdef DEBUG
-  llvm::errs() << "ODR violation detected for :" << ud_type->GetName() << "\n";
+  llvm::errs() << "ODR violation detected for: " << ud_type->GetName() << "\n";
 #endif
   return MergeStatus(true, (*(it->second.begin()))->GetSelfType());
 }
@@ -146,7 +149,7 @@
     const TypeIR *addend_node, const TextFormatToIRReader &addend,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
   std::string unique_type_id;
-  switch(addend_node->GetKind()) {
+  switch (addend_node->GetKind()) {
     case RecordTypeKind:
       unique_type_id =
           GetODRListMapKey(static_cast<const RecordTypeIR *>(addend_node));
@@ -176,41 +179,42 @@
     const TextFormatToIRReader &addend,
     ReferencesOtherType *references_type,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
-    // First look in the local_to_global_type_id_map for the referenced type's
-    // id.
-    const std::string &referenced_type_id =
-        references_type->GetReferencedType();
-    auto local_to_global_it = local_to_global_type_id_map->find(
-        referenced_type_id);
-    if (local_to_global_it != local_to_global_type_id_map->end()) {
-      // The type was already added to the parent graph. So change the
-      // referenced type to the global type id.
-      references_type->SetReferencedType(local_to_global_it->second.type_id_);
-      return local_to_global_it->second;
-    }
-    // If that did not go through, look at the addend's type_map_ and get the
-    // TypeIR* and call MergeType on it.
-    auto local_type_it = addend.type_graph_.find(referenced_type_id);
-    if (local_type_it != addend.type_graph_.end()) {
-      // We don't care about merge_status.was_newly_added since we wouldn't have
-      // gotten this far if we weren't adding this.
-      MergeStatus merge_status =
-          MergeType(local_type_it->second, addend,
-                    local_to_global_type_id_map);
-      const std::string &global_type_id = merge_status.type_id_;
-      references_type->SetReferencedType(global_type_id);
-      return merge_status;
-    }
-    // The referenced type was hidden, so just set it to type-hidden.
-   const std::string &hidden_type_id = AllocateNewTypeId();
-   references_type->SetReferencedType(hidden_type_id);
-   return MergeStatus(true, hidden_type_id);
+  // First look in the local_to_global_type_id_map for the referenced type's
+  // id.
+  const std::string &referenced_type_id =
+      references_type->GetReferencedType();
+  auto local_to_global_it = local_to_global_type_id_map->find(
+      referenced_type_id);
+  if (local_to_global_it != local_to_global_type_id_map->end()) {
+    // The type was already added to the parent graph. So change the
+    // referenced type to the global type id.
+    references_type->SetReferencedType(local_to_global_it->second.type_id_);
+    return local_to_global_it->second;
+  }
+
+  // If that did not go through, look at the addend's type_map_ and get the
+  // TypeIR* and call MergeType on it.
+  auto local_type_it = addend.type_graph_.find(referenced_type_id);
+  if (local_type_it != addend.type_graph_.end()) {
+    // We don't care about merge_status.was_newly_added since we wouldn't have
+    // gotten this far if we weren't adding this.
+    MergeStatus merge_status =
+        MergeType(local_type_it->second, addend, local_to_global_type_id_map);
+    const std::string &global_type_id = merge_status.type_id_;
+    references_type->SetReferencedType(global_type_id);
+    return merge_status;
+  }
+
+  // The referenced type was hidden, so just set it to type-hidden.
+  const std::string &hidden_type_id = AllocateNewTypeId();
+  references_type->SetReferencedType(hidden_type_id);
+  return MergeStatus(true, hidden_type_id);
 }
 
 void TextFormatToIRReader::MergeRecordFields(
     const TextFormatToIRReader &addend, RecordTypeIR *added_node,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
-  for(auto &field : added_node->GetFields()) {
+  for (auto &field : added_node->GetFields()) {
     MergeReferencingTypeInternal(addend, &field, local_to_global_type_id_map);
   }
 }
@@ -218,7 +222,7 @@
 void TextFormatToIRReader::MergeRecordCXXBases(
     const TextFormatToIRReader &addend, RecordTypeIR *added_node,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
-  for(auto &base : added_node->GetBases()) {
+  for (auto &base : added_node->GetBases()) {
     MergeReferencingTypeInternal(addend, &base, local_to_global_type_id_map);
   }
 }
@@ -226,9 +230,9 @@
 void TextFormatToIRReader::MergeRecordTemplateElements(
     const TextFormatToIRReader &addend, RecordTypeIR *added_node,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
-  for(auto &template_element : added_node->GetTemplateElements()) {
-    MergeReferencingTypeInternal(addend, &template_element,
-                         local_to_global_type_id_map);
+  for (auto &template_element : added_node->GetTemplateElements()) {
+    MergeReferencingTypeInternal(
+        addend, &template_element, local_to_global_type_id_map);
   }
 }
 
@@ -326,60 +330,61 @@
 MergeStatus TextFormatToIRReader::MergeReferencingTypeInternalAndUpdateParent(
     const TextFormatToIRReader &addend, const T *addend_node,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map,
-    AbiElementMap<T> *parent_map, const std::string  &updated_self_type_id) {
-    MergeStatus merge_status;
-    uint64_t old_max_type_id = max_type_id_;
-    // Create copy of addend_node
-      T added_node =
-          *(addend_node);
-      added_node.SetSelfType(updated_self_type_id);
-      // The merge status returned is the merge status of the referenced type.
-      merge_status = MergeReferencingTypeInternal(addend, &added_node,
-                                                  local_to_global_type_id_map);
-      if (merge_status.was_newly_added_) {
-        // Emplace to map (type-referenced -> Referencing type)
-        AddToMapAndTypeGraph(std::move(added_node), parent_map,
-                             &type_graph_);
-        return MergeStatus(true, updated_self_type_id);
-      }
-      // The type that the added_node references was not newly added to the parent
-      // graph. However, we still might need to add the added_node to the parent
-      // graph, since for the particular 'Kind' of the added_node, it may not be
-      // present in the parent graph. This will be determined by looking at the
-      // appropriate 'type-referenced' -> TypeElement map in the parent for the
-      // type-id returned by the MergeStatus. If the map doesn't have an entry for
-      // the type-id returned by the MergeStatus, the added_type is not present in
-      // the parent graph and needs to be 'newly' added. We also need to modify the
-      // global type id in the local_to_global_type_id map. The added_node should
-      // already have it's self_type and referenced_type fields fixed up.
-      // We maintain a rollback id to have contiguous type ids.
-      max_type_id_ = old_max_type_id;
-      // Try finding the referenced_type is referred to by any referencing type
-      // of the same kind in the parent graph. It is safe to call this on the
-      // added_node, since the referenced_type in the added_node would have been
-      // modified by the MergeReferencingTypeInternal call.
-      auto it = parent_map->find(GetReferencedTypeMapKey(added_node));
-      if (it == parent_map->end()) {
-        // There was no counterpart found for the added_node's type Kind referencing
-        // the referenced type, so we added it to the parent and also updated the
-        // local_to_global_type_id_map's global_id value.
-        AddToMapAndTypeGraph(std::move(added_node), parent_map,
-                             &type_graph_);
+    AbiElementMap<T> *parent_map, const std::string &updated_self_type_id) {
+  MergeStatus merge_status;
+  uint64_t old_max_type_id = max_type_id_;
+  // Create copy of addend_node
+  T added_node = *(addend_node);
+  added_node.SetSelfType(updated_self_type_id);
+  // The merge status returned is the merge status of the referenced type.
+  merge_status = MergeReferencingTypeInternal(addend, &added_node,
+                                              local_to_global_type_id_map);
+  if (merge_status.was_newly_added_) {
+    // Emplace to map (type-referenced -> Referencing type)
+    AddToMapAndTypeGraph(std::move(added_node), parent_map, &type_graph_);
+    return MergeStatus(true, updated_self_type_id);
+  }
 
-        merge_status = MergeStatus(true, updated_self_type_id);
-        return merge_status;
-      }
-      // Update local_to_global_type_id map's MergeStatus.was_newly_added  value for
-      // this key with false since this was node was not newly added.
-      // We never remove anything from the local_to_global_type_id_map, what's
-      // the point ? Since you store the decision of whether the type was newly
-      // added or not. It's global type id is the type-id of the element found
-      // in the parent map which refers to the added_node's modified
-      // referenced_type.
-      merge_status = MergeStatus(false, it->second.GetSelfType());
-      (*local_to_global_type_id_map)[addend_node->GetSelfType()] =
-          merge_status;
-      return merge_status;
+  // The type that the added_node references was not newly added to the parent
+  // graph. However, we still might need to add the added_node to the parent
+  // graph, since for the particular 'Kind' of the added_node, it may not be
+  // present in the parent graph. This will be determined by looking at the
+  // appropriate 'type-referenced' -> TypeElement map in the parent for the
+  // type-id returned by the MergeStatus. If the map doesn't have an entry for
+  // the type-id returned by the MergeStatus, the added_type is not present in
+  // the parent graph and needs to be 'newly' added. We also need to modify the
+  // global type id in the local_to_global_type_id map. The added_node should
+  // already have it's self_type and referenced_type fields fixed up.
+  // We maintain a rollback id to have contiguous type ids.
+  max_type_id_ = old_max_type_id;
+
+  // Try finding the referenced_type is referred to by any referencing type
+  // of the same kind in the parent graph. It is safe to call this on the
+  // added_node, since the referenced_type in the added_node would have been
+  // modified by the MergeReferencingTypeInternal call.
+  auto it = parent_map->find(GetReferencedTypeMapKey(added_node));
+  if (it == parent_map->end()) {
+    // There was no counterpart found for the added_node's type Kind referencing
+    // the referenced type, so we added it to the parent and also updated the
+    // local_to_global_type_id_map's global_id value.
+    AddToMapAndTypeGraph(std::move(added_node), parent_map,
+                         &type_graph_);
+
+    merge_status = MergeStatus(true, updated_self_type_id);
+    return merge_status;
+  }
+
+  // Update local_to_global_type_id map's MergeStatus.was_newly_added value for
+  // this key with false since this was node was not newly added.
+  // We never remove anything from the local_to_global_type_id_map, what's
+  // the point ? Since you store the decision of whether the type was newly
+  // added or not. It's global type id is the type-id of the element found
+  // in the parent map which refers to the added_node's modified
+  // referenced_type.
+  merge_status = MergeStatus(false, it->second.GetSelfType());
+  (*local_to_global_type_id_map)[addend_node->GetSelfType()] = merge_status;
+
+  return merge_status;
 }
 
 MergeStatus TextFormatToIRReader::MergeReferencingType(
@@ -434,7 +439,7 @@
 MergeStatus TextFormatToIRReader::MergeTypeInternal(
     const TypeIR *addend_node, const TextFormatToIRReader &addend,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
-  switch(addend_node->GetKind()) {
+  switch (addend_node->GetKind()) {
     case BuiltinTypeKind:
       return IsBuiltinTypeNodePresent(
           static_cast<const BuiltinTypeIR *>(addend_node), addend,
@@ -461,29 +466,28 @@
     const TypeIR *addend_node,
     const TextFormatToIRReader &addend,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
-    // Check if the addend type is already in the parent graph. Since we're
-    // going to traverse all the dependencies add whichever ones are not in the
-    // parent graph. This does not add the node itself though.
-    auto type_it =
-        local_to_global_type_id_map->find(addend_node->GetSelfType());
-    if (type_it != local_to_global_type_id_map->end()) {
-      return type_it->second;
-    }
+  // Check if the addend type is already in the parent graph. Since we're
+  // going to traverse all the dependencies add whichever ones are not in the
+  // parent graph. This does not add the node itself though.
+  auto type_it = local_to_global_type_id_map->find(addend_node->GetSelfType());
+  if (type_it != local_to_global_type_id_map->end()) {
+    return type_it->second;
+  }
 
-    MergeStatus merge_status = IsTypeNodePresent(addend_node, addend,
-                                                 local_to_global_type_id_map);
-    if (!merge_status.was_newly_added_) {
-      return merge_status;
-    }
-    merge_status = MergeTypeInternal(addend_node, addend,
-                                     local_to_global_type_id_map);
+  MergeStatus merge_status = IsTypeNodePresent(
+      addend_node, addend, local_to_global_type_id_map);
+  if (!merge_status.was_newly_added_) {
     return merge_status;
+  }
+  merge_status = MergeTypeInternal(
+      addend_node, addend, local_to_global_type_id_map);
+  return merge_status;
 }
 
 void TextFormatToIRReader::MergeCFunctionLikeDeps(
     const TextFormatToIRReader &addend, CFunctionLikeIR *cfunction_like_ir,
     AbiElementMap<MergeStatus> *local_to_global_type_id_map) {
- // Merge the return type first.
+  // Merge the return type first.
   auto ret_type_it =
       addend.type_graph_.find(cfunction_like_ir->GetReturnType());
   if (ret_type_it == addend.type_graph_.end()) {
@@ -571,5 +575,14 @@
     MergeGlobalVariable(&global_var_ir.second, addend, &merged_types_cache);
   }
 }
-} // namespace abi_util
 
+bool TextFormatToIRReader::IsLinkableMessageInExportedHeaders(
+    const LinkableMessageIR *linkable_message) const {
+  if (exported_headers_ == nullptr || exported_headers_->empty()) {
+    return true;
+  }
+  return exported_headers_->find(linkable_message->GetSourceFile()) !=
+         exported_headers_->end();
+}
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/ir_representation_json.cpp b/vndk/tools/header-checker/header-abi-util/src/ir_representation_json.cpp
new file mode 100644
index 0000000..c04b33e
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/ir_representation_json.cpp
@@ -0,0 +1,939 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "ir_representation_json.h"
+
+#include <json/reader.h>
+#include <json/writer.h>
+
+#include <llvm/Support/raw_ostream.h>
+
+#include <cstdlib>
+#include <fstream>
+#include <sstream>
+#include <string>
+
+namespace abi_util {
+
+// Conversion between IR enums and JSON strings.
+static const std::map<AccessSpecifierIR, std::string> access_ir_to_json{
+  {AccessSpecifierIR::PublicAccess, "public"},
+  {AccessSpecifierIR::ProtectedAccess, "protected"},
+  {AccessSpecifierIR::PrivateAccess, "private"},
+};
+
+static const std::map<std::string, AccessSpecifierIR>
+    access_json_to_ir(CreateInverseMap(access_ir_to_json));
+
+static const AccessSpecifierIR default_access_ir =
+    AccessSpecifierIR::PublicAccess;
+
+static const std::map<RecordTypeIR::RecordKind, std::string>
+    record_kind_ir_to_json{
+  {RecordTypeIR::RecordKind::struct_kind, "struct"},
+  {RecordTypeIR::RecordKind::class_kind, "class"},
+  {RecordTypeIR::RecordKind::union_kind, "union"},
+};
+
+static const std::map<std::string, RecordTypeIR::RecordKind>
+    record_kind_json_to_ir(CreateInverseMap(record_kind_ir_to_json));
+
+static const RecordTypeIR::RecordKind default_record_kind_ir =
+    RecordTypeIR::RecordKind::struct_kind;
+
+static const std::map<VTableComponentIR::Kind, std::string>
+    vtable_component_kind_ir_to_json{
+  {VTableComponentIR::Kind::VCallOffset, "vcall_offset"},
+  {VTableComponentIR::Kind::VBaseOffset, "vbase_offset"},
+  {VTableComponentIR::Kind::OffsetToTop, "offset_to_top"},
+  {VTableComponentIR::Kind::RTTI, "rtti"},
+  {VTableComponentIR::Kind::FunctionPointer, "function_pointer"},
+  {VTableComponentIR::Kind::CompleteDtorPointer, "complete_dtor_pointer"},
+  {VTableComponentIR::Kind::DeletingDtorPointer, "deleting_dtor_pointer"},
+  {VTableComponentIR::Kind::UnusedFunctionPointer, "unused_function_pointer"},
+};
+
+static const std::map<std::string, VTableComponentIR::Kind>
+    vtable_component_kind_json_to_ir(
+        CreateInverseMap(vtable_component_kind_ir_to_json));
+
+static const VTableComponentIR::Kind default_vtable_component_kind_ir =
+    VTableComponentIR::Kind::FunctionPointer;
+
+static const std::map<ElfSymbolIR::ElfSymbolBinding, std::string>
+    elf_symbol_binding_ir_to_json{
+  {ElfSymbolIR::ElfSymbolBinding::Weak, "weak"},
+  {ElfSymbolIR::ElfSymbolBinding::Global, "global"},
+};
+
+static const std::map<std::string, ElfSymbolIR::ElfSymbolBinding>
+    elf_symbol_binding_json_to_ir(
+        CreateInverseMap(elf_symbol_binding_ir_to_json));
+
+static const ElfSymbolIR::ElfSymbolBinding default_elf_symbol_binding_ir =
+    ElfSymbolIR::ElfSymbolBinding::Global;
+
+// If m contains k, this function returns the value.
+// Otherwise, it prints error_msg and exits.
+template <typename K, typename V>
+static inline const V &FindInMap(const std::map<K, V> &m, const K &k,
+                                 const std::string &error_msg) {
+  auto it = m.find(k);
+  if (it == m.end()) {
+    llvm::errs() << error_msg << "\n";
+    ::exit(1);
+  }
+  return it->second;
+}
+
+static const JsonObject json_empty_object;
+static const JsonArray json_empty_array;
+static const Json::Value json_0(0);
+static const Json::Value json_false(false);
+static const Json::Value json_empty_string("");
+
+void JsonObject::Set(const std::string &key, bool value) {
+  SetOmissible(key, value, false);
+}
+
+void JsonObject::Set(const std::string &key, uint64_t value) {
+  SetOmissible<Json::UInt64>(key, value, 0);
+}
+
+void JsonObject::Set(const std::string &key, int64_t value) {
+  SetOmissible<Json::Int64>(key, value, 0);
+}
+
+void JsonObject::Set(const std::string &key, const std::string &value) {
+  SetOmissible<const std::string &>(key, value, "");
+}
+
+void JsonObject::Set(const std::string &key, const JsonArray &value) {
+  SetOmissible(key, value, json_empty_array);
+}
+
+static void AddAccess(JsonObject &type_decl, AccessSpecifierIR value) {
+  if (value != default_access_ir) {
+    type_decl.Set("access",
+                  FindInMap(access_ir_to_json, value,
+                            "Failed to convert AccessSpecifierIR to JSON"));
+  }
+}
+
+static void AddRecordKind(JsonObject &record_type,
+                          RecordTypeIR::RecordKind value) {
+  if (value != default_record_kind_ir) {
+    record_type.Set("record_kind",
+                    FindInMap(record_kind_ir_to_json, value,
+                              "Failed to convert RecordKind to JSON"));
+  }
+}
+
+static void AddVtableComponentKind(JsonObject &vtable_component,
+                                   VTableComponentIR::Kind value) {
+  if (value != default_vtable_component_kind_ir) {
+    vtable_component.Set(
+        "kind", FindInMap(vtable_component_kind_ir_to_json, value,
+                          "Failed to convert VTableComponentIR::Kind to JSON"));
+  }
+}
+
+static void AddElfSymbolBinding(JsonObject &elf_symbol,
+                                ElfSymbolIR::ElfSymbolBinding value) {
+  if (value != default_elf_symbol_binding_ir) {
+    elf_symbol.Set("binding",
+                   FindInMap(elf_symbol_binding_ir_to_json, value,
+                             "Failed to convert ElfSymbolBinding to JSON"));
+  }
+}
+
+void IRToJsonConverter::AddTemplateInfo(
+    JsonObject &type_decl, const TemplatedArtifactIR *template_ir) {
+  JsonArray args;
+  for (auto &&template_element_ir : template_ir->GetTemplateElements()) {
+    args.append(template_element_ir.GetReferencedType());
+  }
+  type_decl.Set("template_args", args);
+}
+
+void IRToJsonConverter::AddTypeInfo(JsonObject &type_decl,
+                                    const TypeIR *type_ir) {
+  type_decl.Set("linker_set_key", type_ir->GetLinkerSetKey());
+  type_decl.Set("source_file", type_ir->GetSourceFile());
+  type_decl.Set("name", type_ir->GetName());
+  type_decl.Set("size", (uint64_t)type_ir->GetSize());
+  type_decl.Set("alignment", (uint64_t)type_ir->GetAlignment());
+  type_decl.Set("referenced_type", type_ir->GetReferencedType());
+  type_decl.Set("self_type", type_ir->GetSelfType());
+}
+
+static JsonObject ConvertRecordFieldIR(const RecordFieldIR *record_field_ir) {
+  JsonObject record_field;
+  record_field.Set("field_name", record_field_ir->GetName());
+  record_field.Set("referenced_type", record_field_ir->GetReferencedType());
+  AddAccess(record_field, record_field_ir->GetAccess());
+  record_field.Set("field_offset", (uint64_t)record_field_ir->GetOffset());
+  return record_field;
+}
+
+void IRToJsonConverter::AddRecordFields(JsonObject &record_type,
+                                        const RecordTypeIR *record_ir) {
+  JsonArray fields;
+  for (auto &&field_ir : record_ir->GetFields()) {
+    fields.append(ConvertRecordFieldIR(&field_ir));
+  }
+  record_type.Set("fields", fields);
+}
+
+static JsonObject
+ConvertBaseSpecifierIR(const CXXBaseSpecifierIR &base_specifier_ir) {
+  JsonObject base_specifier;
+  base_specifier.Set("referenced_type", base_specifier_ir.GetReferencedType());
+  base_specifier.Set("is_virtual", base_specifier_ir.IsVirtual());
+  AddAccess(base_specifier, base_specifier_ir.GetAccess());
+  return base_specifier;
+}
+
+void IRToJsonConverter::AddBaseSpecifiers(JsonObject &record_type,
+                                          const RecordTypeIR *record_ir) {
+  JsonArray base_specifiers;
+  for (auto &&base_ir : record_ir->GetBases()) {
+    base_specifiers.append(ConvertBaseSpecifierIR(base_ir));
+  }
+  record_type.Set("base_specifiers", base_specifiers);
+}
+
+static JsonObject
+ConvertVTableComponentIR(const VTableComponentIR &vtable_component_ir) {
+  JsonObject vtable_component;
+  AddVtableComponentKind(vtable_component, vtable_component_ir.GetKind());
+  vtable_component.Set("component_value",
+                       (int64_t)vtable_component_ir.GetValue());
+  vtable_component.Set("mangled_component_name", vtable_component_ir.GetName());
+  vtable_component.Set("is_pure", vtable_component_ir.GetIsPure());
+  return vtable_component;
+}
+
+void IRToJsonConverter::AddVTableLayout(JsonObject &record_type,
+                                        const RecordTypeIR *record_ir) {
+  JsonArray vtable_components;
+  for (auto &&vtable_component_ir :
+       record_ir->GetVTableLayout().GetVTableComponents()) {
+    vtable_components.append(ConvertVTableComponentIR(vtable_component_ir));
+  }
+  record_type.Set("vtable_components", vtable_components);
+}
+
+void IRToJsonConverter::AddTagTypeInfo(JsonObject &type_decl,
+                                       const TagTypeIR *tag_type_ir) {
+  type_decl.Set("unique_id", tag_type_ir->GetUniqueId());
+}
+
+JsonObject IRToJsonConverter::ConvertRecordTypeIR(const RecordTypeIR *recordp) {
+  JsonObject record_type;
+
+  AddAccess(record_type, recordp->GetAccess());
+  AddRecordKind(record_type, recordp->GetRecordKind());
+  record_type.Set("is_anonymous", recordp->IsAnonymous());
+  AddTypeInfo(record_type, recordp);
+  AddRecordFields(record_type, recordp);
+  AddBaseSpecifiers(record_type, recordp);
+  AddVTableLayout(record_type, recordp);
+  AddTagTypeInfo(record_type, recordp);
+  AddTemplateInfo(record_type, recordp);
+  return record_type;
+}
+
+void IRToJsonConverter::AddFunctionParametersAndSetReturnType(
+    JsonObject &function, const CFunctionLikeIR *cfunction_like_ir) {
+  function.Set("return_type", cfunction_like_ir->GetReturnType());
+  AddFunctionParameters(function, cfunction_like_ir);
+}
+
+void IRToJsonConverter::AddFunctionParameters(
+    JsonObject &function, const CFunctionLikeIR *cfunction_like_ir) {
+  JsonArray parameters;
+  for (auto &&parameter_ir : cfunction_like_ir->GetParameters()) {
+    JsonObject parameter;
+    parameter.Set("referenced_type", parameter_ir.GetReferencedType());
+    parameter.Set("default_arg", parameter_ir.GetIsDefault());
+    parameter.Set("is_this_ptr", parameter_ir.GetIsThisPtr());
+    parameters.append(parameter);
+  }
+  function.Set("parameters", parameters);
+}
+
+JsonObject
+IRToJsonConverter::ConvertFunctionTypeIR(const FunctionTypeIR *function_typep) {
+  JsonObject function_type;
+  AddTypeInfo(function_type, function_typep);
+  AddFunctionParametersAndSetReturnType(function_type, function_typep);
+  return function_type;
+}
+
+JsonObject IRToJsonConverter::ConvertFunctionIR(const FunctionIR *functionp) {
+  JsonObject function;
+  AddAccess(function, functionp->GetAccess());
+  function.Set("linker_set_key", functionp->GetLinkerSetKey());
+  function.Set("source_file", functionp->GetSourceFile());
+  function.Set("function_name", functionp->GetName());
+  AddFunctionParametersAndSetReturnType(function, functionp);
+  AddTemplateInfo(function, functionp);
+  return function;
+}
+
+static JsonObject ConvertEnumFieldIR(const EnumFieldIR *enum_field_ir) {
+  JsonObject enum_field;
+  enum_field.Set("name", enum_field_ir->GetName());
+  // Never omit enum values.
+  enum_field["enum_field_value"] = Json::Int64(enum_field_ir->GetValue());
+  return enum_field;
+}
+
+void IRToJsonConverter::AddEnumFields(JsonObject &enum_type,
+                                      const EnumTypeIR *enum_ir) {
+  JsonArray enum_fields;
+  for (auto &&field : enum_ir->GetFields()) {
+    enum_fields.append(ConvertEnumFieldIR(&field));
+  }
+  enum_type.Set("enum_fields", enum_fields);
+}
+
+JsonObject IRToJsonConverter::ConvertEnumTypeIR(const EnumTypeIR *enump) {
+  JsonObject enum_type;
+  AddAccess(enum_type, enump->GetAccess());
+  enum_type.Set("underlying_type", enump->GetUnderlyingType());
+  AddTypeInfo(enum_type, enump);
+  AddEnumFields(enum_type, enump);
+  AddTagTypeInfo(enum_type, enump);
+  return enum_type;
+}
+
+JsonObject
+IRToJsonConverter::ConvertGlobalVarIR(const GlobalVarIR *global_varp) {
+  JsonObject global_var;
+  global_var.Set("referenced_type", global_varp->GetReferencedType());
+  global_var.Set("source_file", global_varp->GetSourceFile());
+  global_var.Set("name", global_varp->GetName());
+  global_var.Set("linker_set_key", global_varp->GetLinkerSetKey());
+  AddAccess(global_var, global_varp->GetAccess());
+  return global_var;
+}
+
+JsonObject
+IRToJsonConverter::ConvertPointerTypeIR(const PointerTypeIR *pointerp) {
+  JsonObject pointer_type;
+  AddTypeInfo(pointer_type, pointerp);
+  return pointer_type;
+}
+
+JsonObject
+IRToJsonConverter::ConvertQualifiedTypeIR(const QualifiedTypeIR *qualtypep) {
+  JsonObject qualified_type;
+  AddTypeInfo(qualified_type, qualtypep);
+  qualified_type.Set("is_const", qualtypep->IsConst());
+  qualified_type.Set("is_volatile", qualtypep->IsVolatile());
+  qualified_type.Set("is_restricted", qualtypep->IsRestricted());
+  return qualified_type;
+}
+
+JsonObject
+IRToJsonConverter::ConvertBuiltinTypeIR(const BuiltinTypeIR *builtin_typep) {
+  JsonObject builtin_type;
+  builtin_type.Set("is_unsigned", builtin_typep->IsUnsigned());
+  builtin_type.Set("is_integral", builtin_typep->IsIntegralType());
+  AddTypeInfo(builtin_type, builtin_typep);
+  return builtin_type;
+}
+
+JsonObject
+IRToJsonConverter::ConvertArrayTypeIR(const ArrayTypeIR *array_typep) {
+  JsonObject array_type;
+  AddTypeInfo(array_type, array_typep);
+  return array_type;
+}
+
+JsonObject IRToJsonConverter::ConvertLvalueReferenceTypeIR(
+    const LvalueReferenceTypeIR *lvalue_reference_typep) {
+  JsonObject lvalue_reference_type;
+  AddTypeInfo(lvalue_reference_type, lvalue_reference_typep);
+  return lvalue_reference_type;
+}
+
+JsonObject IRToJsonConverter::ConvertRvalueReferenceTypeIR(
+    const RvalueReferenceTypeIR *rvalue_reference_typep) {
+  JsonObject rvalue_reference_type;
+  AddTypeInfo(rvalue_reference_type, rvalue_reference_typep);
+  return rvalue_reference_type;
+}
+
+bool JsonIRDumper::AddLinkableMessageIR(const LinkableMessageIR *lm) {
+  std::string key;
+  JsonObject converted;
+  // No RTTI
+  switch (lm->GetKind()) {
+  case RecordTypeKind:
+    key = "record_types";
+    converted = ConvertRecordTypeIR(static_cast<const RecordTypeIR *>(lm));
+    break;
+  case EnumTypeKind:
+    key = "enum_types";
+    converted = ConvertEnumTypeIR(static_cast<const EnumTypeIR *>(lm));
+    break;
+  case PointerTypeKind:
+    key = "pointer_types";
+    converted = ConvertPointerTypeIR(static_cast<const PointerTypeIR *>(lm));
+    break;
+  case QualifiedTypeKind:
+    key = "qualified_types";
+    converted =
+        ConvertQualifiedTypeIR(static_cast<const QualifiedTypeIR *>(lm));
+    break;
+  case ArrayTypeKind:
+    key = "array_types";
+    converted = ConvertArrayTypeIR(static_cast<const ArrayTypeIR *>(lm));
+    break;
+  case LvalueReferenceTypeKind:
+    key = "lvalue_reference_types";
+    converted = ConvertLvalueReferenceTypeIR(
+        static_cast<const LvalueReferenceTypeIR *>(lm));
+    break;
+  case RvalueReferenceTypeKind:
+    key = "rvalue_reference_types";
+    converted = ConvertRvalueReferenceTypeIR(
+        static_cast<const RvalueReferenceTypeIR *>(lm));
+    break;
+  case BuiltinTypeKind:
+    key = "builtin_types";
+    converted = ConvertBuiltinTypeIR(static_cast<const BuiltinTypeIR *>(lm));
+    break;
+  case FunctionTypeKind:
+    key = "function_types";
+    converted = ConvertFunctionTypeIR(static_cast<const FunctionTypeIR *>(lm));
+    break;
+  case GlobalVarKind:
+    key = "global_vars";
+    converted = ConvertGlobalVarIR(static_cast<const GlobalVarIR *>(lm));
+    break;
+  case FunctionKind:
+    key = "functions";
+    converted = ConvertFunctionIR(static_cast<const FunctionIR *>(lm));
+    break;
+  default:
+    return false;
+  }
+  translation_unit_[key].append(converted);
+  return true;
+}
+
+bool JsonIRDumper::AddElfSymbolMessageIR(const ElfSymbolIR *elf_symbol_ir) {
+  std::string key;
+  switch (elf_symbol_ir->GetKind()) {
+  case ElfSymbolIR::ElfFunctionKind:
+    key = "elf_functions";
+    break;
+  case ElfSymbolIR::ElfObjectKind:
+    key = "elf_objects";
+    break;
+  default:
+    return false;
+  }
+  JsonObject elf_symbol;
+  elf_symbol.Set("name", elf_symbol_ir->GetName());
+  AddElfSymbolBinding(elf_symbol, elf_symbol_ir->GetBinding());
+  translation_unit_[key].append(elf_symbol);
+  return true;
+}
+
+static std::string DumpJson(const JsonObject &obj) {
+  std::ostringstream output_stream;
+  Json::StyledStreamWriter writer(/* indentation */ " ");
+  writer.write(output_stream, obj);
+  return output_stream.str();
+}
+
+static void WriteTailTrimmedLinesToFile(const std::string &path,
+                                        const std::string &output_string) {
+  std::ofstream output_file(path);
+  size_t line_start = 0;
+  while (line_start < output_string.size()) {
+    size_t trailing_space_start = line_start;
+    size_t index;
+    for (index = line_start;
+         index < output_string.size() && output_string[index] != '\n';
+         index++) {
+      if (output_string[index] != ' ') {
+        trailing_space_start = index + 1;
+      }
+    }
+    // Only write this line if this line contains non-whitespace characters.
+    if (trailing_space_start != line_start) {
+      output_file.write(output_string.data() + line_start,
+                        trailing_space_start - line_start);
+      output_file.write("\n", 1);
+    }
+    line_start = index + 1;
+  }
+}
+
+bool JsonIRDumper::Dump() {
+  std::string output_string = DumpJson(translation_unit_);
+  WriteTailTrimmedLinesToFile(dump_path_, output_string);
+  return true;
+}
+
+JsonIRDumper::JsonIRDumper(const std::string &dump_path)
+    : IRDumper(dump_path), translation_unit_() {
+  const std::string keys[] = {
+    "record_types",
+    "enum_types",
+    "pointer_types",
+    "lvalue_reference_types",
+    "rvalue_reference_types",
+    "builtin_types",
+    "qualified_types",
+    "array_types",
+    "function_types",
+    "functions",
+    "global_vars",
+    "elf_functions",
+    "elf_objects",
+  };
+  for (auto key : keys) {
+    translation_unit_[key] = JsonArray();
+  }
+}
+
+JsonObjectRef::JsonObjectRef(const Json::Value &json_value, bool &ok)
+    : object_(json_value.isObject() ? json_value : json_empty_object), ok_(ok) {
+  if (!json_value.isObject()) {
+    ok_ = false;
+  }
+}
+
+const Json::Value &
+JsonObjectRef::Get(const std::string &key, const Json::Value &default_value,
+                   IsExpectedJsonType is_expected_type) const {
+  if (!object_.isMember(key)) {
+    return default_value;
+  }
+  const Json::Value &value = object_[key];
+  if (!(value.*is_expected_type)()) {
+    ok_ = false;
+    return default_value;
+  }
+  return value;
+}
+
+bool JsonObjectRef::GetBool(const std::string &key) const {
+  return Get(key, json_false, &Json::Value::isBool).asBool();
+}
+
+int64_t JsonObjectRef::GetInt(const std::string &key) const {
+  return Get(key, json_0, &Json::Value::isIntegral).asInt64();
+}
+
+uint64_t JsonObjectRef::GetUint(const std::string &key) const {
+  return Get(key, json_0, &Json::Value::isIntegral).asUInt64();
+}
+
+std::string JsonObjectRef::GetString(const std::string &key) const {
+  return Get(key, json_empty_string, &Json::Value::isString).asString();
+}
+
+JsonObjectRef JsonObjectRef::GetObject(const std::string &key) const {
+  return JsonObjectRef(Get(key, json_empty_object, &Json::Value::isObject),
+                       ok_);
+}
+
+JsonArrayRef<JsonObjectRef>
+JsonObjectRef::GetObjects(const std::string &key) const {
+  return JsonArrayRef<JsonObjectRef>(
+      Get(key, json_empty_array, &Json::Value::isArray), ok_);
+}
+
+JsonArrayRef<std::string>
+JsonObjectRef::GetStrings(const std::string &key) const {
+  return JsonArrayRef<std::string>(
+      Get(key, json_empty_array, &Json::Value::isArray), ok_);
+}
+
+template <>
+JsonObjectRef JsonArrayRef<JsonObjectRef>::Iterator::operator*() const {
+  return JsonObjectRef(array_[index_], ok_);
+}
+
+template <> std::string JsonArrayRef<std::string>::Iterator::operator*() const {
+  return array_[index_].asString();
+}
+
+static AccessSpecifierIR GetAccess(const JsonObjectRef &type_decl) {
+  std::string access(type_decl.GetString("access"));
+  if (access.empty()) {
+    return default_access_ir;
+  }
+  return FindInMap(access_json_to_ir, access,
+                   "Failed to convert JSON to AccessSpecifierIR");
+}
+
+static RecordTypeIR::RecordKind
+GetRecordKind(const JsonObjectRef &record_type) {
+  std::string kind(record_type.GetString("record_kind"));
+  if (kind.empty()) {
+    return default_record_kind_ir;
+  }
+  return FindInMap(record_kind_json_to_ir, kind,
+                   "Failed to convert JSON to RecordKind");
+}
+
+static VTableComponentIR::Kind
+GetVTableComponentKind(const JsonObjectRef &vtable_component) {
+  std::string kind(vtable_component.GetString("kind"));
+  if (kind.empty()) {
+    return default_vtable_component_kind_ir;
+  }
+  return FindInMap(vtable_component_kind_json_to_ir, kind,
+                   "Failed to convert JSON to VTableComponentIR::Kind");
+}
+
+static ElfSymbolIR::ElfSymbolBinding
+GetElfSymbolBinding(const JsonObjectRef &elf_symbol) {
+  std::string binding(elf_symbol.GetString("binding"));
+  if (binding.empty()) {
+    return default_elf_symbol_binding_ir;
+  }
+  return FindInMap(elf_symbol_binding_json_to_ir, binding,
+                   "Failed to convert JSON to ElfSymbolBinding");
+}
+
+bool JsonToIRReader::ReadDump(const std::string &dump_file) {
+  Json::Value tu_json;
+  Json::Reader reader;
+  std::ifstream input(dump_file);
+
+  if (!reader.parse(input, tu_json, /* collectComments */ false)) {
+    llvm::errs() << "Failed to parse JSON: "
+                 << reader.getFormattedErrorMessages() << "\n";
+    return false;
+  }
+  bool ok = true;
+  JsonObjectRef tu(tu_json, ok);
+  if (!ok) {
+    llvm::errs() << "Translation unit is not an object\n";
+    return false;
+  }
+
+  ReadFunctions(tu);
+  ReadGlobalVariables(tu);
+  ReadEnumTypes(tu);
+  ReadRecordTypes(tu);
+  ReadFunctionTypes(tu);
+  ReadArrayTypes(tu);
+  ReadPointerTypes(tu);
+  ReadQualifiedTypes(tu);
+  ReadBuiltinTypes(tu);
+  ReadLvalueReferenceTypes(tu);
+  ReadRvalueReferenceTypes(tu);
+  ReadElfFunctions(tu);
+  ReadElfObjects(tu);
+  if (!ok) {
+    llvm::errs() << "Failed to convert JSON to IR\n";
+    return false;
+  }
+  return true;
+}
+
+void JsonToIRReader::ReadTagTypeInfo(const JsonObjectRef &type_decl,
+                                     TagTypeIR *tag_type_ir) {
+  tag_type_ir->SetUniqueId(type_decl.GetString("unique_id"));
+}
+
+void JsonToIRReader::ReadTemplateInfo(const JsonObjectRef &type_decl,
+                                      TemplatedArtifactIR *template_ir) {
+  TemplateInfoIR template_info_ir;
+  for (auto &&referenced_type : type_decl.GetStrings("template_args")) {
+    TemplateElementIR template_element_ir(referenced_type);
+    template_info_ir.AddTemplateElement(std::move(template_element_ir));
+  }
+  template_ir->SetTemplateInfo(std::move(template_info_ir));
+}
+
+void JsonToIRReader::ReadTypeInfo(const JsonObjectRef &type_decl,
+                                  TypeIR *type_ir) {
+  type_ir->SetLinkerSetKey(type_decl.GetString("linker_set_key"));
+  type_ir->SetSourceFile(type_decl.GetString("source_file"));
+  type_ir->SetName(type_decl.GetString("name"));
+  type_ir->SetReferencedType(type_decl.GetString("referenced_type"));
+  type_ir->SetSelfType(type_decl.GetString("self_type"));
+  type_ir->SetSize(type_decl.GetUint("size"));
+  type_ir->SetAlignment(type_decl.GetUint("alignment"));
+}
+
+void JsonToIRReader::ReadRecordFields(const JsonObjectRef &record_type,
+                                      RecordTypeIR *record_ir) {
+  for (auto &&field : record_type.GetObjects("fields")) {
+    RecordFieldIR record_field_ir(
+        field.GetString("field_name"), field.GetString("referenced_type"),
+        field.GetUint("field_offset"), GetAccess(field));
+    record_ir->AddRecordField(std::move(record_field_ir));
+  }
+}
+
+void JsonToIRReader::ReadBaseSpecifiers(const JsonObjectRef &record_type,
+                                        RecordTypeIR *record_ir) {
+  for (auto &&base_specifier : record_type.GetObjects("base_specifiers")) {
+    CXXBaseSpecifierIR record_base_ir(
+        base_specifier.GetString("referenced_type"),
+        base_specifier.GetBool("is_virtual"), GetAccess(base_specifier));
+    record_ir->AddCXXBaseSpecifier(std::move(record_base_ir));
+  }
+}
+
+void JsonToIRReader::ReadVTableLayout(const JsonObjectRef &record_type,
+                                      RecordTypeIR *record_ir) {
+  VTableLayoutIR vtable_layout_ir;
+  for (auto &&vtable_component : record_type.GetObjects("vtable_components")) {
+    VTableComponentIR vtable_component_ir(
+        vtable_component.GetString("mangled_component_name"),
+        GetVTableComponentKind(vtable_component),
+        vtable_component.GetInt("component_value"),
+        vtable_component.GetBool("is_pure"));
+    vtable_layout_ir.AddVTableComponent(std::move(vtable_component_ir));
+  }
+  record_ir->SetVTableLayout(std::move(vtable_layout_ir));
+}
+
+void JsonToIRReader::ReadEnumFields(const JsonObjectRef &enum_type,
+                                    EnumTypeIR *enum_ir) {
+  for (auto &&field : enum_type.GetObjects("enum_fields")) {
+    EnumFieldIR enum_field_ir(field.GetString("name"),
+                              field.GetInt("enum_field_value"));
+    enum_ir->AddEnumField(std::move(enum_field_ir));
+  }
+}
+
+void JsonToIRReader::ReadFunctionParametersAndReturnType(
+    const JsonObjectRef &function, CFunctionLikeIR *function_ir) {
+  function_ir->SetReturnType(function.GetString("return_type"));
+  for (auto &&parameter : function.GetObjects("parameters")) {
+    ParamIR param_ir(parameter.GetString("referenced_type"),
+                     parameter.GetBool("default_arg"),
+                     parameter.GetBool("is_this_ptr"));
+    function_ir->AddParameter(std::move(param_ir));
+  }
+}
+
+FunctionIR JsonToIRReader::FunctionJsonToIR(const JsonObjectRef &function) {
+  FunctionIR function_ir;
+  function_ir.SetLinkerSetKey(function.GetString("linker_set_key"));
+  function_ir.SetName(function.GetString("function_name"));
+  function_ir.SetAccess(GetAccess(function));
+  function_ir.SetSourceFile(function.GetString("source_file"));
+  ReadFunctionParametersAndReturnType(function, &function_ir);
+  ReadTemplateInfo(function, &function_ir);
+  return function_ir;
+}
+
+FunctionTypeIR
+JsonToIRReader::FunctionTypeJsonToIR(const JsonObjectRef &function_type) {
+  FunctionTypeIR function_type_ir;
+  ReadTypeInfo(function_type, &function_type_ir);
+  ReadFunctionParametersAndReturnType(function_type, &function_type_ir);
+  return function_type_ir;
+}
+
+RecordTypeIR
+JsonToIRReader::RecordTypeJsonToIR(const JsonObjectRef &record_type) {
+  RecordTypeIR record_type_ir;
+  ReadTypeInfo(record_type, &record_type_ir);
+  ReadTemplateInfo(record_type, &record_type_ir);
+  record_type_ir.SetAccess(GetAccess(record_type));
+  ReadVTableLayout(record_type, &record_type_ir);
+  ReadRecordFields(record_type, &record_type_ir);
+  ReadBaseSpecifiers(record_type, &record_type_ir);
+  record_type_ir.SetRecordKind(GetRecordKind(record_type));
+  record_type_ir.SetAnonymity(record_type.GetBool("is_anonymous"));
+  ReadTagTypeInfo(record_type, &record_type_ir);
+  return record_type_ir;
+}
+
+EnumTypeIR JsonToIRReader::EnumTypeJsonToIR(const JsonObjectRef &enum_type) {
+  EnumTypeIR enum_type_ir;
+  ReadTypeInfo(enum_type, &enum_type_ir);
+  enum_type_ir.SetUnderlyingType(enum_type.GetString("underlying_type"));
+  enum_type_ir.SetAccess(GetAccess(enum_type));
+  ReadEnumFields(enum_type, &enum_type_ir);
+  ReadTagTypeInfo(enum_type, &enum_type_ir);
+  return enum_type_ir;
+}
+
+void JsonToIRReader::ReadGlobalVariables(const JsonObjectRef &tu) {
+  for (auto &&global_variable : tu.GetObjects("global_vars")) {
+    GlobalVarIR global_variable_ir;
+    global_variable_ir.SetName(global_variable.GetString("name"));
+    global_variable_ir.SetAccess(GetAccess(global_variable));
+    global_variable_ir.SetSourceFile(global_variable.GetString("source_file"));
+    global_variable_ir.SetReferencedType(
+        global_variable.GetString("referenced_type"));
+    global_variable_ir.SetLinkerSetKey(
+        global_variable.GetString("linker_set_key"));
+    if (!IsLinkableMessageInExportedHeaders(&global_variable_ir)) {
+      continue;
+    }
+    global_variables_.insert(
+        {global_variable_ir.GetLinkerSetKey(), std::move(global_variable_ir)});
+  }
+}
+
+void JsonToIRReader::ReadPointerTypes(const JsonObjectRef &tu) {
+  for (auto &&pointer_type : tu.GetObjects("pointer_types")) {
+    PointerTypeIR pointer_type_ir;
+    ReadTypeInfo(pointer_type, &pointer_type_ir);
+    if (!IsLinkableMessageInExportedHeaders(&pointer_type_ir)) {
+      continue;
+    }
+    AddToMapAndTypeGraph(std::move(pointer_type_ir), &pointer_types_,
+                         &type_graph_);
+  }
+}
+
+void JsonToIRReader::ReadBuiltinTypes(const JsonObjectRef &tu) {
+  for (auto &&builtin_type : tu.GetObjects("builtin_types")) {
+    BuiltinTypeIR builtin_type_ir;
+    ReadTypeInfo(builtin_type, &builtin_type_ir);
+    builtin_type_ir.SetSignedness(builtin_type.GetBool("is_unsigned"));
+    builtin_type_ir.SetIntegralType(builtin_type.GetBool("is_integral"));
+    AddToMapAndTypeGraph(std::move(builtin_type_ir), &builtin_types_,
+                         &type_graph_);
+  }
+}
+
+void JsonToIRReader::ReadQualifiedTypes(const JsonObjectRef &tu) {
+  for (auto &&qualified_type : tu.GetObjects("qualified_types")) {
+    QualifiedTypeIR qualified_type_ir;
+    ReadTypeInfo(qualified_type, &qualified_type_ir);
+    qualified_type_ir.SetConstness(qualified_type.GetBool("is_const"));
+    qualified_type_ir.SetVolatility(qualified_type.GetBool("is_volatile"));
+    qualified_type_ir.SetRestrictedness(
+        qualified_type.GetBool("is_restricted"));
+    if (!IsLinkableMessageInExportedHeaders(&qualified_type_ir)) {
+      continue;
+    }
+    AddToMapAndTypeGraph(std::move(qualified_type_ir), &qualified_types_,
+                         &type_graph_);
+  }
+}
+
+void JsonToIRReader::ReadArrayTypes(const JsonObjectRef &tu) {
+  for (auto &&array_type : tu.GetObjects("array_types")) {
+    ArrayTypeIR array_type_ir;
+    ReadTypeInfo(array_type, &array_type_ir);
+    if (!IsLinkableMessageInExportedHeaders(&array_type_ir)) {
+      continue;
+    }
+    AddToMapAndTypeGraph(std::move(array_type_ir), &array_types_, &type_graph_);
+  }
+}
+
+void JsonToIRReader::ReadLvalueReferenceTypes(const JsonObjectRef &tu) {
+  for (auto &&lvalue_reference_type : tu.GetObjects("lvalue_reference_types")) {
+    LvalueReferenceTypeIR lvalue_reference_type_ir;
+    ReadTypeInfo(lvalue_reference_type, &lvalue_reference_type_ir);
+    if (!IsLinkableMessageInExportedHeaders(&lvalue_reference_type_ir)) {
+      continue;
+    }
+    AddToMapAndTypeGraph(std::move(lvalue_reference_type_ir),
+                         &lvalue_reference_types_, &type_graph_);
+  }
+}
+
+void JsonToIRReader::ReadRvalueReferenceTypes(const JsonObjectRef &tu) {
+  for (auto &&rvalue_reference_type : tu.GetObjects("rvalue_reference_types")) {
+    RvalueReferenceTypeIR rvalue_reference_type_ir;
+    ReadTypeInfo(rvalue_reference_type, &rvalue_reference_type_ir);
+    if (!IsLinkableMessageInExportedHeaders(&rvalue_reference_type_ir)) {
+      continue;
+    }
+    AddToMapAndTypeGraph(std::move(rvalue_reference_type_ir),
+                         &rvalue_reference_types_, &type_graph_);
+  }
+}
+
+void JsonToIRReader::ReadFunctions(const JsonObjectRef &tu) {
+  for (auto &&function : tu.GetObjects("functions")) {
+    FunctionIR function_ir = FunctionJsonToIR(function);
+    if (!IsLinkableMessageInExportedHeaders(&function_ir)) {
+      continue;
+    }
+    functions_.insert({function_ir.GetLinkerSetKey(), std::move(function_ir)});
+  }
+}
+
+void JsonToIRReader::ReadRecordTypes(const JsonObjectRef &tu) {
+  for (auto &&record_type : tu.GetObjects("record_types")) {
+    RecordTypeIR record_type_ir = RecordTypeJsonToIR(record_type);
+    if (!IsLinkableMessageInExportedHeaders(&record_type_ir)) {
+      continue;
+    }
+    auto it = AddToMapAndTypeGraph(std::move(record_type_ir), &record_types_,
+                                   &type_graph_);
+    const std::string &key = GetODRListMapKey(&(it->second));
+    AddToODRListMap(key, &(it->second));
+  }
+}
+
+void JsonToIRReader::ReadFunctionTypes(const JsonObjectRef &tu) {
+  for (auto &&function_type : tu.GetObjects("function_types")) {
+    FunctionTypeIR function_type_ir = FunctionTypeJsonToIR(function_type);
+    if (!IsLinkableMessageInExportedHeaders(&function_type_ir)) {
+      continue;
+    }
+    auto it = AddToMapAndTypeGraph(std::move(function_type_ir),
+                                   &function_types_, &type_graph_);
+    const std::string &key = GetODRListMapKey(&(it->second));
+    AddToODRListMap(key, &(it->second));
+  }
+}
+
+void JsonToIRReader::ReadEnumTypes(const JsonObjectRef &tu) {
+  for (auto &&enum_type : tu.GetObjects("enum_types")) {
+    EnumTypeIR enum_type_ir = EnumTypeJsonToIR(enum_type);
+    if (!IsLinkableMessageInExportedHeaders(&enum_type_ir)) {
+      continue;
+    }
+    auto it = AddToMapAndTypeGraph(std::move(enum_type_ir), &enum_types_,
+                                   &type_graph_);
+    AddToODRListMap(it->second.GetUniqueId() + it->second.GetSourceFile(),
+                    (&it->second));
+  }
+}
+
+void JsonToIRReader::ReadElfFunctions(const JsonObjectRef &tu) {
+  for (auto &&elf_function : tu.GetObjects("elf_functions")) {
+    ElfFunctionIR elf_function_ir(elf_function.GetString("name"),
+                                  GetElfSymbolBinding(elf_function));
+    elf_functions_.insert(
+        {elf_function_ir.GetName(), std::move(elf_function_ir)});
+  }
+}
+
+void JsonToIRReader::ReadElfObjects(const JsonObjectRef &tu) {
+  for (auto &&elf_object : tu.GetObjects("elf_objects")) {
+    ElfObjectIR elf_object_ir(elf_object.GetString("name"),
+                              GetElfSymbolBinding(elf_object));
+    elf_objects_.insert({elf_object_ir.GetName(), std::move(elf_object_ir)});
+  }
+}
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/ir_representation_protobuf.cpp b/vndk/tools/header-checker/header-abi-util/src/ir_representation_protobuf.cpp
index 972ec39..5951555 100644
--- a/vndk/tools/header-checker/header-abi-util/src/ir_representation_protobuf.cpp
+++ b/vndk/tools/header-checker/header-abi-util/src/ir_representation_protobuf.cpp
@@ -12,30 +12,19 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <ir_representation_protobuf.h>
+#include "ir_representation_protobuf.h"
 
 #include <llvm/Support/raw_ostream.h>
 
 #include <fstream>
 #include <iostream>
-#include <string>
 #include <memory>
+#include <string>
 
 namespace abi_util {
 
-static bool IsPresentInExportedHeaders(
-    const LinkableMessageIR &linkable_message,
-    const std::set<std::string> *exported_headers) {
-  if (exported_headers == nullptr || exported_headers->empty()) {
-    return true;
-  }
-  return exported_headers->find(linkable_message.GetSourceFile())
-      != exported_headers->end();
-}
-
 void ProtobufTextFormatToIRReader::ReadTypeInfo(
-    const abi_dump::BasicNamedAndTypedDecl &type_info,
-    TypeIR *typep) {
+    const abi_dump::BasicNamedAndTypedDecl &type_info, TypeIR *typep) {
   typep->SetLinkerSetKey(type_info.linker_set_key());
   typep->SetName(type_info.name());
   typep->SetSourceFile(type_info.source_file());
@@ -82,7 +71,7 @@
   return template_info_ir;
 }
 
-template< typename T>
+template <typename T>
 static void SetupCFunctionLikeIR(const T &cfunction_like_protobuf,
                                  CFunctionLikeIR *cfunction_like_ir) {
   cfunction_like_ir->SetReturnType(cfunction_like_protobuf.return_type());
@@ -128,7 +117,8 @@
     VTableComponentIR vtable_component_ir(
         vtable_component.mangled_component_name(),
         VTableComponentKindProtobufToIR(vtable_component.kind()),
-        vtable_component.component_value());
+        vtable_component.component_value(),
+        vtable_component.is_pure());
     vtable_layout_ir.AddVTableComponent(std::move(vtable_component_ir));
   }
   return vtable_layout_ir;
@@ -216,7 +206,7 @@
         global_variable_protobuf.referenced_type());
     global_variable_ir.SetLinkerSetKey(
         global_variable_protobuf.linker_set_key());
-    if (!IsPresentInExportedHeaders(global_variable_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&global_variable_ir)) {
       continue;
     }
     global_variables_.insert(
@@ -229,7 +219,7 @@
   for (auto &&pointer_type_protobuf : tu.pointer_types()) {
     PointerTypeIR pointer_type_ir;
     ReadTypeInfo(pointer_type_protobuf.type_info(), &pointer_type_ir);
-    if (!IsPresentInExportedHeaders(pointer_type_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&pointer_type_ir)) {
       continue;
     }
     AddToMapAndTypeGraph(std::move(pointer_type_ir), &pointer_types_,
@@ -258,7 +248,7 @@
     qualified_type_ir.SetVolatility(qualified_type_protobuf.is_volatile());
     qualified_type_ir.SetRestrictedness(
         qualified_type_protobuf.is_restricted());
-    if (!IsPresentInExportedHeaders(qualified_type_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&qualified_type_ir)) {
       continue;
     }
     AddToMapAndTypeGraph(std::move(qualified_type_ir), &qualified_types_,
@@ -271,7 +261,7 @@
   for (auto &&array_type_protobuf : tu.array_types()) {
     ArrayTypeIR array_type_ir;
     ReadTypeInfo(array_type_protobuf.type_info(), &array_type_ir);
-    if (!IsPresentInExportedHeaders(array_type_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&array_type_ir)) {
       continue;
     }
     AddToMapAndTypeGraph(std::move(array_type_ir), &array_types_,
@@ -285,8 +275,7 @@
     LvalueReferenceTypeIR lvalue_reference_type_ir;
     ReadTypeInfo(lvalue_reference_type_protobuf.type_info(),
                  &lvalue_reference_type_ir);
-    if (!IsPresentInExportedHeaders(lvalue_reference_type_ir,
-                                    exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&lvalue_reference_type_ir)) {
       continue;
     }
     AddToMapAndTypeGraph(std::move(lvalue_reference_type_ir),
@@ -300,8 +289,7 @@
     RvalueReferenceTypeIR rvalue_reference_type_ir;
     ReadTypeInfo(rvalue_reference_type_protobuf.type_info(),
                  &rvalue_reference_type_ir);
-    if (!IsPresentInExportedHeaders(rvalue_reference_type_ir,
-                                    exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&rvalue_reference_type_ir)) {
       continue;
     }
     AddToMapAndTypeGraph(std::move(rvalue_reference_type_ir),
@@ -313,7 +301,7 @@
     const abi_dump::TranslationUnit &tu) {
   for (auto &&function_protobuf : tu.functions()) {
     FunctionIR function_ir = FunctionProtobufToIR(function_protobuf);
-    if (!IsPresentInExportedHeaders(function_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&function_ir)) {
       continue;
     }
     functions_.insert({function_ir.GetLinkerSetKey(), std::move(function_ir)});
@@ -324,7 +312,7 @@
     const abi_dump::TranslationUnit &tu) {
   for (auto &&record_type_protobuf : tu.record_types()) {
     RecordTypeIR record_type_ir = RecordTypeProtobufToIR(record_type_protobuf);
-    if (!IsPresentInExportedHeaders(record_type_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&record_type_ir)) {
       continue;
     }
     auto it = AddToMapAndTypeGraph(std::move(record_type_ir), &record_types_,
@@ -339,7 +327,7 @@
   for (auto &&function_type_protobuf : tu.function_types()) {
     FunctionTypeIR function_type_ir =
         FunctionTypeProtobufToIR(function_type_protobuf);
-    if (!IsPresentInExportedHeaders(function_type_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&function_type_ir)) {
       continue;
     }
     auto it = AddToMapAndTypeGraph(std::move(function_type_ir),
@@ -353,7 +341,7 @@
     const abi_dump::TranslationUnit &tu) {
   for (auto &&enum_type_protobuf : tu.enum_types()) {
     EnumTypeIR enum_type_ir = EnumTypeProtobufToIR(enum_type_protobuf);
-    if (!IsPresentInExportedHeaders(enum_type_ir, exported_headers_)) {
+    if (!IsLinkableMessageInExportedHeaders(&enum_type_ir)) {
       continue;
     }
     auto it = AddToMapAndTypeGraph(std::move(enum_type_ir), &enum_types_,
@@ -366,7 +354,9 @@
 void ProtobufTextFormatToIRReader::ReadElfFunctions(
     const abi_dump::TranslationUnit &tu) {
   for (auto &&elf_function : tu.elf_functions()) {
-    ElfFunctionIR elf_function_ir(elf_function.name());
+    ElfFunctionIR elf_function_ir(
+        elf_function.name(),
+        ElfSymbolBindingProtobufToIR(elf_function.binding()));
     elf_functions_.insert(
         {elf_function_ir.GetName(), std::move(elf_function_ir)});
   }
@@ -375,7 +365,8 @@
 void ProtobufTextFormatToIRReader::ReadElfObjects(
     const abi_dump::TranslationUnit &tu) {
   for (auto &&elf_object : tu.elf_objects()) {
-    ElfObjectIR elf_object_ir(elf_object.name());
+    ElfObjectIR elf_object_ir(
+        elf_object.name(), ElfSymbolBindingProtobufToIR(elf_object.binding()));
     elf_objects_.insert(
         {elf_object_ir.GetName(), std::move(elf_object_ir)});
   }
@@ -395,8 +386,7 @@
 }
 
 bool IRToProtobufConverter::AddTypeInfo(
-    abi_dump::BasicNamedAndTypedDecl *type_info,
-    const TypeIR *typep) {
+    abi_dump::BasicNamedAndTypedDecl *type_info, const TypeIR *typep) {
   if (!type_info || !typep) {
     llvm::errs() << "Typeinfo not valid\n";
     return false;
@@ -484,6 +474,7 @@
     added_vtable_component->set_component_value(vtable_component_ir.GetValue());
     added_vtable_component->set_mangled_component_name(
         vtable_component_ir.GetName());
+    added_vtable_component->set_is_pure(vtable_component_ir.GetIsPure());
   }
   return true;
 }
@@ -529,8 +520,8 @@
       !AddVTableLayout(&added_record_type, recordp) ||
       !AddTagTypeInfo(added_record_type.mutable_tag_info(), recordp) ||
       !(recordp->GetTemplateElements().size() ?
-       AddTemplateInformation(added_record_type.mutable_template_info(),
-                              recordp) : true)) {
+        AddTemplateInformation(added_record_type.mutable_template_info(),
+                               recordp) : true)) {
     llvm::errs() << "Template information could not be added\n";
     ::exit(1);
   }
@@ -619,7 +610,7 @@
 }
 
 bool IRToProtobufConverter::AddEnumFields(abi_dump::EnumType *enum_protobuf,
-                                     const EnumTypeIR *enum_ir) {
+                                          const EnumTypeIR *enum_ir) {
   for (auto &&field : enum_ir->GetFields()) {
     abi_dump::EnumFieldDecl *enum_fieldp = enum_protobuf->add_enum_fields();
     if (!SetIRToProtobufEnumField(enum_fieldp, &field)) {
@@ -844,8 +835,8 @@
     abi_diff::TypeInfoDiff *type_info_diff =
         record_type_diff_protobuf.mutable_type_info_diff();
     if (!AddTypeInfoDiff(type_info_diff, type_diff_ir)) {
-        llvm::errs() << "RecordType could not be converted\n";
-       ::exit(1);
+      llvm::errs() << "RecordType could not be converted\n";
+      ::exit(1);
     }
   }
   // If vtables differ.
@@ -863,7 +854,7 @@
   // If base specifiers differ.
   const CXXBaseSpecifierDiffIR *base_specifier_diff_ir =
       record_type_diff_ir->GetBaseSpecifiers();
-  if ( base_specifier_diff_ir != nullptr) {
+  if (base_specifier_diff_ir != nullptr) {
     abi_diff::CXXBaseSpecifierDiff *base_specifier_diff_protobuf =
         record_type_diff_protobuf.mutable_bases_diff();
     if (!AddBaseSpecifierDiffs(base_specifier_diff_protobuf,
@@ -933,9 +924,9 @@
   const std::pair<std::string, std::string> *underlying_type_diff =
       enum_type_diff_ir->GetUnderlyingTypeDiff();
   if ((underlying_type_diff != nullptr &&
-      !AddEnumUnderlyingTypeDiff(
-          enum_type_diff_protobuf.mutable_underlying_type_diff(),
-          underlying_type_diff)) ||
+       !AddEnumUnderlyingTypeDiff(
+           enum_type_diff_protobuf.mutable_underlying_type_diff(),
+           underlying_type_diff)) ||
       !AddEnumFields(enum_type_diff_protobuf.mutable_fields_removed(),
                      enum_type_diff_ir->GetFieldsRemoved()) ||
       !AddEnumFields(enum_type_diff_protobuf.mutable_fields_added(),
@@ -977,12 +968,10 @@
     llvm::errs() << "Function diff could not be added\n";
     ::exit(1);
   }
-  *old_function =
-      IRToProtobufConverter::ConvertFunctionIR(
-          function_diff_ir->GetOldFunction());
-  *new_function =
-      IRToProtobufConverter::ConvertFunctionIR(
-          function_diff_ir->GetNewFunction());
+  *old_function = IRToProtobufConverter::ConvertFunctionIR(
+      function_diff_ir->GetOldFunction());
+  *new_function = IRToProtobufConverter::ConvertFunctionIR(
+      function_diff_ir->GetNewFunction());
   return function_diff;
 }
 
@@ -1023,6 +1012,8 @@
     return false;
   }
   added_elf_function->set_name(elf_function->GetName());
+  added_elf_function->set_binding(
+      ElfSymbolBindingIRToProtobuf(elf_function->GetBinding()));
   return true;
 }
 
@@ -1032,6 +1023,8 @@
     return false;
   }
   added_elf_object->set_name(elf_object->GetName());
+  added_elf_object->set_binding(
+      ElfSymbolBindingIRToProtobuf(elf_object->GetBinding()));
   return true;
 }
 
@@ -1198,8 +1191,8 @@
         combined_status | CompatibilityStatusIR::UnreferencedChanges;
   }
 
-  if(diff_tu_->removed_elf_functions().size() != 0 ||
-     diff_tu_->removed_elf_objects().size() != 0) {
+  if (diff_tu_->removed_elf_functions().size() != 0 ||
+      diff_tu_->removed_elf_objects().size() != 0) {
     combined_status = combined_status | CompatibilityStatusIR::ElfIncompatible;
   }
 
@@ -1211,38 +1204,33 @@
   diff_tu_->set_compatibility_status(CompatibilityStatusIRToProtobuf(status));
 }
 
-bool ProtobufIRDiffDumper::AddDiffMessageIR(
-    const DiffMessageIR *message,
-    const std::string &type_stack,
-    DiffKind diff_kind) {
+bool ProtobufIRDiffDumper::AddDiffMessageIR(const DiffMessageIR *message,
+                                            const std::string &type_stack,
+                                            DiffKind diff_kind) {
   switch (message->Kind()) {
     case RecordTypeKind:
       return AddRecordTypeDiffIR(
-          static_cast<const RecordTypeDiffIR *>(message),
-          type_stack, diff_kind);
+          static_cast<const RecordTypeDiffIR *>(message), type_stack,
+          diff_kind);
     case EnumTypeKind:
       return AddEnumTypeDiffIR(
-          static_cast<const EnumTypeDiffIR *>(message),
-          type_stack, diff_kind);
+          static_cast<const EnumTypeDiffIR *>(message), type_stack, diff_kind);
     case GlobalVarKind:
       return AddGlobalVarDiffIR(
-          static_cast<const GlobalVarDiffIR*>(message),
-          type_stack, diff_kind);
+          static_cast<const GlobalVarDiffIR*>(message), type_stack, diff_kind);
     case FunctionKind:
       return AddFunctionDiffIR(
-          static_cast<const FunctionDiffIR*>(message),
-          type_stack, diff_kind);
+          static_cast<const FunctionDiffIR*>(message), type_stack, diff_kind);
     default:
       break;
   }
-  llvm::errs() << "Dump Diff attempted on something not a user defined type" <<
-                   "/ function / global variable\n";
+  llvm::errs() << "Dump Diff attempted on something not a user defined type / "
+               << "function / global variable\n";
   return false;
 }
 
 bool ProtobufIRDiffDumper::AddLinkableMessageIR(
-    const LinkableMessageIR *message,
-    DiffKind diff_kind) {
+    const LinkableMessageIR *message, DiffKind diff_kind) {
   switch (message->GetKind()) {
     case RecordTypeKind:
       return AddLoneRecordTypeDiffIR(
@@ -1259,13 +1247,13 @@
     default:
       break;
   }
-  llvm::errs() << "Dump Diff attempted on something not a user defined type" <<
-                   "/ function / global variable\n";
+  llvm::errs() << "Dump Diff attempted on something not a user defined type / "
+               << "function / global variable\n";
   return false;
 }
 
-bool ProtobufIRDiffDumper::AddElfSymbolMessageIR (const ElfSymbolIR *elf_symbol,
-                                                  DiffKind diff_kind) {
+bool ProtobufIRDiffDumper::AddElfSymbolMessageIR(const ElfSymbolIR *elf_symbol,
+                                                 DiffKind diff_kind) {
   switch (elf_symbol->GetKind()) {
     case ElfSymbolIR::ElfFunctionKind:
       return AddElfFunctionIR(static_cast<const ElfFunctionIR *>(elf_symbol),
@@ -1283,7 +1271,7 @@
 bool ProtobufIRDiffDumper::AddElfFunctionIR(
     const ElfFunctionIR *elf_function_ir, DiffKind diff_kind) {
   abi_dump::ElfFunction *added_elf_function = nullptr;
-  switch(diff_kind) {
+  switch (diff_kind) {
     case DiffKind::Removed:
       added_elf_function = diff_tu_->add_removed_elf_functions();
       break;
@@ -1305,7 +1293,7 @@
 bool ProtobufIRDiffDumper::AddElfObjectIR(
     const ElfObjectIR *elf_object_ir, DiffKind diff_kind) {
   abi_dump::ElfObject *added_elf_object = nullptr;
-  switch(diff_kind) {
+  switch (diff_kind) {
     case DiffKind::Removed:
       added_elf_object = diff_tu_->add_removed_elf_objects();
       break;
@@ -1325,8 +1313,7 @@
 }
 
 bool ProtobufIRDiffDumper::AddLoneRecordTypeDiffIR(
-    const RecordTypeIR *record_type_ir,
-    DiffKind diff_kind) {
+    const RecordTypeIR *record_type_ir, DiffKind diff_kind) {
   abi_dump::RecordType *added_record_type = nullptr;
   switch (diff_kind) {
     case DiffKind::Removed:
@@ -1351,8 +1338,7 @@
 }
 
 bool ProtobufIRDiffDumper::AddLoneFunctionDiffIR(
-    const FunctionIR *function_ir,
-    DiffKind diff_kind) {
+    const FunctionIR *function_ir, DiffKind diff_kind) {
   abi_dump::FunctionDecl *added_function = nullptr;
   switch (diff_kind) {
     case DiffKind::Removed:
@@ -1412,8 +1398,7 @@
 }
 
 bool ProtobufIRDiffDumper::AddRecordTypeDiffIR(
-    const RecordTypeDiffIR *record_diff_ir,
-    const std::string &type_stack,
+    const RecordTypeDiffIR *record_diff_ir, const std::string &type_stack,
     DiffKind diff_kind) {
   abi_diff::RecordTypeDiff *added_record_type_diff = nullptr;
   switch (diff_kind) {
@@ -1485,8 +1470,7 @@
 }
 
 bool ProtobufIRDiffDumper::AddGlobalVarDiffIR(
-    const GlobalVarDiffIR *global_var_diff_ir,
-    const std::string &type_stack,
+    const GlobalVarDiffIR *global_var_diff_ir, const std::string &type_stack,
     DiffKind diff_kind) {
   abi_diff::GlobalVarDeclDiff *added_global_var_diff =
       diff_tu_->add_global_var_diffs();
@@ -1506,4 +1490,4 @@
   return google::protobuf::TextFormat::Print(*diff_tu_.get(), &text_os);
 }
 
-} //abi_util
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/so_file_parser.cpp b/vndk/tools/header-checker/header-abi-util/src/so_file_parser.cpp
index 14a90a2..001f9b9 100644
--- a/vndk/tools/header-checker/header-abi-util/src/so_file_parser.cpp
+++ b/vndk/tools/header-checker/header-abi-util/src/so_file_parser.cpp
@@ -12,107 +12,148 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <header_abi_util.h>
+#include "so_file_parser.h"
 
-#include <llvm/Object/ELFObjectFile.h>
+#include "ir_representation.h"
+
 #include <llvm/Object/Binary.h>
+#include <llvm/Object/ELFObjectFile.h>
 #include <llvm/Object/ELFTypes.h>
 #include <llvm/Object/SymbolSize.h>
 
-using llvm::object::ELF32LEObjectFile;
-using llvm::object::ELF32BEObjectFile;
-using llvm::object::ELF64LEObjectFile;
-using llvm::object::ELF64BEObjectFile;
-using llvm::dyn_cast;
-using llvm::ELF::STV_DEFAULT;
-using llvm::ELF::STV_PROTECTED;
-using llvm::ELF::STB_WEAK;
-using llvm::ELF::STB_GLOBAL;
 
 namespace abi_util {
 
+
 template <typename T>
-static inline T UnWrap(llvm::Expected<T> ValueOrError) {
-    if (!ValueOrError) {
-      llvm::errs() << "\nError: "
-               << llvm::toString(ValueOrError.takeError())
-               << ".\n";
-      llvm::errs().flush();
-      exit(1);
-    }
-    return std::move(ValueOrError.get());
+static inline T UnWrap(llvm::Expected<T> value_or_error) {
+  if (!value_or_error) {
+    llvm::errs() << "\nerror: " << llvm::toString(value_or_error.takeError())
+                 << ".\n";
+    llvm::errs().flush();
+    exit(1);
+  }
+  return std::move(value_or_error.get());
 }
 
-template<typename T>
-const std::set<std::string> &ELFSoFileParser<T>::GetFunctions() const {
-  return functions_;
+
+static abi_util::ElfSymbolIR::ElfSymbolBinding
+LLVMToIRSymbolBinding(unsigned char binding) {
+  switch (binding) {
+    case llvm::ELF::STB_GLOBAL:
+      return abi_util::ElfSymbolIR::ElfSymbolBinding::Global;
+    case llvm::ELF::STB_WEAK:
+      return abi_util::ElfSymbolIR::ElfSymbolBinding::Weak;
+  }
+  assert(0);
 }
 
-template<typename T>
-const std::set<std::string> &ELFSoFileParser<T>::GetGlobVars() const {
-  return globvars_;
-}
 
-template<typename T>
-bool ELFSoFileParser<T>::IsSymbolExported(const Elf_Sym *elf_sym) const {
+template <typename T>
+class ELFSoFileParser : public SoFileParser {
+ private:
+  LLVM_ELF_IMPORT_TYPES_ELFT(T)
+  typedef llvm::object::ELFFile<T> ELFO;
+  typedef typename ELFO::Elf_Sym Elf_Sym;
 
-  unsigned char visibility = elf_sym->getVisibility();
-  unsigned char binding = elf_sym->getBinding();
+ public:
+  ELFSoFileParser(const llvm::object::ELFObjectFile<T> *obj);
 
-  return (binding == STB_GLOBAL || binding == STB_WEAK) &&
-      (visibility == STV_DEFAULT ||
-       visibility == STV_PROTECTED);
-}
+  ~ELFSoFileParser() override {}
 
-template<typename T>
-void ELFSoFileParser<T>::GetSymbols() {
-  assert(obj_ != nullptr);
-  for (auto symbol_it : obj_->symbols()) {
-    const Elf_Sym *elf_sym =
-          obj_->getSymbol(symbol_it.getRawDataRefImpl());
+  std::unique_ptr<ExportedSymbolSet> Parse() override {
+    return std::move(exported_symbols_);
+  }
+
+ private:
+  bool IsSymbolExported(const Elf_Sym *elf_sym) const {
+    unsigned char visibility = elf_sym->getVisibility();
+    unsigned char binding = elf_sym->getBinding();
+    return ((binding == llvm::ELF::STB_GLOBAL ||
+             binding == llvm::ELF::STB_WEAK) &&
+            (visibility == llvm::ELF::STV_DEFAULT ||
+             visibility == llvm::ELF::STV_PROTECTED));
+  }
+
+ private:
+  const llvm::object::ELFObjectFile<T> *obj_;
+  std::unique_ptr<ExportedSymbolSet> exported_symbols_;
+};
+
+
+template <typename T>
+ELFSoFileParser<T>::ELFSoFileParser(const llvm::object::ELFObjectFile<T> *obj) {
+  assert(obj != nullptr);
+
+  exported_symbols_.reset(new ExportedSymbolSet());
+
+  for (auto symbol_it : obj->getDynamicSymbolIterators()) {
+    const Elf_Sym *elf_sym = obj->getSymbol(symbol_it.getRawDataRefImpl());
     assert (elf_sym != nullptr);
     if (!IsSymbolExported(elf_sym) || elf_sym->isUndefined()) {
       continue;
     }
-    llvm::object::SymbolRef::Type type = UnWrap(symbol_it.getType());
+
+    abi_util::ElfSymbolIR::ElfSymbolBinding symbol_binding =
+        LLVMToIRSymbolBinding(elf_sym->getBinding());
     std::string symbol_name = UnWrap(symbol_it.getName());
+
+    llvm::object::SymbolRef::Type type = UnWrap(symbol_it.getType());
     if (type == llvm::object::SymbolRef::Type::ST_Function) {
-      functions_.insert(symbol_name);
+      exported_symbols_->AddFunction(symbol_name, symbol_binding);
     } else if (type == llvm::object::SymbolRef::Type::ST_Data) {
-      globvars_.insert(symbol_name);
+      exported_symbols_->AddVar(symbol_name, symbol_binding);
     }
   }
 }
 
-template<typename T>
+
+template <typename T>
 static std::unique_ptr<SoFileParser> CreateELFSoFileParser(
     const llvm::object::ELFObjectFile<T> *elfo) {
   return llvm::make_unique<ELFSoFileParser<T>>(elfo);
 }
 
+
 std::unique_ptr<SoFileParser> SoFileParser::Create(
-    const llvm::object::ObjectFile *objfile) {
-   // Little-endian 32-bit
-  if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(objfile)) {
-    return CreateELFSoFileParser(ELFObj);
+    const std::string &so_file_path) {
+  auto binary = llvm::object::createBinary(so_file_path);
+  if (!binary) {
+    return nullptr;
+  }
+
+  llvm::object::ObjectFile *obj_file =
+      llvm::dyn_cast<llvm::object::ObjectFile>(binary.get().getBinary());
+  if (!obj_file) {
+    return nullptr;
+  }
+
+  // Little-endian 32-bit
+  if (auto elf_obj_file =
+          llvm::dyn_cast<llvm::object::ELF32LEObjectFile>(obj_file)) {
+    return CreateELFSoFileParser(elf_obj_file);
   }
 
   // Big-endian 32-bit
-  if (const ELF32BEObjectFile *ELFObj = dyn_cast<ELF32BEObjectFile>(objfile)) {
-    return CreateELFSoFileParser(ELFObj);
+  if (auto elf_obj_file =
+          llvm::dyn_cast<llvm::object::ELF32BEObjectFile>(obj_file)) {
+    return CreateELFSoFileParser(elf_obj_file);
   }
 
   // Little-endian 64-bit
-  if (const ELF64LEObjectFile *ELFObj = dyn_cast<ELF64LEObjectFile>(objfile)) {
-    return CreateELFSoFileParser(ELFObj);
+  if (auto elf_obj_file =
+          llvm::dyn_cast<llvm::object::ELF64LEObjectFile>(obj_file)) {
+    return CreateELFSoFileParser(elf_obj_file);
   }
 
   // Big-endian 64-bit
-  if (const ELF64BEObjectFile *ELFObj = dyn_cast<ELF64BEObjectFile>(objfile)) {
-    return CreateELFSoFileParser(ELFObj);
+  if (auto elf_obj_file =
+          llvm::dyn_cast<llvm::object::ELF64BEObjectFile>(obj_file)) {
+    return CreateELFSoFileParser(elf_obj_file);
   }
+
   return nullptr;
 }
 
-} // namespace abi_util
 
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/string_utils.cpp b/vndk/tools/header-checker/header-abi-util/src/string_utils.cpp
new file mode 100644
index 0000000..b6a03d0
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/string_utils.cpp
@@ -0,0 +1,93 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "string_utils.h"
+
+#include <cstdlib>
+#include <string>
+#include <utility>
+
+
+namespace abi_util {
+
+
+std::string_view Trim(std::string_view s) {
+  std::string::size_type start = s.find_first_not_of(" \t\r\n");
+  if (start == std::string::npos) {
+    return "";
+  }
+  std::string::size_type end = s.find_last_not_of(" \t\r\n");
+  if (end == std::string::npos) {
+    return s.substr(start);
+  }
+  return s.substr(start, end - start + 1);
+}
+
+
+bool StartsWith(std::string_view s, std::string_view prefix) {
+  return s.size() >= prefix.size() && s.compare(0, prefix.size(), prefix) == 0;
+}
+
+
+bool EndsWith(std::string_view s, std::string_view suffix) {
+  return (s.size() >= suffix.size() &&
+          s.compare(s.size() - suffix.size(), suffix.size(), suffix) == 0);
+}
+
+
+std::vector<std::string_view> Split(std::string_view s,
+                                    std::string_view delim_chars) {
+  std::vector<std::string_view> res;
+  std::string::size_type pos = 0;
+  while (true) {
+    pos = s.find_first_not_of(delim_chars, pos);
+    if (pos == std::string::npos) {
+      break;
+    }
+
+    std::string::size_type end = s.find_first_of(delim_chars, pos + 1);
+    if (end == std::string::npos) {
+      res.push_back(s.substr(pos));
+      break;
+    }
+
+    res.push_back(s.substr(pos, end - pos));
+    pos = end + 1;
+  }
+  return res;
+}
+
+
+std::optional<int> ParseInt(const std::string &s) {
+  const char *start = s.c_str();
+  if (*start == '\0') {
+    return {};
+  }
+
+  char *endptr = nullptr;
+  long int res = ::strtol(start, &endptr, 10);
+  if (*endptr != '\0') {
+    return {};
+  }
+
+  return static_cast<int>(res);
+}
+
+
+bool IsGlobPattern(std::string_view s) {
+  return s.find_first_of("*?[") != std::string::npos;
+}
+
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/string_utils_test.cpp b/vndk/tools/header-checker/header-abi-util/src/string_utils_test.cpp
new file mode 100644
index 0000000..7cc2bff
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/string_utils_test.cpp
@@ -0,0 +1,107 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "string_utils.h"
+
+#include <gtest/gtest.h>
+
+
+namespace abi_util {
+
+
+TEST(StringUtilsTest, Trim) {
+  EXPECT_EQ("a b", Trim(" a b "));
+  EXPECT_EQ("a b", Trim(" a b"));
+  EXPECT_EQ("a b", Trim("a b "));
+  EXPECT_EQ("a b", Trim("a b"));
+  EXPECT_EQ("a b", Trim("\ta b\n"));
+}
+
+
+TEST(StringUtilsTest, StartsWith) {
+  EXPECT_TRUE(StartsWith("abcd", "ab"));
+  EXPECT_TRUE(StartsWith("a", "a"));
+  EXPECT_TRUE(StartsWith("a", ""));
+  EXPECT_TRUE(StartsWith("", ""));
+
+  EXPECT_FALSE(StartsWith("ab", "abcd"));
+  EXPECT_FALSE(StartsWith("", "ab"));
+}
+
+
+TEST(StringUtilsTest, EndsWith) {
+  EXPECT_TRUE(EndsWith("abcd", "cd"));
+  EXPECT_TRUE(EndsWith("d", "d"));
+  EXPECT_TRUE(EndsWith("d", ""));
+  EXPECT_TRUE(EndsWith("", ""));
+
+  EXPECT_FALSE(EndsWith("cd", "abcd"));
+  EXPECT_FALSE(EndsWith("", "cd"));
+}
+
+
+TEST(StringUtilsTest, Split) {
+  std::vector<std::string_view> xs;
+
+  xs = Split("   a  bb   ccc ", " ");
+  EXPECT_EQ(3, xs.size());
+  EXPECT_EQ("a", xs[0]);
+  EXPECT_EQ("bb", xs[1]);
+  EXPECT_EQ("ccc", xs[2]);
+
+  xs = Split("a", " ");
+  EXPECT_EQ(1, xs.size());
+  EXPECT_EQ("a", xs[0]);
+
+  xs = Split("a b", " ");
+  EXPECT_EQ(2, xs.size());
+  EXPECT_EQ("a", xs[0]);
+  EXPECT_EQ("b", xs[1]);
+
+  xs = Split("a \t \t \tb", " \t");
+  EXPECT_EQ(2, xs.size());
+  EXPECT_EQ("a", xs[0]);
+  EXPECT_EQ("b", xs[1]);
+}
+
+
+TEST(StringUtilsTest, ParseInt) {
+  EXPECT_FALSE(ParseInt(""));
+  EXPECT_FALSE(ParseInt("a"));
+  EXPECT_FALSE(ParseInt("0xa"));
+  EXPECT_FALSE(ParseInt("16h"));
+
+  EXPECT_TRUE(ParseInt("0").has_value());
+  EXPECT_EQ(0, ParseInt("0").value());
+
+  EXPECT_TRUE(ParseInt("16").has_value());
+  EXPECT_EQ(16, ParseInt("16").value());
+
+  EXPECT_TRUE(ParseInt("-16").has_value());
+  EXPECT_EQ(-16, ParseInt("-16").value());
+}
+
+
+TEST(StringUtilsTest, IsGlobPattern) {
+  EXPECT_TRUE(IsGlobPattern("*.so"));
+  EXPECT_TRUE(IsGlobPattern("[ab].txt"));
+  EXPECT_TRUE(IsGlobPattern("?.txt"));
+
+  EXPECT_FALSE(IsGlobPattern("name"));
+  EXPECT_FALSE(IsGlobPattern(".txt"));
+  EXPECT_FALSE(IsGlobPattern(""));
+}
+
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/version_script_parser.cpp b/vndk/tools/header-checker/header-abi-util/src/version_script_parser.cpp
index 4eb4ebd..d9a717c 100644
--- a/vndk/tools/header-checker/header-abi-util/src/version_script_parser.cpp
+++ b/vndk/tools/header-checker/header-abi-util/src/version_script_parser.cpp
@@ -12,201 +12,285 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <header_abi_util.h>
+#include "version_script_parser.h"
 
-#include <llvm/Support/raw_ostream.h>
-#include <llvm/Support/FileSystem.h>
-#include <llvm/Support/Path.h>
+#include "exported_symbol_set.h"
+#include "string_utils.h"
 
-#include <memory>
-#include <fstream>
 #include <iostream>
+#include <memory>
+#include <regex>
 #include <set>
-#include <unordered_set>
 #include <string>
 #include <vector>
-#include <regex>
+
 
 namespace abi_util {
 
-#define FUTURE_API 10000
 
-std::unordered_set<std::string> AllArches({"arm", "arm64", "x86", "x86_64",
-                                        "mips", "mips64"});
+static constexpr char DEFAULT_ARCH[] = "arm64";
 
-static bool StringContains(const std::string &line,
-                           const std::string &substring) {
-  return (line.find(substring) != std::string::npos);
+
+inline std::string GetIntroducedArchTag(const std::string &arch) {
+  return "introduced-" + arch + "=";
 }
 
-static bool LineSatisfiesArch(const std::string &line,
-                              const std::string arch) {
-  bool has_arch_tags = false;
-  for (auto &&possible_arch : AllArches) {
-    if (StringContains(line, possible_arch)) {
-      has_arch_tags = true;
-      break;
+
+VersionScriptParser::VersionScriptParser()
+    : arch_(DEFAULT_ARCH), introduced_arch_tag_(GetIntroducedArchTag(arch_)),
+      api_level_(FUTURE_API_LEVEL), stream_(nullptr), line_no_(0) {}
+
+
+void VersionScriptParser::SetArch(const std::string &arch) {
+  arch_ = arch;
+  introduced_arch_tag_ = GetIntroducedArchTag(arch);
+}
+
+
+VersionScriptParser::ParsedTags VersionScriptParser::ParseSymbolTags(
+    const std::string &line) {
+  static const char *const POSSIBLE_ARCHES[] = {
+      "arm", "arm64", "x86", "x86_64", "mips", "mips64"};
+
+  ParsedTags result;
+
+  std::string_view line_view(line);
+  std::string::size_type comment_pos = line_view.find('#');
+  if (comment_pos == std::string::npos) {
+    return result;
+  }
+
+  std::string_view comment_line = line_view.substr(comment_pos + 1);
+  std::vector<std::string_view> tags = Split(comment_line, " \t");
+
+  bool has_introduced_arch_tags = false;
+
+  for (auto &&tag : tags) {
+    // Check excluded tags.
+    if (excluded_symbol_tags_.find(tag) != excluded_symbol_tags_.end()) {
+      result.has_excluded_tags_ = true;
+    }
+
+    // Check the var tag.
+    if (tag == "var") {
+      result.has_var_tag_ = true;
+      continue;
+    }
+
+    // Check arch tags.
+    if (tag == arch_) {
+      result.has_arch_tags_ = true;
+      result.has_current_arch_tag_ = true;
+      continue;
+    }
+
+    for (auto &&possible_arch : POSSIBLE_ARCHES) {
+      if (tag == possible_arch) {
+        result.has_arch_tags_ = true;
+        break;
+      }
+    }
+
+    // Check introduced tags.
+    if (StartsWith(tag, "introduced=")) {
+      std::optional<ApiLevel> intro = ParseApiLevel(
+          std::string(tag.substr(sizeof("introduced=") - 1)));
+      if (!intro) {
+        ReportError("Bad introduced tag: " + std::string(tag));
+      } else {
+        if (!has_introduced_arch_tags) {
+          result.has_introduced_tags_ = true;
+          result.introduced_ = intro.value();
+        }
+      }
+      continue;
+    }
+
+    if (StartsWith(tag, introduced_arch_tag_)) {
+      std::optional<ApiLevel> intro = ParseApiLevel(
+          std::string(tag.substr(introduced_arch_tag_.size())));
+      if (!intro) {
+        ReportError("Bad introduced tag " + std::string(tag));
+      } else {
+        has_introduced_arch_tags = true;
+        result.has_introduced_tags_ = true;
+        result.introduced_ = intro.value();
+      }
+      continue;
+    }
+
+    // Check future tags.
+    if (tag == "future") {
+      result.has_future_tag_ = true;
+      continue;
     }
   }
-  return (has_arch_tags && StringContains(line, arch)) || !has_arch_tags;
+
+  return result;
 }
 
-VersionScriptParser::VersionScriptParser(const std::string &version_script,
-                                         const std::string &arch,
-                                         const std::string &api) :
-  version_script_(version_script), arch_(arch), api_(ApiStrToInt(api)) { }
 
-int VersionScriptParser::ApiStrToInt(const std::string &api) {
-  // Follow what build/soong/cc/gen_stub_libs.py does.
-  if (api == "current") {
-    return FUTURE_API;
+bool VersionScriptParser::IsSymbolExported(
+    const VersionScriptParser::ParsedTags &tags) {
+  if (tags.has_excluded_tags_) {
+    return false;
   }
-  return std::stoi(api);
+
+  if (tags.has_arch_tags_ && !tags.has_current_arch_tag_) {
+    return false;
+  }
+
+  if (tags.has_future_tag_) {
+    return api_level_ == FUTURE_API_LEVEL;
+  }
+
+  if (tags.has_introduced_tags_) {
+    return api_level_ >= tags.introduced_;
+  }
+
+  return true;
 }
 
-bool VersionScriptParser::SymbolInArchAndApiVersion(const std::string &line,
-                                                    const std::string &arch,
-                                                    int api) {
-  // If the tags do not have an "introduced" requirement, the symbol is
-  // exported.
-  if (!StringContains(line, "introduced") && LineSatisfiesArch(line, arch)) {
+
+bool VersionScriptParser::ParseSymbolLine(const std::string &line,
+                                          bool is_in_extern_cpp) {
+  // The symbol name comes before the ';'.
+  std::string::size_type pos = line.find(";");
+  if (pos == std::string::npos) {
+    ReportError("No semicolon at the end of the symbol line: " + line);
+    return false;
+  }
+
+  std::string symbol(Trim(line.substr(0, pos)));
+
+  ParsedTags tags = ParseSymbolTags(line);
+  if (!IsSymbolExported(tags)) {
     return true;
   }
-  if (line == "future") {
-    return api == FUTURE_API;
+
+  if (is_in_extern_cpp) {
+    if (IsGlobPattern(symbol)) {
+      exported_symbols_->AddDemangledCppGlobPattern(symbol);
+    } else {
+      exported_symbols_->AddDemangledCppSymbol(symbol);
+    }
+    return true;
   }
-  const std::string regex_match_string1 = " *introduced-" + arch + "=([0-9]+)";
-  const std::string regex_match_string2 = " *introduced=([0-9]+)";
-  std::smatch matcher1;
-  std::smatch matcher2;
-  std::regex match_clause1(regex_match_string1);
-  std::regex match_clause2(regex_match_string2);
-  int matched_api = -1;
-  if (std::regex_search(line, matcher1, match_clause1)) {
-    matched_api = std::stoi(matcher1.str(1));
-  } else if ((std::regex_search(line, matcher2, match_clause2)) &&
-    LineSatisfiesArch(line, arch)) {
-    matched_api = std::stoi(matcher2.str(1));
+
+  if (IsGlobPattern(symbol)) {
+    exported_symbols_->AddGlobPattern(symbol);
+    return true;
   }
-  // If the arch specific tag / version specific tag was found and the api level
-  // required was greater than the api level offered.
-  return (matched_api <=0 || api >= matched_api);
+
+  if (tags.has_var_tag_) {
+    exported_symbols_->AddVar(symbol, ElfSymbolIR::ElfSymbolBinding::Global);
+  } else {
+    exported_symbols_->AddFunction(symbol,
+                                   ElfSymbolIR::ElfSymbolBinding::Global);
+  }
+  return true;
 }
 
-bool VersionScriptParser::SymbolExported(const std::string &line,
-                                         const std::string &arch, int api) {
-  // Empty line means that the symbol is exported
-  if (line.empty() || SymbolInArchAndApiVersion(line, arch, api)) {
+
+bool VersionScriptParser::ParseVersionBlock(bool ignore_symbols) {
+  static const std::regex EXTERN_CPP_PATTERN(R"(extern\s*"[Cc]\+\+"\s*\{)");
+
+  LineScope scope = LineScope::GLOBAL;
+  bool is_in_extern_cpp = false;
+
+  while (true) {
+    std::string line;
+    if (!ReadLine(line)) {
+      break;
+    }
+
+    if (line.find("}") != std::string::npos) {
+      if (is_in_extern_cpp) {
+        is_in_extern_cpp = false;
+        continue;
+      }
+      return true;
+    }
+
+    // Check extern "c++"
+    if (std::regex_match(line, EXTERN_CPP_PATTERN)) {
+      is_in_extern_cpp = true;
+      continue;
+    }
+
+    // Check symbol visibility label
+    if (StartsWith(line, "local:")) {
+      scope = LineScope::LOCAL;
+      continue;
+    }
+    if (StartsWith(line, "global:")) {
+      scope = LineScope::GLOBAL;
+      continue;
+    }
+    if (scope != LineScope::GLOBAL) {
+      continue;
+    }
+
+    // Parse symbol line
+    if (!ignore_symbols) {
+      if (!ParseSymbolLine(line, is_in_extern_cpp)) {
+        return false;
+      }
+    }
+  }
+
+  ReportError("No matching closing parenthesis");
+  return false;
+}
+
+
+std::unique_ptr<ExportedSymbolSet> VersionScriptParser::Parse(
+    std::istream &stream) {
+  // Initialize the parser context
+  stream_ = &stream;
+  line_no_ = 0;
+  exported_symbols_.reset(new ExportedSymbolSet());
+
+  // Parse
+  while (true) {
+    std::string line;
+    if (!ReadLine(line)) {
+      break;
+    }
+
+    std::string::size_type lparen_pos = line.find("{");
+    if (lparen_pos == std::string::npos) {
+      ReportError("No version opening parenthesis" + line);
+      return nullptr;
+    }
+
+    std::string version(Trim(line.substr(0, lparen_pos - 1)));
+    bool exclude_symbol_version = (excluded_symbol_versions_.find(version) !=
+                                   excluded_symbol_versions_.end());
+
+    if (!ParseVersionBlock(exclude_symbol_version)) {
+      return nullptr;
+    }
+  }
+
+  return std::move(exported_symbols_);
+}
+
+
+bool VersionScriptParser::ReadLine(std::string &line) {
+  while (std::getline(*stream_, line)) {
+    ++line_no_;
+    line = std::string(Trim(line));
+    if (line.empty() || line[0] == '#') {
+      continue;
+    }
     return true;
   }
   return false;
 }
 
-void VersionScriptParser::AddToVars(std::string &symbol) {
-  if (symbol.find("*") != std::string::npos) {
-    globvar_regexs_.insert(symbol);
-  } else {
-    globvars_.insert(symbol);
-  }
-}
 
-void VersionScriptParser::AddToFunctions(std::string &symbol) {
-  if (symbol.find("*") != std::string::npos) {
-    function_regexs_.insert(symbol);
-  } else {
-    functions_.insert(symbol);
-  }
-}
+VersionScriptParser::ErrorHandler::~ErrorHandler() {}
 
-bool VersionScriptParser::ParseSymbolLine(const std::string &line) {
-  //The symbol lies before the ; and the tags are after ;
-  std::string::size_type pos = line.find(";");
-  if (pos == std::string::npos) {
-    llvm::errs() << "Couldn't find end of symbol" << line <<"\n";
-    return false;
-  }
-  std::string symbol = line.substr(0, pos);
-  std::string::size_type last_space = symbol.find_last_of(' ');
-  symbol = symbol.substr(last_space + 1, pos);
-  std::string tags = line.substr(pos + 1);
-  if (SymbolExported(tags, arch_, api_)) {
-    if (StringContains(tags, "var")) {
-      AddToVars(symbol);
-    } else {
-      AddToFunctions(symbol);
-    }
-  }
-  return true;
-}
 
-typedef VersionScriptParser::LineScope LineScope;
-
-LineScope VersionScriptParser::GetLineScope(std::string &line,
-                                            LineScope scope) {
-  if (StringContains(line, "local:")) {
-    scope = LineScope::local;
-  }
-  return scope;
-}
-
-bool VersionScriptParser::ParseInnerBlock(std::ifstream &symbol_ifstream) {
-  std::string line = "";
-  LineScope scope = LineScope::global;
-
-  while (std::getline(symbol_ifstream, line)) {
-    if (line.find("}") != std::string::npos) {
-      break;
-    }
-    if (line.c_str()[0] == '#') {
-      continue;
-    }
-    scope = GetLineScope(line, scope);
-    if (scope != LineScope::global || StringContains(line, "global:")) {
-      continue;
-    }
-    ParseSymbolLine(line);
-  }
-  return true;
-}
-
-const std::set<std::string> &VersionScriptParser::GetFunctions() {
-  return functions_;
-}
-
-const std::set<std::string> &VersionScriptParser::GetGlobVars() {
-  return globvars_;
-}
-
-const std::set<std::string> &VersionScriptParser::GetFunctionRegexs() {
-  return function_regexs_;
-}
-
-const std::set<std::string> &VersionScriptParser::GetGlobVarRegexs() {
-  return globvar_regexs_;
-}
-
-bool VersionScriptParser::Parse() {
-  std::ifstream symbol_ifstream(version_script_);
-  if (!symbol_ifstream.is_open()) {
-    llvm::errs() << "Failed to open version script file\n";
-    return false;
-  }
-  std::string line = "";
-
-  while (std::getline(symbol_ifstream, line)) {
-    // Skip comment lines.
-    if (line.c_str()[0] == '#') {
-      continue;
-    }
-    if (StringContains(line, "{")) {
-
-      if ((StringContains(line, "PRIVATE"))) {
-        continue;
-      }
-      ParseInnerBlock(symbol_ifstream);
-    }
-  }
-  return true;
-}
-
-} // namespace abi_util
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/header-abi-util/src/version_script_parser_test.cpp b/vndk/tools/header-checker/header-abi-util/src/version_script_parser_test.cpp
new file mode 100644
index 0000000..c84f19d
--- /dev/null
+++ b/vndk/tools/header-checker/header-abi-util/src/version_script_parser_test.cpp
@@ -0,0 +1,430 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "version_script_parser.h"
+
+#include <gtest/gtest.h>
+
+#include <map>
+#include <sstream>
+#include <string>
+
+
+namespace abi_util {
+
+
+TEST(VersionScriptParserTest, SmokeTest) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        foo1;
+        bar1;  # var
+      local:
+        *;
+    };
+
+    LIBEX_2.0 {
+      global:
+        foo2;
+        bar2;  # var
+    } LIBEX_1.0;
+  )TESTDATA";
+
+  VersionScriptParser parser;
+
+  std::istringstream stream(testdata);
+  std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+  ASSERT_TRUE(result);
+
+  const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+  EXPECT_NE(funcs.end(), funcs.find("foo1"));
+  EXPECT_NE(funcs.end(), funcs.find("foo2"));
+  EXPECT_EQ(funcs.end(), funcs.find("bar1"));
+  EXPECT_EQ(funcs.end(), funcs.find("bar2"));
+
+  const ExportedSymbolSet::VarMap &vars = result->GetVars();
+  EXPECT_NE(vars.end(), vars.find("bar1"));
+  EXPECT_NE(vars.end(), vars.find("bar2"));
+  EXPECT_EQ(vars.end(), vars.find("foo1"));
+  EXPECT_EQ(vars.end(), vars.find("foo2"));
+}
+
+
+TEST(VersionScriptParserTest, ExcludeSymbolVersions) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        foo1;
+        bar1;  # var
+      local:
+        *;
+    };
+
+    LIBEX_PRIVATE {
+      global:
+        foo2;
+        bar2;  # var
+    } LIBEX_1.0;
+  )TESTDATA";
+
+  // excluded_symbol_versions = {}
+  {
+    VersionScriptParser parser;
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+    EXPECT_NE(funcs.end(), funcs.find("foo2"));
+
+    const ExportedSymbolSet::VarMap &vars = result->GetVars();
+    EXPECT_NE(vars.end(), vars.find("bar2"));
+  }
+
+  // excluded_symbol_versions = {"LIBEX_PRIVATE"}
+  {
+    VersionScriptParser parser;
+    parser.AddExcludedSymbolVersion("LIBEX_PRIVATE");
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+    EXPECT_EQ(funcs.end(), funcs.find("foo2"));
+
+    const ExportedSymbolSet::VarMap &vars = result->GetVars();
+    EXPECT_EQ(vars.end(), vars.find("bar2"));
+  }
+}
+
+
+TEST(VersionScriptParserTest, VisibilityLabels) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        global_f1;
+        global_v1;  # var
+      local:
+        local_f2;
+        local_v2;  # var
+      global:
+        global_f3;
+        global_v3;  # var
+      global:
+        global_f4;
+        global_v4;  # var
+      local:
+        local_f5;
+        local_v5;  # var
+      local:
+        local_f6;
+        local_v6;  # var
+    };
+  )TESTDATA";
+
+  VersionScriptParser parser;
+
+  std::istringstream stream(testdata);
+  std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+  ASSERT_TRUE(result);
+
+  const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+  EXPECT_NE(funcs.end(), funcs.find("global_f1"));
+  EXPECT_NE(funcs.end(), funcs.find("global_f3"));
+  EXPECT_NE(funcs.end(), funcs.find("global_f4"));
+
+  EXPECT_EQ(funcs.end(), funcs.find("local_f2"));
+  EXPECT_EQ(funcs.end(), funcs.find("local_f5"));
+  EXPECT_EQ(funcs.end(), funcs.find("local_f6"));
+
+  const ExportedSymbolSet::VarMap &vars = result->GetVars();
+
+  EXPECT_NE(vars.end(), vars.find("global_v1"));
+  EXPECT_NE(vars.end(), vars.find("global_v3"));
+  EXPECT_NE(vars.end(), vars.find("global_v4"));
+
+  EXPECT_EQ(vars.end(), vars.find("local_v2"));
+  EXPECT_EQ(vars.end(), vars.find("local_v5"));
+  EXPECT_EQ(vars.end(), vars.find("local_v6"));
+}
+
+
+TEST(VersionScriptParserTest, ParseSymbolTagsIntroduced) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        test1;  # introduced=19
+        test2;  # introduced=19 introduced-arm64=20
+        test3;  # introduced-arm64=20 introduced=19
+        test4;  # future
+    };
+  )TESTDATA";
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("arm64");
+    parser.SetApiLevel(18);
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_EQ(funcs.end(), funcs.find("test1"));
+    EXPECT_EQ(funcs.end(), funcs.find("test2"));
+    EXPECT_EQ(funcs.end(), funcs.find("test3"));
+    EXPECT_EQ(funcs.end(), funcs.find("test4"));
+  }
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("arm64");
+    parser.SetApiLevel(19);
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_EQ(funcs.end(), funcs.find("test2"));
+    EXPECT_EQ(funcs.end(), funcs.find("test3"));
+    EXPECT_EQ(funcs.end(), funcs.find("test4"));
+  }
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("arm");
+    parser.SetApiLevel(19);
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_NE(funcs.end(), funcs.find("test2"));
+    EXPECT_NE(funcs.end(), funcs.find("test3"));
+    EXPECT_EQ(funcs.end(), funcs.find("test4"));
+  }
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("arm64");
+    parser.SetApiLevel(20);
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_NE(funcs.end(), funcs.find("test2"));
+    EXPECT_NE(funcs.end(), funcs.find("test3"));
+    EXPECT_EQ(funcs.end(), funcs.find("test4"));
+  }
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("arm64");
+    parser.SetApiLevel(FUTURE_API_LEVEL);
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_NE(funcs.end(), funcs.find("test2"));
+    EXPECT_NE(funcs.end(), funcs.find("test3"));
+    EXPECT_NE(funcs.end(), funcs.find("test4"));
+  }
+}
+
+
+TEST(VersionScriptParserTest, ParseSymbolTagsArch) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        test1;
+        test2;  # arm arm64
+        test3;  # arm64
+        test4;  # mips
+    };
+  )TESTDATA";
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("arm");
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_NE(funcs.end(), funcs.find("test2"));
+    EXPECT_EQ(funcs.end(), funcs.find("test3"));
+    EXPECT_EQ(funcs.end(), funcs.find("test4"));
+  }
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("arm64");
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_NE(funcs.end(), funcs.find("test2"));
+    EXPECT_NE(funcs.end(), funcs.find("test3"));
+    EXPECT_EQ(funcs.end(), funcs.find("test4"));
+  }
+
+  {
+    VersionScriptParser parser;
+    parser.SetArch("mips");
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_EQ(funcs.end(), funcs.find("test2"));
+    EXPECT_EQ(funcs.end(), funcs.find("test3"));
+    EXPECT_NE(funcs.end(), funcs.find("test4"));
+  }
+}
+
+
+TEST(VersionScriptParserTest, ExcludeSymbolTags) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        test1;
+        test2;  # exclude-tag
+    };
+  )TESTDATA";
+
+  // exclude_symbol_tags = {}
+  {
+    VersionScriptParser parser;
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_NE(funcs.end(), funcs.find("test2"));
+  }
+
+  // exclude_symbol_tags = {"exclude-tag"}
+  {
+    VersionScriptParser parser;
+    parser.AddExcludedSymbolTag("exclude-tag");
+
+    std::istringstream stream(testdata);
+    std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+    ASSERT_TRUE(result);
+
+    const ExportedSymbolSet::FunctionMap &funcs = result->GetFunctions();
+
+    EXPECT_NE(funcs.end(), funcs.find("test1"));
+    EXPECT_EQ(funcs.end(), funcs.find("test2"));
+  }
+}
+
+
+TEST(VersionScriptParserTest, ParseExternCpp) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        test1;
+        extern "C++" {
+          Test2::test();
+          Test3::test();
+          Test4::*;
+        };
+        test5;
+    };
+  )TESTDATA";
+
+  VersionScriptParser parser;
+
+  std::istringstream stream(testdata);
+  std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+  ASSERT_TRUE(result);
+
+  const ExportedSymbolSet::NameSet &cpp_symbols =
+      result->GetDemangledCppSymbols();
+
+  EXPECT_NE(cpp_symbols.end(), cpp_symbols.find("Test2::test()"));
+  EXPECT_NE(cpp_symbols.end(), cpp_symbols.find("Test3::test()"));
+
+  EXPECT_EQ(cpp_symbols.end(), cpp_symbols.find("test1"));
+  EXPECT_EQ(cpp_symbols.end(), cpp_symbols.find("test4"));
+
+  const ExportedSymbolSet::GlobPatternSet &cpp_glob_patterns =
+      result->GetDemangledCppGlobPatterns();
+
+  EXPECT_NE(cpp_glob_patterns.end(), cpp_glob_patterns.find("Test4::*"));
+}
+
+
+TEST(VersionScriptParserTest, ParseGlobPattern) {
+  static const char testdata[] = R"TESTDATA(
+    LIBEX_1.0 {
+      global:
+        test1*;
+        test2[Aa];
+        test3?;
+        test4;
+    };
+  )TESTDATA";
+
+
+  VersionScriptParser parser;
+
+  std::istringstream stream(testdata);
+  std::unique_ptr<ExportedSymbolSet> result(parser.Parse(stream));
+  ASSERT_TRUE(result);
+
+  const ExportedSymbolSet::GlobPatternSet &glob_patterns =
+      result->GetGlobPatterns();
+
+  EXPECT_NE(glob_patterns.end(), glob_patterns.find("test1*"));
+  EXPECT_NE(glob_patterns.end(), glob_patterns.find("test2[Aa]"));
+  EXPECT_NE(glob_patterns.end(), glob_patterns.find("test3?"));
+
+  EXPECT_EQ(glob_patterns.end(), glob_patterns.find("test4"));
+}
+
+
+}  // namespace abi_util
diff --git a/vndk/tools/header-checker/merge-abi-diff/src/merge_abi_diff.cpp b/vndk/tools/header-checker/merge-abi-diff/src/merge_abi_diff.cpp
index 7e884de..7844261 100644
--- a/vndk/tools/header-checker/merge-abi-diff/src/merge_abi_diff.cpp
+++ b/vndk/tools/header-checker/merge-abi-diff/src/merge_abi_diff.cpp
@@ -12,24 +12,24 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "header_abi_util.h"
+
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunused-parameter"
 #pragma clang diagnostic ignored "-Wnested-anon-types"
-#include "proto/abi_dump.pb.h"
-#include "proto/abi_diff.pb.h"
+#include "abi_dump.pb.h"
+#include "abi_diff.pb.h"
 #pragma clang diagnostic pop
 
-#include <header_abi_util.h>
-
-#include <llvm/Support/CommandLine.h>
-#include <llvm/Support/raw_ostream.h>
-
 #include <google/protobuf/text_format.h>
 #include <google/protobuf/io/zero_copy_stream_impl.h>
 
-#include <memory>
+#include <llvm/Support/CommandLine.h>
+#include <llvm/Support/raw_ostream.h>
+
 #include <fstream>
 #include <iostream>
+#include <memory>
 #include <string>
 #include <vector>
 
@@ -139,7 +139,7 @@
                  << "VNDK Abi "
                  << status_str
                  << ":"
-                 << " Please check compatiblity report at : "
+                 << " Please check compatibility report at : "
                  << merged_diff_report << "\n"
                  << "******************************************************\n";
   }
diff --git a/vndk/tools/header-checker/proto/Android.bp b/vndk/tools/header-checker/proto/Android.bp
new file mode 100644
index 0000000..b63254a
--- /dev/null
+++ b/vndk/tools/header-checker/proto/Android.bp
@@ -0,0 +1,53 @@
+//
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_library_host_static {
+    name: "libheader-checker-proto",
+
+    defaults: ["llvm-build-host-tools-defaults"],
+
+    srcs: [
+        "abi_dump.proto",
+        "abi_diff.proto",
+    ],
+
+    proto: {
+        export_proto_headers: true,
+        type: "full",
+        canonical_path_from_root: false,
+    },
+
+    shared_libs: ["libc++_host"],
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wcast-qual",
+        "-Wno-long-long",
+        "-Wno-unused-parameter",
+    ],
+
+    export_include_dirs: ["."],
+
+    target: {
+        windows: {
+            enabled: false,
+        },
+    },
+
+    stl: "none",
+    compile_multilib: "64",
+}
diff --git a/vndk/tools/header-checker/proto/abi_diff.proto b/vndk/tools/header-checker/proto/abi_diff.proto
index 9eb1dcb..03f8ebe 100644
--- a/vndk/tools/header-checker/proto/abi_diff.proto
+++ b/vndk/tools/header-checker/proto/abi_diff.proto
@@ -1,6 +1,6 @@
 syntax = "proto2";
 
-import "development/vndk/tools/header-checker/proto/abi_dump.proto";
+import "abi_dump.proto";
 
 package abi_diff;
 
@@ -71,8 +71,8 @@
 message GlobalVarDeclDiff {
   optional string type_stack = 1;
   optional string name = 2;
-  optional abi_dump.GlobalVarDecl old = 3; // Old global var
-  optional abi_dump.GlobalVarDecl new = 4; // New global var
+  optional abi_dump.GlobalVarDecl old = 3;  // Old global var
+  optional abi_dump.GlobalVarDecl new = 4;  // New global var
 }
 
 message TranslationUnitDiff {
diff --git a/vndk/tools/header-checker/proto/abi_dump.proto b/vndk/tools/header-checker/proto/abi_dump.proto
index c55c300..68ec0cc 100644
--- a/vndk/tools/header-checker/proto/abi_dump.proto
+++ b/vndk/tools/header-checker/proto/abi_dump.proto
@@ -86,7 +86,7 @@
 }
 
 message EnumFieldDecl {
-  optional int64 enum_field_value = 1; // assumption: fits int64
+  optional int64 enum_field_value = 1;  // assumption: fits int64
   optional string name = 3;
 }
 
@@ -121,6 +121,7 @@
   // reference dumps. TODO: b/63081517
   optional uint64 value = 3 [default = 0];
   optional int64 component_value = 4 [default = 0];
+  optional bool is_pure = 6 [default = false];
 }
 
 message VTableLayout {
@@ -159,12 +160,19 @@
   optional AccessSpecifier access = 5 [default = public_access];
 }
 
+enum ElfSymbolBinding {
+  Global = 1;
+  Weak = 2;
+}
+
 message ElfFunction {
   optional string name = 1;
+  optional ElfSymbolBinding binding = 2;
 }
 
 message ElfObject {
   optional string name = 1;
+  optional ElfSymbolBinding binding = 2;
 }
 
 message TranslationUnit {
diff --git a/vndk/tools/header-checker/tests/abi_dumps/opaque_ptr_types.lsdump b/vndk/tools/header-checker/tests/abi_dumps/opaque_ptr_types.lsdump
new file mode 100644
index 0000000..2ecd7c3
--- /dev/null
+++ b/vndk/tools/header-checker/tests/abi_dumps/opaque_ptr_types.lsdump
@@ -0,0 +1,29 @@
+{
+ "elf_objects" :
+ [
+  {
+   "name" : "test"
+  }
+ ],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "test",
+   "name" : "test",
+   "referenced_type" : "type-1",
+   "source_file" : "opaque_ptr_types.h"
+  }
+ ],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "OpaqueType *",
+   "name" : "OpaqueType *",
+   "referenced_type" : "type-2",
+   "self_type" : "type-1",
+   "size" : 8,
+   "source_file" : "opaque_ptr_types.h"
+  }
+ ]
+}
diff --git a/vndk/tools/header-checker/tests/expected/example1.cpp b/vndk/tools/header-checker/tests/expected/example1.cpp
index 76b3a8e..810159c 100644
--- a/vndk/tools/header-checker/tests/expected/example1.cpp
+++ b/vndk/tools/header-checker/tests/expected/example1.cpp
@@ -53,26 +53,31 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTIN5test210HelloAgainE"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN5test210HelloAgain5againEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN5test210HelloAgainD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN5test210HelloAgainD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -193,12 +198,12 @@
 }
 record_types {
   type_info {
-    name: "Hello::(anonymous)::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
+    name: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
     size: 4
     alignment: 4
     referenced_type: "type-22"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
-    linker_set_key: "Hello::(anonymous)::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
+    linker_set_key: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
     self_type: "type-22"
   }
   fields {
@@ -211,17 +216,17 @@
   is_anonymous: true
   record_kind: struct_kind
   tag_info {
-    unique_id: "Hello::(anonymous)::(anonymous)"
+    unique_id: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5)"
   }
 }
 record_types {
   type_info {
-    name: "Hello::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
+    name: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
     size: 12
     alignment: 4
     referenced_type: "type-21"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
-    linker_set_key: "Hello::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
+    linker_set_key: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
     self_type: "type-21"
   }
   fields {
@@ -246,7 +251,7 @@
   is_anonymous: true
   record_kind: struct_kind
   tag_info {
-    unique_id: "Hello::(anonymous)"
+    unique_id: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)"
   }
 }
 record_types {
@@ -338,26 +343,31 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI8CPPHello"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN8CPPHello5againEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN8CPPHelloD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN8CPPHelloD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -467,11 +477,11 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 10
-    name: "Foo_s::foosball"
+    name: "foosball"
   }
   enum_fields {
     enum_field_value: 11
-    name: "Foo_s::foosbat"
+    name: "foosbat"
   }
   access: public_access
   tag_info {
@@ -491,11 +501,11 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 24
-    name: "test3::Kind::kind1"
+    name: "test3::kind1"
   }
   enum_fields {
     enum_field_value: 2312
-    name: "test3::Kind::kind2"
+    name: "test3::kind2"
   }
   access: public_access
   tag_info {
@@ -515,7 +525,7 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "CPPHello::Bla::BLA"
+    name: "CPPHello::BLA"
   }
   access: public_access
   tag_info {
diff --git a/vndk/tools/header-checker/tests/expected/example1.h b/vndk/tools/header-checker/tests/expected/example1.h
index 76b3a8e..13ae403 100644
--- a/vndk/tools/header-checker/tests/expected/example1.h
+++ b/vndk/tools/header-checker/tests/expected/example1.h
@@ -53,26 +53,31 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTIN5test210HelloAgainE"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN5test210HelloAgain5againEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN5test210HelloAgainD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN5test210HelloAgainD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -193,13 +198,13 @@
 }
 record_types {
   type_info {
-    name: "Hello::(anonymous)::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
+    name: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
     size: 4
     alignment: 4
-    referenced_type: "type-22"
+    referenced_type: "type-24"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
-    linker_set_key: "Hello::(anonymous)::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
-    self_type: "type-22"
+    linker_set_key: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5) at /development/vndk/tools/header-checker/tests/input/example1.h:22:5"
+    self_type: "type-24"
   }
   fields {
     referenced_type: "type-2"
@@ -211,18 +216,18 @@
   is_anonymous: true
   record_kind: struct_kind
   tag_info {
-    unique_id: "Hello::(anonymous)::(anonymous)"
+    unique_id: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:22:5)"
   }
 }
 record_types {
   type_info {
-    name: "Hello::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
+    name: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
     size: 12
     alignment: 4
-    referenced_type: "type-21"
+    referenced_type: "type-23"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
-    linker_set_key: "Hello::(anonymous) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
-    self_type: "type-21"
+    linker_set_key: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3) at /development/vndk/tools/header-checker/tests/input/example1.h:19:3"
+    self_type: "type-23"
   }
   fields {
     referenced_type: "type-2"
@@ -237,7 +242,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-22"
+    referenced_type: "type-24"
     field_offset: 64
     field_name: ""
     access: public_access
@@ -246,7 +251,7 @@
   is_anonymous: true
   record_kind: struct_kind
   tag_info {
-    unique_id: "Hello::(anonymous)"
+    unique_id: "Hello::(anonymous struct at /development/vndk/tools/header-checker/tests/input/example1.h:19:3)"
   }
 }
 record_types {
@@ -254,10 +259,10 @@
     name: "Hello"
     size: 32
     alignment: 4
-    referenced_type: "type-19"
+    referenced_type: "type-21"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "Hello"
-    self_type: "type-19"
+    self_type: "type-21"
   }
   fields {
     referenced_type: "type-2"
@@ -272,7 +277,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-20"
+    referenced_type: "type-22"
     field_offset: 64
     field_name: "d"
     access: public_access
@@ -290,7 +295,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-21"
+    referenced_type: "type-23"
     field_offset: 160
     field_name: ""
     access: public_access
@@ -306,19 +311,19 @@
     name: "CPPHello"
     size: 56
     alignment: 8
-    referenced_type: "type-23"
+    referenced_type: "type-25"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "CPPHello"
-    self_type: "type-23"
+    self_type: "type-25"
   }
   fields {
-    referenced_type: "type-24"
+    referenced_type: "type-26"
     field_offset: 352
     field_name: "cpp_foo"
     access: public_access
   }
   fields {
-    referenced_type: "type-25"
+    referenced_type: "type-27"
     field_offset: 384
     field_name: "cpp_bar"
     access: public_access
@@ -338,26 +343,31 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI8CPPHello"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN8CPPHello5againEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN8CPPHelloD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN8CPPHelloD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -371,13 +381,13 @@
     name: "List<float>"
     size: 8
     alignment: 8
-    referenced_type: "type-31"
+    referenced_type: "type-34"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "List<float>"
-    self_type: "type-31"
+    self_type: "type-34"
   }
   fields {
-    referenced_type: "type-33"
+    referenced_type: "type-36"
     field_offset: 0
     field_name: "middle"
     access: public_access
@@ -398,10 +408,10 @@
     name: "List<float>::_Node"
     size: 24
     alignment: 8
-    referenced_type: "type-32"
+    referenced_type: "type-35"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "List<float>::_Node"
-    self_type: "type-32"
+    self_type: "type-35"
   }
   fields {
     referenced_type: "type-3"
@@ -410,13 +420,13 @@
     access: private_access
   }
   fields {
-    referenced_type: "type-33"
+    referenced_type: "type-36"
     field_offset: 64
     field_name: "mpPrev"
     access: private_access
   }
   fields {
-    referenced_type: "type-33"
+    referenced_type: "type-36"
     field_offset: 128
     field_name: "mpNext"
     access: private_access
@@ -432,13 +442,13 @@
     name: "List<int>"
     size: 8
     alignment: 8
-    referenced_type: "type-35"
+    referenced_type: "type-41"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "List<int>"
-    self_type: "type-35"
+    self_type: "type-41"
   }
   fields {
-    referenced_type: "type-37"
+    referenced_type: "type-43"
     field_offset: 0
     field_name: "middle"
     access: public_access
@@ -467,11 +477,11 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 10
-    name: "Foo_s::foosball"
+    name: "foosball"
   }
   enum_fields {
     enum_field_value: 11
-    name: "Foo_s::foosbat"
+    name: "foosbat"
   }
   access: public_access
   tag_info {
@@ -491,11 +501,11 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 24
-    name: "test3::Kind::kind1"
+    name: "test3::kind1"
   }
   enum_fields {
     enum_field_value: 2312
-    name: "test3::Kind::kind2"
+    name: "test3::kind2"
   }
   access: public_access
   tag_info {
@@ -507,15 +517,15 @@
     name: "CPPHello::Bla"
     size: 4
     alignment: 4
-    referenced_type: "type-27"
+    referenced_type: "type-29"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "CPPHello::Bla"
-    self_type: "type-27"
+    self_type: "type-29"
   }
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "CPPHello::Bla::BLA"
+    name: "CPPHello::BLA"
   }
   access: public_access
   tag_info {
@@ -535,13 +545,24 @@
 }
 pointer_types {
   type_info {
+    name: "ForwardDeclaration *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-19"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+    linker_set_key: "ForwardDeclaration *"
+    self_type: "type-20"
+  }
+}
+pointer_types {
+  type_info {
     name: "CPPHello *"
     size: 8
     alignment: 8
-    referenced_type: "type-23"
+    referenced_type: "type-25"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "CPPHello *"
-    self_type: "type-26"
+    self_type: "type-28"
   }
 }
 pointer_types {
@@ -552,7 +573,7 @@
     referenced_type: "type-2"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "int *"
-    self_type: "type-29"
+    self_type: "type-31"
   }
 }
 pointer_types {
@@ -563,7 +584,7 @@
     referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "float *"
-    self_type: "type-30"
+    self_type: "type-33"
   }
 }
 pointer_types {
@@ -571,10 +592,21 @@
     name: "List<float>::_Node *"
     size: 8
     alignment: 8
-    referenced_type: "type-32"
+    referenced_type: "type-35"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "List<float>::_Node *"
-    self_type: "type-33"
+    self_type: "type-36"
+  }
+}
+pointer_types {
+  type_info {
+    name: "const List<float>::_Node *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-39"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+    linker_set_key: "const List<float>::_Node *"
+    self_type: "type-40"
   }
 }
 pointer_types {
@@ -582,10 +614,32 @@
     name: "List<int>::_Node *"
     size: 8
     alignment: 8
-    referenced_type: "type-36"
+    referenced_type: "type-42"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "List<int>::_Node *"
-    self_type: "type-37"
+    self_type: "type-43"
+  }
+}
+pointer_types {
+  type_info {
+    name: "List<int> *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-41"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+    linker_set_key: "List<int> *"
+    self_type: "type-44"
+  }
+}
+pointer_types {
+  type_info {
+    name: "StackNode<int> *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-45"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+    linker_set_key: "StackNode<int> *"
+    self_type: "type-46"
   }
 }
 pointer_types {
@@ -593,10 +647,21 @@
     name: "const char *"
     size: 8
     alignment: 8
-    referenced_type: "type-38"
+    referenced_type: "type-47"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "const char *"
-    self_type: "type-39"
+    self_type: "type-48"
+  }
+}
+lvalue_reference_types {
+  type_info {
+    name: "int &"
+    size: 8
+    alignment: 8
+    referenced_type: "type-2"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+    linker_set_key: "int &"
+    self_type: "type-30"
   }
 }
 lvalue_reference_types {
@@ -604,10 +669,21 @@
     name: "const float &"
     size: 8
     alignment: 8
-    referenced_type: "type-25"
+    referenced_type: "type-27"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "const float &"
-    self_type: "type-34"
+    self_type: "type-37"
+  }
+}
+lvalue_reference_types {
+  type_info {
+    name: "float &"
+    size: 8
+    alignment: 8
+    referenced_type: "type-3"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+    linker_set_key: "float &"
+    self_type: "type-38"
   }
 }
 builtin_types {
@@ -693,10 +769,10 @@
     name: "wchar_t"
     size: 4
     alignment: 4
-    referenced_type: "type-20"
+    referenced_type: "type-22"
     source_file: ""
     linker_set_key: "wchar_t"
-    self_type: "type-20"
+    self_type: "type-22"
   }
   is_unsigned: false
   is_integral: true
@@ -706,10 +782,10 @@
     name: "char"
     size: 1
     alignment: 1
-    referenced_type: "type-40"
+    referenced_type: "type-49"
     source_file: ""
     linker_set_key: "char"
-    self_type: "type-40"
+    self_type: "type-49"
   }
   is_unsigned: false
   is_integral: true
@@ -736,7 +812,7 @@
     referenced_type: "type-2"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "const int"
-    self_type: "type-24"
+    self_type: "type-26"
   }
   is_const: true
   is_volatile: false
@@ -750,7 +826,7 @@
     referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "const float"
-    self_type: "type-25"
+    self_type: "type-27"
   }
   is_const: true
   is_volatile: false
@@ -761,10 +837,24 @@
     name: "const CPPHello"
     size: 56
     alignment: 8
-    referenced_type: "type-23"
+    referenced_type: "type-25"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "const CPPHello"
-    self_type: "type-28"
+    self_type: "type-32"
+  }
+  is_const: true
+  is_volatile: false
+  is_restricted: false
+}
+qualified_types {
+  type_info {
+    name: "const List<float>::_Node"
+    size: 24
+    alignment: 8
+    referenced_type: "type-35"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+    linker_set_key: "const List<float>::_Node"
+    self_type: "type-39"
   }
   is_const: true
   is_volatile: false
@@ -775,10 +865,10 @@
     name: "const char"
     size: 1
     alignment: 1
-    referenced_type: "type-40"
+    referenced_type: "type-49"
     source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
     linker_set_key: "const char"
-    self_type: "type-38"
+    self_type: "type-47"
   }
   is_const: true
   is_volatile: false
@@ -845,10 +935,22 @@
 }
 functions {
   return_type: "type-2"
+  function_name: "uses_forward_decl"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+  parameters {
+    referenced_type: "type-20"
+    default_arg: false
+    is_this_ptr: false
+  }
+  linker_set_key: "uses_forward_decl"
+  access: public_access
+}
+functions {
+  return_type: "type-2"
   function_name: "CPPHello::again"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-26"
+    referenced_type: "type-28"
     default_arg: false
     is_this_ptr: true
   }
@@ -860,7 +962,7 @@
   function_name: "CPPHello::CPPHello"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-26"
+    referenced_type: "type-28"
     default_arg: false
     is_this_ptr: true
   }
@@ -872,7 +974,7 @@
   function_name: "CPPHello::CPPHello"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-26"
+    referenced_type: "type-28"
     default_arg: false
     is_this_ptr: true
   }
@@ -884,7 +986,7 @@
   function_name: "CPPHello::test_enum"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-26"
+    referenced_type: "type-28"
     default_arg: false
     is_this_ptr: true
   }
@@ -892,21 +994,38 @@
   access: public_access
 }
 functions {
+  return_type: "type-6"
+  function_name: "fooVariadic"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+  parameters {
+    referenced_type: "type-30"
+    default_arg: false
+    is_this_ptr: false
+  }
+  parameters {
+    referenced_type: "type-31"
+    default_arg: false
+    is_this_ptr: false
+  }
+  linker_set_key: "_Z11fooVariadicRiPiz"
+  access: public_access
+}
+functions {
   return_type: "type-2"
   function_name: "boo"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-28"
+    referenced_type: "type-32"
     default_arg: false
     is_this_ptr: false
   }
   parameters {
-    referenced_type: "type-29"
+    referenced_type: "type-31"
     default_arg: false
     is_this_ptr: false
   }
   parameters {
-    referenced_type: "type-30"
+    referenced_type: "type-33"
     default_arg: false
     is_this_ptr: false
   }
@@ -918,12 +1037,12 @@
   function_name: "List<float>::_Node::_Node"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-33"
+    referenced_type: "type-36"
     default_arg: false
     is_this_ptr: true
   }
   parameters {
-    referenced_type: "type-34"
+    referenced_type: "type-37"
     default_arg: false
     is_this_ptr: false
   }
@@ -935,12 +1054,12 @@
   function_name: "List<float>::_Node::_Node"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-33"
+    referenced_type: "type-36"
     default_arg: false
     is_this_ptr: true
   }
   parameters {
-    referenced_type: "type-34"
+    referenced_type: "type-37"
     default_arg: false
     is_this_ptr: false
   }
@@ -952,7 +1071,7 @@
   function_name: "List<float>::_Node::~_Node"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-33"
+    referenced_type: "type-36"
     default_arg: false
     is_this_ptr: true
   }
@@ -964,7 +1083,7 @@
   function_name: "List<float>::_Node::~_Node"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-33"
+    referenced_type: "type-36"
     default_arg: false
     is_this_ptr: true
   }
@@ -972,16 +1091,69 @@
   access: public_access
 }
 functions {
-  return_type: "type-31"
-  function_name: "castInterface"
+  return_type: "type-38"
+  function_name: "List<float>::_Node::getRef"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   parameters {
-    referenced_type: "type-31"
+    referenced_type: "type-36"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN4ListIfE5_Node6getRefEv"
+  access: public_access
+}
+functions {
+  return_type: "type-37"
+  function_name: "List<float>::_Node::getRef"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+  parameters {
+    referenced_type: "type-40"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZNK4ListIfE5_Node6getRefEv"
+  access: public_access
+}
+functions {
+  return_type: "type-6"
+  function_name: "List<float>::_Node::PrivateNode"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+  parameters {
+    referenced_type: "type-36"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN4ListIfE5_Node11PrivateNodeEv"
+  access: private_access
+}
+functions {
+  return_type: "type-2"
+  function_name: "ListMangle"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+  parameters {
+    referenced_type: "type-44"
     default_arg: false
     is_this_ptr: false
   }
   parameters {
-    referenced_type: "type-39"
+    referenced_type: "type-46"
+    default_arg: false
+    is_this_ptr: false
+  }
+  linker_set_key: "_Z10ListMangleP4ListIiEP9StackNodeIiE"
+  access: public_access
+}
+functions {
+  return_type: "type-34"
+  function_name: "castInterface"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
+  parameters {
+    referenced_type: "type-34"
+    default_arg: false
+    is_this_ptr: false
+  }
+  parameters {
+    referenced_type: "type-48"
     default_arg: false
     is_this_ptr: false
   }
@@ -1046,20 +1218,20 @@
   name: "float_list_test"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   linker_set_key: "float_list_test"
-  referenced_type: "type-31"
+  referenced_type: "type-34"
   access: public_access
 }
 global_vars {
   name: "int_list_test"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   linker_set_key: "int_list_test"
-  referenced_type: "type-35"
+  referenced_type: "type-41"
   access: public_access
 }
 global_vars {
   name: "node"
   source_file: "/development/vndk/tools/header-checker/tests/input/example1.h"
   linker_set_key: "node"
-  referenced_type: "type-32"
+  referenced_type: "type-35"
   access: public_access
 }
diff --git a/vndk/tools/header-checker/tests/expected/example2.h b/vndk/tools/header-checker/tests/expected/example2.h
index 2b1f154..316441c 100644
--- a/vndk/tools/header-checker/tests/expected/example2.h
+++ b/vndk/tools/header-checker/tests/expected/example2.h
@@ -53,26 +53,31 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTIN5test210HelloAgainE"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN5test210HelloAgain5againEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN5test210HelloAgainD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN5test210HelloAgainD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -119,10 +124,10 @@
     name: "test3::ByeAgain<float>"
     size: 8
     alignment: 4
-    referenced_type: "type-15"
+    referenced_type: "type-16"
     source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
     linker_set_key: "test3::ByeAgain<float>"
-    self_type: "type-15"
+    self_type: "type-16"
   }
   fields {
     referenced_type: "type-3"
@@ -152,10 +157,10 @@
     name: "test3::Outer"
     size: 4
     alignment: 4
-    referenced_type: "type-17"
+    referenced_type: "type-19"
     source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
     linker_set_key: "test3::Outer"
-    self_type: "type-17"
+    self_type: "type-19"
   }
   fields {
     referenced_type: "type-2"
@@ -174,10 +179,10 @@
     name: "test3::Outer::Inner"
     size: 4
     alignment: 4
-    referenced_type: "type-18"
+    referenced_type: "type-20"
     source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
     linker_set_key: "test3::Outer::Inner"
-    self_type: "type-18"
+    self_type: "type-20"
   }
   fields {
     referenced_type: "type-2"
@@ -204,11 +209,11 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 10
-    name: "Foo_s::foosball"
+    name: "foosball"
   }
   enum_fields {
     enum_field_value: 11
-    name: "Foo_s::foosbat"
+    name: "foosbat"
   }
   access: public_access
   tag_info {
@@ -220,19 +225,19 @@
     name: "test3::Kind"
     size: 4
     alignment: 4
-    referenced_type: "type-16"
+    referenced_type: "type-18"
     source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
     linker_set_key: "test3::Kind"
-    self_type: "type-16"
+    self_type: "type-18"
   }
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 24
-    name: "test3::Kind::kind1"
+    name: "test3::kind1"
   }
   enum_fields {
     enum_field_value: 2312
-    name: "test3::Kind::kind2"
+    name: "test3::kind2"
   }
   access: public_access
   tag_info {
@@ -247,7 +252,29 @@
     referenced_type: "type-4"
     source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
     linker_set_key: "test2::HelloAgain *"
-    self_type: "type-7"
+    self_type: "type-6"
+  }
+}
+pointer_types {
+  type_info {
+    name: "test3::ByeAgain<double> *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-13"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
+    linker_set_key: "test3::ByeAgain<double> *"
+    self_type: "type-15"
+  }
+}
+pointer_types {
+  type_info {
+    name: "test3::ByeAgain<float> *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-16"
+    source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
+    linker_set_key: "test3::ByeAgain<float> *"
+    self_type: "type-17"
   }
 }
 builtin_types {
@@ -281,10 +308,10 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "type-6"
+    referenced_type: "type-7"
     source_file: ""
     linker_set_key: "void"
-    self_type: "type-6"
+    self_type: "type-7"
   }
   is_unsigned: false
   is_integral: false
@@ -354,11 +381,23 @@
   }
 }
 functions {
-  return_type: "type-6"
+  return_type: "type-2"
+  function_name: "test2::HelloAgain::again"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
+  parameters {
+    referenced_type: "type-6"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN5test210HelloAgain5againEv"
+  access: public_access
+}
+functions {
+  return_type: "type-7"
   function_name: "test2::HelloAgain::~HelloAgain"
   source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
   parameters {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     default_arg: false
     is_this_ptr: true
   }
@@ -366,11 +405,11 @@
   access: public_access
 }
 functions {
-  return_type: "type-6"
+  return_type: "type-7"
   function_name: "test2::HelloAgain::~HelloAgain"
   source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
   parameters {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     default_arg: false
     is_this_ptr: true
   }
@@ -378,11 +417,11 @@
   access: public_access
 }
 functions {
-  return_type: "type-6"
+  return_type: "type-7"
   function_name: "test2::HelloAgain::~HelloAgain"
   source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
   parameters {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     default_arg: false
     is_this_ptr: true
   }
@@ -390,6 +429,70 @@
   access: public_access
 }
 functions {
+  return_type: "type-14"
+  function_name: "test3::ByeAgain<double>::method_foo"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
+  parameters {
+    referenced_type: "type-15"
+    default_arg: false
+    is_this_ptr: true
+  }
+  parameters {
+    referenced_type: "type-14"
+    default_arg: false
+    is_this_ptr: false
+  }
+  linker_set_key: "_ZN5test38ByeAgainIdE10method_fooEd"
+  access: public_access
+}
+functions {
+  return_type: "type-3"
+  function_name: "test3::ByeAgain<float>::method_foo"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
+  parameters {
+    referenced_type: "type-17"
+    default_arg: false
+    is_this_ptr: true
+  }
+  parameters {
+    referenced_type: "type-2"
+    default_arg: false
+    is_this_ptr: false
+  }
+  linker_set_key: "_ZN5test38ByeAgainIfE10method_fooEi"
+  access: public_access
+}
+functions {
+  return_type: "type-12"
+  function_name: "test3::Begin"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
+  parameters {
+    referenced_type: "type-3"
+    default_arg: false
+    is_this_ptr: false
+  }
+  parameters {
+    referenced_type: "type-2"
+    default_arg: false
+    is_this_ptr: false
+  }
+  parameters {
+    referenced_type: "type-2"
+    default_arg: false
+    is_this_ptr: false
+  }
+  template_info {
+    elements {
+      referenced_type: "type-3"
+    }
+    elements {
+      referenced_type: "type-2"
+    }
+  }
+  linker_set_key: "_ZN5test35BeginIfiEEbT_T0_i"
+  access: public_access
+}
+functions {
   return_type: "type-12"
   function_name: "test3::End"
   source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
@@ -401,6 +504,18 @@
   linker_set_key: "_ZN5test33EndEf"
   access: public_access
 }
+functions {
+  return_type: "type-21"
+  function_name: "test3::Dummy"
+  source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
+  parameters {
+    referenced_type: "type-2"
+    default_arg: false
+    is_this_ptr: false
+  }
+  linker_set_key: "_ZN5test35DummyEi"
+  access: public_access
+}
 global_vars {
   name: "test2::HelloAgain::hello_forever"
   source_file: "/development/vndk/tools/header-checker/tests/input/example2.h"
diff --git a/vndk/tools/header-checker/tests/expected/example4.h b/vndk/tools/header-checker/tests/expected/example4.h
deleted file mode 100644
index 2d0a935..0000000
--- a/vndk/tools/header-checker/tests/expected/example4.h
+++ /dev/null
@@ -1,96 +0,0 @@
-record_types {
-  type_info {
-    name: "Test"
-    size: 16
-    alignment: 8
-    referenced_type: "type-1"
-    source_file: "/development/vndk/tools/header-checker/tests/input/example4.h"
-    linker_set_key: "Test"
-    self_type: "type-1"
-  }
-  fields {
-    referenced_type: "type-2"
-    field_offset: 64
-    field_name: "c"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI4Test"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN4Test3fooEv"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS4Test"
-  }
-}
-record_types {
-  type_info {
-    name: "TestChild"
-    size: 16
-    alignment: 8
-    referenced_type: "type-3"
-    source_file: "/development/vndk/tools/header-checker/tests/input/example4.h"
-    linker_set_key: "TestChild"
-    self_type: "type-3"
-  }
-  fields {
-    referenced_type: "type-2"
-    field_offset: 96
-    field_name: "d"
-    access: private_access
-  }
-  base_specifiers {
-    referenced_type: "type-1"
-    is_virtual: false
-    access: public_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI9TestChild"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN9TestChild3fooEv"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS9TestChild"
-  }
-}
-builtin_types {
-  type_info {
-    name: "int"
-    size: 4
-    alignment: 4
-    referenced_type: "type-2"
-    source_file: ""
-    linker_set_key: "int"
-    self_type: "type-2"
-  }
-  is_unsigned: false
-  is_integral: true
-}
diff --git a/vndk/tools/header-checker/tests/expected/func_decl_no_args.h b/vndk/tools/header-checker/tests/expected/func_decl_no_args.h
deleted file mode 100644
index e69de29..0000000
--- a/vndk/tools/header-checker/tests/expected/func_decl_no_args.h
+++ /dev/null
diff --git a/vndk/tools/header-checker/tests/expected/func_decl_one_arg.h b/vndk/tools/header-checker/tests/expected/func_decl_one_arg.h
deleted file mode 100644
index e69de29..0000000
--- a/vndk/tools/header-checker/tests/expected/func_decl_one_arg.h
+++ /dev/null
diff --git a/vndk/tools/header-checker/tests/expected/func_decl_one_arg_ret.h b/vndk/tools/header-checker/tests/expected/func_decl_one_arg_ret.h
deleted file mode 100644
index e69de29..0000000
--- a/vndk/tools/header-checker/tests/expected/func_decl_one_arg_ret.h
+++ /dev/null
diff --git a/vndk/tools/header-checker/tests/expected/func_decl_two_args.h b/vndk/tools/header-checker/tests/expected/func_decl_two_args.h
deleted file mode 100644
index e69de29..0000000
--- a/vndk/tools/header-checker/tests/expected/func_decl_two_args.h
+++ /dev/null
diff --git a/vndk/tools/header-checker/tests/gen_all.py b/vndk/tools/header-checker/tests/gen_all.py
index 78ba2b3..7b4f5d8 100755
--- a/vndk/tools/header-checker/tests/gen_all.py
+++ b/vndk/tools/header-checker/tests/gen_all.py
@@ -9,26 +9,18 @@
 sys.path.insert(1, import_path)
 
 from utils import run_header_abi_dumper
-from utils import copy_reference_dump_content
 from module import Module
+from test import INPUT_DIR
+from test import EXPECTED_DIR
+from test import make_and_copy_reference_dumps
 
-SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
-INPUT_DIR = os.path.join(SCRIPT_DIR, 'input')
-EXPECTED_DIR = os.path.join(SCRIPT_DIR, 'expected')
-REFERENCE_DUMP_DIR = os.path.join(SCRIPT_DIR, 'reference_dumps')
 FILE_EXTENSIONS = ['h', 'hpp', 'hxx', 'cpp', 'cc', 'c']
 
-def make_and_copy_reference_dumps(module, default_cflags=[],
-                                  reference_dump_dir=REFERENCE_DUMP_DIR):
-    lsdump_content = module.make_lsdump(default_cflags)
-    return copy_reference_dump_content(module.get_name(), lsdump_content,
-                                       reference_dump_dir, '',
-                                       module.get_arch())
 
 def main():
     patt = re.compile(
-        '^.*\\.(?:' + \
-        '|'.join('(?:' + re.escape(ext) + ')' for ext in FILE_EXTENSIONS) + \
+        '^.*\\.(?:' +
+        '|'.join('(?:' + re.escape(ext) + ')' for ext in FILE_EXTENSIONS) +
         ')$')
     input_dir_prefix_len = len(INPUT_DIR) + 1
     for base, dirnames, filenames in os.walk(INPUT_DIR):
@@ -42,16 +34,17 @@
             output_path = os.path.join(EXPECTED_DIR, input_rel_path)
 
             print('generating', output_path, '...')
-            output_content = run_header_abi_dumper(input_path, True)
+            output_content = run_header_abi_dumper(input_path)
 
             os.makedirs(os.path.dirname(output_path), exist_ok=True)
             with open(output_path, 'w') as f:
                 f.write(output_content)
     modules = Module.get_test_modules()
     for module in modules:
-        make_and_copy_reference_dumps(module)
+        print('Created abi dump at', make_and_copy_reference_dumps(module))
 
     return 0
 
+
 if __name__ == '__main__':
     sys.exit(main())
diff --git a/vndk/tools/header-checker/tests/gen_expected_output.py b/vndk/tools/header-checker/tests/gen_expected_output.py
deleted file mode 100755
index f285183..0000000
--- a/vndk/tools/header-checker/tests/gen_expected_output.py
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-from utils import run_header_abi_dumper
-
-def main():
-    sys.stdout.write(run_header_abi_dumper(sys.argv[1], True, sys.argv[2:]))
-    return 0
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/vndk/tools/header-checker/tests/input/example1.h b/vndk/tools/header-checker/tests/input/example1.h
index 08c3869..a278d32 100644
--- a/vndk/tools/header-checker/tests/input/example1.h
+++ b/vndk/tools/header-checker/tests/input/example1.h
@@ -36,7 +36,8 @@
   const int cpp_foo;
   cfloat_type cpp_bar;
   virtual int again() { return 0; }
-  CPPHello() : cpp_foo(20), cpp_bar(1.234) { }
+  CPPHello() : cpp_foo(20), cpp_bar(1.234) {}
+  CPPHello(CPPHello &) = delete;
   enum Bla{BLA = 1};
   int test_enum() {return CPPHello::BLA;}
 };
@@ -57,7 +58,7 @@
 public:
   StackNode(T t, StackNode* next = nullptr)
     : value_(static_cast<T&&>(t)),
-      next_(next) { }
+      next_(next) {}
 };
 
 template<typename T>
@@ -66,7 +67,7 @@
   StackNode<T>* head_;
 
 public:
-  Stack() : head_(nullptr) { }
+  Stack() : head_(nullptr) {}
 
   void push(T t) {
     head_ = new StackNode<T>(static_cast<T&&>(t), head_);
diff --git a/vndk/tools/header-checker/tests/input/example2.h b/vndk/tools/header-checker/tests/input/example2.h
index bc225eb..67f92de 100644
--- a/vndk/tools/header-checker/tests/input/example2.h
+++ b/vndk/tools/header-checker/tests/input/example2.h
@@ -25,7 +25,7 @@
   virtual ~HelloAgain() {}
 };
 struct NowWeCrash;
-} // namespace test2
+}  // namespace test2
 
 enum Foo_s {
   foosball = 10,
@@ -77,6 +77,6 @@
 
 std::vector<int *> Dummy(int t);
 
-} // namespace test3
+}  // namespace test3
 
 #endif  // EXAMPLE2_H_
diff --git a/vndk/tools/header-checker/tests/input/example3.h b/vndk/tools/header-checker/tests/input/example3.h
index d55d2d8..4a5fdd0 100644
--- a/vndk/tools/header-checker/tests/input/example3.h
+++ b/vndk/tools/header-checker/tests/input/example3.h
@@ -6,4 +6,4 @@
   float seek;
 };
 
-#endif //EXAMPLE3_H
+#endif  // EXAMPLE3_H_
diff --git a/vndk/tools/header-checker/tests/input/func_decl_no_args.h b/vndk/tools/header-checker/tests/input/func_decl_no_args.h
deleted file mode 100644
index b4bc10f..0000000
--- a/vndk/tools/header-checker/tests/input/func_decl_no_args.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef FUNC_DECL_NO_ARGS_H_
-#define FUNC_DECL_NO_ARGS_H_
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-extern void test_void();
-
-extern char test_char();
-
-extern short test_short();
-
-extern int test_int();
-
-extern long test_long();
-
-extern long long test_long_long();
-
-extern unsigned char test_unsigned_char();
-
-extern unsigned short test_unsigned_short();
-
-extern unsigned int test_unsigned_int();
-
-extern unsigned long test_unsigned_long();
-
-extern unsigned long long test_unsigned_long_long();
-
-extern float test_float();
-
-extern double test_double();
-
-extern long double test_long_double();
-
-#if defined(__cplusplus)
-}  // extern "C"
-#endif
-
-#endif  // FUNC_DECL_NO_ARGS_H_
diff --git a/vndk/tools/header-checker/tests/input/func_decl_one_arg.h b/vndk/tools/header-checker/tests/input/func_decl_one_arg.h
deleted file mode 100644
index e1c9796..0000000
--- a/vndk/tools/header-checker/tests/input/func_decl_one_arg.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef FUNC_DECL_ONE_ARG_H_
-#define FUNC_DECL_ONE_ARG_H_
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-extern void test_char(char);
-
-extern void test_short(short);
-
-extern void test_int(int);
-
-extern void test_long(long);
-
-extern void test_long_long(long long);
-
-extern void test_unsigned_char(unsigned char);
-
-extern void test_unsigned_short(unsigned short);
-
-extern void test_unsigned_int(unsigned int);
-
-extern void test_unsigned_long(unsigned long);
-
-extern void test_unsigned_long_long(unsigned long long);
-
-extern void test_float(float);
-
-extern void test_double(double);
-
-extern void test_long_double(long double);
-
-#if defined(__cplusplus)
-}  // extern "C"
-#endif
-
-#endif  // FUNC_DECL_ONE_ARG_H_
diff --git a/vndk/tools/header-checker/tests/input/func_decl_one_arg_ret.h b/vndk/tools/header-checker/tests/input/func_decl_one_arg_ret.h
deleted file mode 100644
index 84d2c63..0000000
--- a/vndk/tools/header-checker/tests/input/func_decl_one_arg_ret.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef FUNC_DECL_ONE_ARG_RET_H_
-#define FUNC_DECL_ONE_ARG_RET_H_
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-extern char test_char(char);
-
-extern short test_short(short);
-
-extern int test_int(int);
-
-extern long test_long(long);
-
-extern long long test_long_long(long long);
-
-extern unsigned char test_unsigned_char(unsigned char);
-
-extern unsigned short test_unsigned_short(unsigned short);
-
-extern unsigned int test_unsigned_int(unsigned int);
-
-extern unsigned long test_unsigned_long(unsigned long);
-
-extern unsigned long long test_unsigned_long_long(unsigned long long);
-
-extern float test_float(float);
-
-extern double test_double(double);
-
-extern long double test_long_double(long double);
-
-#if defined(__cplusplus)
-}  // extern "C"
-#endif
-
-#endif  // FUNC_DECL_ONE_ARG_RET_H_
diff --git a/vndk/tools/header-checker/tests/input/func_decl_two_args.h b/vndk/tools/header-checker/tests/input/func_decl_two_args.h
deleted file mode 100644
index 5b4c8a3..0000000
--- a/vndk/tools/header-checker/tests/input/func_decl_two_args.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef FUNC_DECL_TWO_ARGS_H_
-#define FUNC_DECL_TWO_ARGS_H_
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-extern void test_char(int, char);
-
-extern void test_short(int, short);
-
-extern void test_int(int, int);
-
-extern void test_long(int, long);
-
-extern void test_long_long(int, long long);
-
-extern void test_unsigned_char(int, unsigned char);
-
-extern void test_unsigned_short(int, unsigned short);
-
-extern void test_unsigned_int(int, unsigned int);
-
-extern void test_unsigned_long(int, unsigned long);
-
-extern void test_unsigned_long_long(int, unsigned long long);
-
-extern void test_unsigned_float(int, float);
-
-extern void test_unsigned_double(int, double);
-
-extern void test_unsigned_long_double(int, long double);
-
-#if defined(__cplusplus)
-}  // extern "C"
-#endif
-
-#endif  // FUNC_DECL_TWO_ARGS_H_
diff --git a/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_and_cpp.h b/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_and_cpp.h
index c4a7fcd..87351a0 100644
--- a/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_and_cpp.h
+++ b/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_and_cpp.h
@@ -12,7 +12,7 @@
 
 class Foo {
  public:
-  Foo(int *a, int *b) : a_(a), b_(b) { }
+  Foo(int *a, int *b) : a_(a), b_(b) {}
  private:
   int *a_;
   int *b_;
diff --git a/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h b/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h
index 42fc6e0..d19ce8d 100644
--- a/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h
+++ b/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h
@@ -6,9 +6,17 @@
   int c;
 };
 
+struct opaque_a;
+struct opaque_b;
+
 struct Cstruct {
   int a;
   struct Cinner *b;
+#ifdef OPAQUE_STRUCT_A
+  struct opaque_a *op;
+#elif OPAQUE_STRUCT_B
+  struct opaque_b *op;
+#endif
 };
 
 void CFunction(struct Cstruct **cstruct);
diff --git a/vndk/tools/header-checker/tests/integration/c_and_cpp/source2.c b/vndk/tools/header-checker/tests/integration/c_and_cpp/source2.c
index d3f0899..8cb7127 100644
--- a/vndk/tools/header-checker/tests/integration/c_and_cpp/source2.c
+++ b/vndk/tools/header-checker/tests/integration/c_and_cpp/source2.c
@@ -1,4 +1,4 @@
-#include<c_include.h>
+#include <c_include.h>
 
 void CFunction(struct Cstruct **cstruct) {
     if (cstruct) {
diff --git a/vndk/tools/header-checker/tests/integration/cpp/gold/golden_1.cpp b/vndk/tools/header-checker/tests/integration/cpp/gold/golden_1.cpp
index 60a3113..997b9f6 100644
--- a/vndk/tools/header-checker/tests/integration/cpp/gold/golden_1.cpp
+++ b/vndk/tools/header-checker/tests/integration/cpp/gold/golden_1.cpp
@@ -1,5 +1,5 @@
-#include<abstract_class.h>
-#include<additional_odr.h>
+#include <abstract_class.h>
+#include <additional_odr.h>
 
 SuperSpeaker *SuperSpeaker::CreateSuperSpeaker(int id) {
   // :)
diff --git a/vndk/tools/header-checker/tests/integration/cpp/gold/high_volume_speaker.cpp b/vndk/tools/header-checker/tests/integration/cpp/gold/high_volume_speaker.cpp
index 57a7e9b..e56f417 100644
--- a/vndk/tools/header-checker/tests/integration/cpp/gold/high_volume_speaker.cpp
+++ b/vndk/tools/header-checker/tests/integration/cpp/gold/high_volume_speaker.cpp
@@ -1,6 +1,6 @@
 #include <high_volume_speaker.h>
 
-void HighVolumeSpeaker::Speak() { }
+void HighVolumeSpeaker::Speak() {}
 
 HighVolumeSpeaker *HighVolumeSpeaker::BadPractice(BP_PARAMETER_TYPE id) {
   return nullptr;
diff --git a/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h b/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h
index 08b7d51..3af13dd 100644
--- a/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h
+++ b/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h
@@ -25,7 +25,7 @@
 #if GOLDEN_ENUM_EXTENSION
 #define LOUD_SUPERLATIVES \
     Loudest = 3, \
-    Lower = 4,\
+    Lower = 0,\
     LouderThanLoudest = 5
 #elif GOLDEN_ENUM_DIFF
 #define LOUD_SUPERLATIVES \
@@ -33,7 +33,7 @@
 #else
 #define LOUD_SUPERLATIVES \
     Loudest = 3, \
-    Lower = 4
+    Lower = 0
 #endif
 
 class SuperSpeaker {
@@ -51,15 +51,15 @@
  public:
   VIRTUAL_FUNCTIONS
   Volume SpeakLoud();
-  void SpeakLoudest() { };
-
-  virtual ~SuperSpeaker() { }
+  void SpeakLoudest() {}
+  virtual ~SuperSpeaker() {}
  private:
 #if GOLDEN_CHANGE_MEMBER_NAME_SAME_OFFSET
   int mSpeakderId_;
 #else
   int mSpeakderId;
 #endif
+
 #if GOLDEN_FUNCTION_POINTER
 #if GOLDEN_FUNCTION_POINTER_ADD_PARAM
   SuperSpeaker * (*speaker_fp)(int, char, int);
@@ -67,4 +67,17 @@
   SuperSpeaker * (*speaker_fp)(int, char);
 #endif
 #endif
+
+#if GOLDEN_WITH_INTERNAL_STRUCT
+#ifdef GOLDEN_WITH_PUBLIC_INTERNAL_STRUCT
+ public:
+#else
+ private:
+#endif
+  struct InternalStruct {
+    int internal;
+  };
+ private:
+  InternalStruct a;
+#endif  // GOLDEN_WITH_INTERNAL_STRUCT
 };
diff --git a/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h b/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h
index 11b573b..4a440fd 100644
--- a/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h
+++ b/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h
@@ -26,7 +26,11 @@
     float *speaker_float_star;
 #endif
 
+#if GOLDEN_CHANGE_INHERITANCE_TYPE
+class LowVolumeSpeaker : public virtual SuperSpeaker {
+#else
 class LowVolumeSpeaker : public SuperSpeaker {
+#endif
  public:
   virtual void Speak() override;
   virtual LISTEN_RETURN_TYPE Listen() override;
diff --git a/vndk/tools/header-checker/tests/integration/cpp/gold/low_volume_speaker.cpp b/vndk/tools/header-checker/tests/integration/cpp/gold/low_volume_speaker.cpp
index 04d9693..3abb088 100644
--- a/vndk/tools/header-checker/tests/integration/cpp/gold/low_volume_speaker.cpp
+++ b/vndk/tools/header-checker/tests/integration/cpp/gold/low_volume_speaker.cpp
@@ -1,6 +1,7 @@
 #include <low_volume_speaker.h>
 
-void LowVolumeSpeaker::Speak() { }
+void LowVolumeSpeaker::Speak() {}
+
 LISTEN_RETURN_TYPE LowVolumeSpeaker::Listen() { LISTEN_RETURN_STATEMENT }
 
 #ifdef ADD_UNEXPORTED_ELF_SYMBOL
diff --git a/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h b/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h
new file mode 100644
index 0000000..6aaec0f
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h
@@ -0,0 +1,22 @@
+#ifndef KNOWN_ISSUES_H_
+#define KNOWN_ISSUES_H_
+
+// header-abi-dumper is unable to output the following types correctly.
+
+// template<int I> struct NonTypeTemplate;
+extern NonTypeTemplate<1> non_type_template;
+
+// namespace namespace1{
+// template<typename T> class UsingTemplate;
+// }
+using namespace1::UsingTemplate;
+extern UsingTemplate<float> *using_template;
+
+// #define STDCALL __stdcall
+STDCALL return_type function_with_calling_convention();
+
+// class ClassInNameSpace;
+template <typename T> class ClassTemplate;
+extern ClassTemplate<::ClassInNameSpace> template_arg_in_namespace;
+
+#endif  // KNOWN_ISSUES_H_
diff --git a/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h b/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h
new file mode 100644
index 0000000..30a11bd
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h
@@ -0,0 +1,27 @@
+#ifndef UNDECLARED_TYPES_H_
+#define UNDECLARED_TYPES_H_
+
+using ::namespace_a::A;
+typedef const namespace_b::B *B;
+using C = namespace_c::C[];
+
+extern A a;
+extern namespace_b::template_b<B> b;
+extern const decltype(b) c;
+
+inline A &inline_function(template_c<template_d<C>> d) {
+  LocalVar e;
+  return FunctionCall(d, e);
+}
+
+class InvalidClass {
+  A member;
+
+  D member_function(E);
+  virtual void virtual_function(float);
+};
+
+#define DECLARE_VARIABLE extern TemplateInMacro<F> *template_in_macro
+DECLARE_VARIABLE;
+
+#endif  // UNDECLARED_TYPES_H_
diff --git a/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h b/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h
new file mode 100644
index 0000000..bdbe70c
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h
@@ -0,0 +1,15 @@
+class PureVirtualBase {
+ public:
+  virtual ~PureVirtualBase() = 0;
+  virtual void foo_pure() = 0;
+  virtual void foo_virtual() {}
+};
+
+class DerivedBar : public PureVirtualBase {
+ public:
+  virtual ~DerivedBar() {}
+  virtual void foo_pure() override {}
+  virtual void foo_virtual() override = 0;
+};
+
+PureVirtualBase::~PureVirtualBase() {}
diff --git a/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/pure_virtual_function.cpp b/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/pure_virtual_function.cpp
new file mode 100644
index 0000000..f4884cd
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/pure_virtual_function.cpp
@@ -0,0 +1 @@
+#include <header1.h>
diff --git a/vndk/tools/vtable-dumper/Android.bp b/vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
similarity index 62%
rename from vndk/tools/vtable-dumper/Android.bp
rename to vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
index 033c1e7..7228d3b 100644
--- a/vndk/tools/vtable-dumper/Android.bp
+++ b/vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2016 The Android Open Source Project
+// Copyright (C) 2019 The Android Open Source Project
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -14,25 +14,10 @@
 // limitations under the License.
 //
 
-cc_binary_host {
-    name: "vndk-vtable-dumper",
-
-    defaults: [
-        "clang-defaults",
-    ],
-
+cc_library {
+    name: "libversion_script_example",
     srcs: [
-        "elf_handling.cpp",
-        "vndk_vtable_dumper.cpp",
+        "example.cpp",
     ],
-
-    cflags: [
-        "-Wall",
-        "-Werror",
-        "-std=c++11",
-    ],
-
-    shared_libs: [
-        "libLLVM_android",
-    ],
+    enabled: false,
 }
diff --git a/vndk/tools/header-checker/tests/integration/version_script_example/example.cpp b/vndk/tools/header-checker/tests/integration/version_script_example/example.cpp
new file mode 100644
index 0000000..5ada1f5
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/version_script_example/example.cpp
@@ -0,0 +1,6 @@
+#include "example.h"
+
+void test1() {}
+void test2() {}
+void Test3::test() {}
+void Test4::test() {}
diff --git a/vndk/tools/header-checker/tests/integration/version_script_example/example.h b/vndk/tools/header-checker/tests/integration/version_script_example/example.h
new file mode 100644
index 0000000..dd6079e
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/version_script_example/example.h
@@ -0,0 +1,12 @@
+extern "C" void test1();
+extern "C" void test2();
+
+class Test3 {
+ public:
+  void test();
+};
+
+class Test4 {
+ public:
+  void test();
+};
diff --git a/vndk/tools/header-checker/tests/integration/version_script_example/example.map.txt b/vndk/tools/header-checker/tests/integration/version_script_example/example.map.txt
new file mode 100644
index 0000000..24dd26d
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/version_script_example/example.map.txt
@@ -0,0 +1,17 @@
+LIBVERSION_SCRIPT_EXAMPLE_1.0 {
+  global:
+    test1;  # mytag
+    extern "C++" {
+      Test3::*;  # mytag
+    };
+  local:
+    *;
+};
+
+LIBVERSION_SCRIPT_EXAMPLE_PRIVATE {
+  global:
+    test2;
+    extern "C++" {
+      Test4::*;
+    };
+} LIBVERSION_SCRIPT_EXAMPLE_1.0;
diff --git a/vndk/tools/header-checker/tests/integration/version_script_example/prebuilts/libversion_script_example.so b/vndk/tools/header-checker/tests/integration/version_script_example/prebuilts/libversion_script_example.so
new file mode 100755
index 0000000..9a5cecd
--- /dev/null
+++ b/vndk/tools/header-checker/tests/integration/version_script_example/prebuilts/libversion_script_example.so
Binary files differ
diff --git a/vndk/tools/header-checker/tests/module.py b/vndk/tools/header-checker/tests/module.py
index 82f6baa..3c28177 100755
--- a/vndk/tools/header-checker/tests/module.py
+++ b/vndk/tools/header-checker/tests/module.py
@@ -8,409 +8,553 @@
 import_path = os.path.abspath(os.path.join(import_path, 'utils'))
 sys.path.insert(1, import_path)
 
+from utils import run_header_abi_dumper
 from utils import run_header_abi_dumper_on_file
 from utils import run_header_abi_linker
-from utils import TARGET_ARCHS
 from utils import SOURCE_ABI_DUMP_EXT
 
+
 SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
-INPUT_DIR = os.path.join(SCRIPT_DIR, 'input')
-EXPECTED_DIR = os.path.join(SCRIPT_DIR, 'expected')
-REF_DUMP_DIR = os.path.join(SCRIPT_DIR,  'reference_dumps')
-ARCH_TARGET_CFLAGS = {'arm': ['-target', 'arm-linux-androideabi'],
-                      'arm64': ['-target', 'aarch64-linux-android'],
-                      'x86' : ['-target', 'i386-linux-androideabi'],
-                      'x86_64' : ['-target', 'x86_64-linux-android'],
-                      'mips' : ['-target', 'mips-linux-androideabi'],
-                      'mips64' : ['-target', 'mips64-linux-android'],}
+ARCH_TARGET_CFLAGS = {
+    'arm': ('-target', 'arm-linux-androideabi'),
+    'arm64': ('-target', 'aarch64-linux-android'),
+    'x86': ('-target', 'i386-linux-androideabi'),
+    'x86_64': ('-target', 'x86_64-linux-android'),
+    'mips': ('-target', 'mips-linux-androideabi'),
+    'mips64': ('-target', 'mips64-linux-android'),
+}
+TARGET_ARCHES = ['arm', 'arm64', 'x86', 'x86_64', 'mips', 'mips64']
+
 
 def relative_to_abs_path(relative_path):
     return os.path.join(SCRIPT_DIR, relative_path)
 
+
 def relative_to_abs_path_list(relative_path_list):
     abs_paths = []
     for relative_path in relative_path_list:
         abs_paths.append(relative_to_abs_path(relative_path))
     return abs_paths
 
+
 class Module(object):
-    def __init__(self, name, arch, srcs, version_script, cflags,
-                 export_include_dirs, api):
+    def __init__(self, name, arch, cflags, export_include_dirs):
         self.name = name
         self.arch = arch
-        self.srcs = relative_to_abs_path_list(srcs)
-        self.version_script = relative_to_abs_path(version_script)
-        self.cflags = cflags
-        self.arch_cflags = ['']
-        if self.arch != '':
-            self.arch_cflags = ARCH_TARGET_CFLAGS.get(self.arch)
-        self.export_include_dirs = relative_to_abs_path_list(export_include_dirs)
-        self.api = api
+        self.cflags = tuple(cflags)
+        self.arch_cflags = ARCH_TARGET_CFLAGS.get(self.arch, tuple())
+        self.export_include_dirs = relative_to_abs_path_list(
+            export_include_dirs)
 
-    def get_name(self):
-        return self.name
+    def get_dump_name(self):
+        """Returns the module name followed by file extension."""
+        raise NotImplementedError()
 
-    def get_arch(self):
-        return self.arch
+    def make_dump(self):
+        """Returns the dump content as a string."""
+        raise NotImplementedError()
 
-    def get_srcs(self):
-        return self.srcs
+    def mutate_for_arch(self, target_arch):
+        """Returns a clone of this instance with arch=target_arch."""
+        raise NotImplementedError()
 
-    def get_export_include_dirs(self):
-        return self.export_include_dirs
-
-    def get_cflags(self):
-        return self.cflags
-
-    def get_version_script(self):
-        return self.version_script
-
-    def get_api(self):
-        return self.api
-
-    def make_lsdump(self, default_cflags):
-        """ For each source file, produce a .sdump file, and link them to form
-            an lsump file"""
-        dumps_to_link = []
-        with tempfile.TemporaryDirectory() as tmp:
-            output_lsdump = os.path.join(tmp, self.name) + SOURCE_ABI_DUMP_EXT
-            for src in self.srcs:
-                output_path = os.path.join(tmp, os.path.basename(src)) + '.sdump'
-                dumps_to_link.append(output_path)
-                run_header_abi_dumper_on_file(
-                    src, output_path, self.export_include_dirs,
-                    self.cflags + self.arch_cflags + default_cflags)
-            return run_header_abi_linker(output_lsdump, dumps_to_link,
-                                         self.version_script, self.api,
-                                         self.arch)
-    @staticmethod
-    def mutate_module_for_arch(module, target_arch):
-        name = module.get_name()
-        srcs = module.get_srcs()
-        version_script = module.get_version_script()
-        cflags = module.get_cflags()
-        export_include_dirs = module.get_export_include_dirs()
-        api = module.get_api()
-        return Module(name, target_arch, srcs, version_script, cflags,
-                      export_include_dirs, api)
-
-    @staticmethod
-    def mutate_module_for_all_arches(module):
+    def mutate_for_all_arches(self):
+        if self.arch:
+            return [self]
         modules = []
-        for target_arch in TARGET_ARCHS:
-            modules.append(Module.mutate_module_for_arch(module, target_arch))
+        for target_arch in TARGET_ARCHES:
+            modules.append(self.mutate_for_arch(target_arch))
         return modules
 
     @staticmethod
     def get_test_modules():
         modules = []
         for module in TEST_MODULES.values():
-            if module.get_arch() == '':
-                modules += Module.mutate_module_for_all_arches(module)
+            modules += module.mutate_for_all_arches()
         return modules
 
     @staticmethod
-    def get_test_module_by_name(name):
-        return TEST_MODULES[name]
+    def get_test_modules_by_name(name):
+        return TEST_MODULES.get(name).mutate_for_all_arches()
+
+
+class SdumpModule(Module):
+    def __init__(self, name, src, export_include_dirs=tuple(), cflags=tuple(),
+                 arch='', dumper_flags=tuple()):
+        super(SdumpModule, self).__init__(name, arch, cflags,
+                                          export_include_dirs)
+        self.src = relative_to_abs_path(src)
+        self.dumper_flags = dumper_flags
+
+    def get_dump_name(self):
+        return self.name + '.sdump'
+
+    def make_dump(self):
+        return run_header_abi_dumper(
+            self.src, cflags=self.cflags,
+            export_include_dirs=self.export_include_dirs,
+            flags=self.dumper_flags)
+
+    def mutate_for_arch(self, target_arch):
+        return SdumpModule(self.name, self.src, self.export_include_dirs,
+                           self.cflags, target_arch, self.dumper_flags)
+
+
+class LsdumpModule(Module):
+    def __init__(self, name, srcs, version_script, export_include_dirs,
+                 cflags=tuple(), arch='', api='current', dumper_flags=tuple(),
+                 linker_flags=tuple()):
+        super(LsdumpModule, self).__init__(name, arch, cflags,
+                                           export_include_dirs)
+        self.srcs = relative_to_abs_path_list(srcs)
+        self.version_script = relative_to_abs_path(version_script)
+        self.api = api
+        self.dumper_flags = dumper_flags
+        self.linker_flags = linker_flags
+
+    def get_dump_name(self):
+        return self.name + SOURCE_ABI_DUMP_EXT
+
+    def make_dump(self):
+        """For each source file, produce a .sdump file, and link them to form
+           an lsump file."""
+        dumps_to_link = []
+        with tempfile.TemporaryDirectory() as tmp:
+            output_lsdump = os.path.join(tmp, self.get_dump_name())
+            for src in self.srcs:
+                output_path = os.path.join(tmp,
+                                           os.path.basename(src) + '.sdump')
+                dumps_to_link.append(output_path)
+                run_header_abi_dumper_on_file(
+                    src, output_path, self.export_include_dirs,
+                    self.cflags + self.arch_cflags,
+                    self.dumper_flags)
+            return run_header_abi_linker(output_lsdump, dumps_to_link,
+                                         self.version_script, self.api,
+                                         self.arch, self.linker_flags)
+
+    def mutate_for_arch(self, target_arch):
+        return LsdumpModule(self.name, self.srcs, self.version_script,
+                            self.export_include_dirs, self.cflags, target_arch,
+                            self.api, self.dumper_flags, self.linker_flags)
+
 
 TEST_MODULES = [
-    Module(
-        name = 'libc_and_cpp',
-        srcs = ['integration/c_and_cpp/source1.cpp',
-                'integration/c_and_cpp/source2.c',
-                ],
-        version_script = 'integration/c_and_cpp/map.txt',
-        export_include_dirs = ['integration/c_and_cpp/include'],
-        cflags = [],
-        arch = '',
-        api = 'current',
+    SdumpModule(
+        name='undeclared_types.h',
+        src='integration/cpp/header/undeclared_types.h',
+        arch='',
+        dumper_flags=['-suppress-errors', '-output-format', 'Json']),
+    SdumpModule(
+        name='known_issues.h',
+        src='integration/cpp/header/known_issues.h',
+        arch='',
+        dumper_flags=['-suppress-errors', '-output-format', 'Json']),
+    LsdumpModule(
+        name='libc_and_cpp',
+        srcs=[
+            'integration/c_and_cpp/source1.cpp',
+            'integration/c_and_cpp/source2.c',
+        ],
+        version_script='integration/c_and_cpp/map.txt',
+        export_include_dirs=['integration/c_and_cpp/include'],
     ),
-    Module(
-        name = 'libc_and_cpp_with_unused_struct',
-        srcs = ['integration/c_and_cpp/source1.cpp',
-                'integration/c_and_cpp/source2.c',
-                ],
-        version_script = 'integration/c_and_cpp/map.txt',
-        export_include_dirs = ['integration/c_and_cpp/include'],
-        cflags = ['-DINCLUDE_UNUSED_STRUCTS=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libc_and_cpp_with_opaque_ptr_a',
+        srcs=[
+            'integration/c_and_cpp/source1.cpp',
+            'integration/c_and_cpp/source2.c',
+        ],
+        version_script='integration/c_and_cpp/map.txt',
+        export_include_dirs=['integration/c_and_cpp/include'],
+        cflags=['-DOPAQUE_STRUCT_A=1'],
     ),
-    Module(
-        name = 'libc_and_cpp_with_unused_cstruct',
-        srcs = ['integration/c_and_cpp/source1.cpp',
-                'integration/c_and_cpp/source2.c',
-                ],
-        version_script = 'integration/c_and_cpp/map.txt',
-        export_include_dirs = ['integration/c_and_cpp/include'],
-        cflags = ['-DINCLUDE_UNUSED_STRUCTS=1', '-DMAKE_UNUSED_STRUCT_C=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libc_and_cpp_with_opaque_ptr_b',
+        srcs=[
+            'integration/c_and_cpp/source1.cpp',
+            'integration/c_and_cpp/source2.c',
+        ],
+        version_script='integration/c_and_cpp/map.txt',
+        export_include_dirs=['integration/c_and_cpp/include'],
+        cflags=['-DOPAQUE_STRUCT_B=1'],
     ),
-    Module(
-        name = 'libgolden_cpp',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = [],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libc_and_cpp_with_unused_struct',
+        srcs=[
+            'integration/c_and_cpp/source1.cpp',
+            'integration/c_and_cpp/source2.c',
+        ],
+        version_script='integration/c_and_cpp/map.txt',
+        export_include_dirs=['integration/c_and_cpp/include'],
+        cflags=['-DINCLUDE_UNUSED_STRUCTS=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_odr',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DTEST_ODR'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libc_and_cpp_with_unused_cstruct',
+        srcs=[
+            'integration/c_and_cpp/source1.cpp',
+            'integration/c_and_cpp/source2.c',
+        ],
+        version_script='integration/c_and_cpp/map.txt',
+        export_include_dirs=['integration/c_and_cpp/include'],
+        cflags=['-DINCLUDE_UNUSED_STRUCTS=1', '-DMAKE_UNUSED_STRUCT_C=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_add_function',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map_add_function.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_ADD_FUNCTION=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
     ),
-    Module(
-        name = 'libgolden_cpp_add_function_and_unexported_elf',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = \
-            'integration/cpp/gold/map_add_function_elf_symbol.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_ADD_FUNCTION=1', '-DADD_UNEXPORTED_ELF_SYMBOL'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_odr',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DTEST_ODR'],
     ),
-    Module(
-        name = 'libgolden_cpp_change_function_access',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_CHANGE_FUNCTION_ACCESS=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_add_function',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map_add_function.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_ADD_FUNCTION=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_add_global_variable',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map_added_globvar.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_ADD_GLOBVAR=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_add_function_and_unexported_elf',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map_add_function_elf_symbol.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_ADD_FUNCTION=1', '-DADD_UNEXPORTED_ELF_SYMBOL'],
+        arch='',
+        api='current',
     ),
-    Module(
-        name = 'libgolden_cpp_add_global_variable_private',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map_added_globvar.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_ADD_GLOBVAR=1', '-DGOLDEN_ADD_GLOBVAR_PRIVATE'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_add_function_sybmol_only',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map_add_function.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
     ),
-    Module(
-        name = 'libgolden_cpp_return_type_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_RETURN_TYPE_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_change_function_access',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_CHANGE_FUNCTION_ACCESS=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_parameter_type_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map_parameter_type_diff.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_PARAMETER_TYPE_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_add_global_variable',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map_added_globvar.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_ADD_GLOBVAR=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_vtable_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_VTABLE_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_add_global_variable_private',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map_added_globvar.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_ADD_GLOBVAR=1', '-DGOLDEN_ADD_GLOBVAR_PRIVATE'],
     ),
-    Module(
-        name = 'libgolden_cpp_member_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_MEMBER_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_return_type_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_RETURN_TYPE_DIFF=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_member_fake_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_MEMBER_FAKE_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_parameter_type_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map_parameter_type_diff.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_PARAMETER_TYPE_DIFF=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_member_cv_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_MEMBER_CV_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_vtable_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_VTABLE_DIFF=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_change_member_access',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_CHANGE_MEMBER_ACCESS=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_member_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_MEMBER_DIFF=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_member_integral_type_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_MEMBER_INTEGRAL_TYPE_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_member_fake_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_MEMBER_FAKE_DIFF=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_enum_diff',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_ENUM_DIFF=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_member_cv_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_MEMBER_CV_DIFF=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_enum_extended',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_ENUM_EXTENSION=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_change_member_access',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_CHANGE_MEMBER_ACCESS=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_unreferenced_elf_symbol_removed',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map_elf_symbol_removed.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = [],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_member_integral_type_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_MEMBER_INTEGRAL_TYPE_DIFF=1'],
     ),
-    Module(
-        name = 'libreproducability',
-        srcs = ['integration/c_and_cpp/reproducability.c',
-                ],
-        version_script = 'integration/c_and_cpp/repro_map.txt',
-        export_include_dirs = ['integration/c_and_cpp/include'],
-        cflags = [],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_enum_diff',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_ENUM_DIFF=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_member_name_changed',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_CHANGE_MEMBER_NAME_SAME_OFFSET=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_enum_extended',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_ENUM_EXTENSION=1'],
     ),
-    Module(
-        name = 'libgolden_cpp_function_pointer',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_FUNCTION_POINTER=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libgolden_cpp_unreferenced_elf_symbol_removed',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map_elf_symbol_removed.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
     ),
-    Module(
-        name = 'libgolden_cpp_function_pointer_parameter_added',
-        srcs = ['integration/cpp/gold/golden_1.cpp',
-                'integration/cpp/gold/high_volume_speaker.cpp',
-                'integration/cpp/gold/low_volume_speaker.cpp',
-                ],
-        version_script = 'integration/cpp/gold/map.txt',
-        export_include_dirs = ['integration/cpp/gold/include'],
-        cflags = ['-DGOLDEN_FUNCTION_POINTER_ADD_PARAM=1',
-                  '-DGOLDEN_FUNCTION_POINTER=1'],
-        arch = '',
-        api = 'current',
+    LsdumpModule(
+        name='libreproducability',
+        srcs=['integration/c_and_cpp/reproducability.c'],
+        version_script='integration/c_and_cpp/repro_map.txt',
+        export_include_dirs=['integration/c_and_cpp/include'],
+    ),
+    LsdumpModule(
+        name='libgolden_cpp_member_name_changed',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_CHANGE_MEMBER_NAME_SAME_OFFSET=1'],
+    ),
+    LsdumpModule(
+        name='libgolden_cpp_function_pointer',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_FUNCTION_POINTER=1'],
+    ),
+    LsdumpModule(
+        name='libgolden_cpp_function_pointer_parameter_added',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_FUNCTION_POINTER_ADD_PARAM=1',
+                '-DGOLDEN_FUNCTION_POINTER=1'],
+    ),
+    LsdumpModule(
+        name='libgolden_cpp_internal_public_struct',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_WITH_INTERNAL_STRUCT',
+                '-DGOLDEN_WITH_PUBLIC_INTERNAL_STRUCT'],
+    ),
+    LsdumpModule(
+        name='libgolden_cpp_internal_private_struct',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_WITH_INTERNAL_STRUCT'],
+    ),
+    LsdumpModule(
+        name='libgolden_cpp_inheritance_type_changed',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        cflags=['-DGOLDEN_CHANGE_INHERITANCE_TYPE'],
+    ),
+    LsdumpModule(
+        name='libpure_virtual_function',
+        srcs=['integration/cpp/pure_virtual/pure_virtual_function.cpp'],
+        export_include_dirs=['integration/cpp/pure_virtual/include'],
+        version_script='',
+    ),
+    LsdumpModule(
+        name='libgolden_cpp_json',
+        srcs=[
+            'integration/cpp/gold/golden_1.cpp',
+            'integration/cpp/gold/high_volume_speaker.cpp',
+            'integration/cpp/gold/low_volume_speaker.cpp',
+        ],
+        version_script='integration/cpp/gold/map.txt',
+        export_include_dirs=['integration/cpp/gold/include'],
+        dumper_flags=['-output-format', 'Json'],
+        linker_flags=['-input-format', 'Json', '-output-format', 'Json']
+    ),
+    LsdumpModule(
+        name='libversion_script_example',
+        arch='arm64',
+        srcs=[
+            'integration/version_script_example/example.cpp',
+        ],
+        version_script='integration/version_script_example/example.map.txt',
+        export_include_dirs=['integration/version_script_example'],
+        dumper_flags=['-output-format', 'Json'],
+        linker_flags=[
+            '-input-format', 'Json',
+            '-output-format', 'Json',
+            '-so', relative_to_abs_path(
+                'integration/version_script_example/prebuilts/' +
+                'libversion_script_example.so'
+            ),
+        ]
+    ),
+    LsdumpModule(
+        name='libversion_script_example_no_private',
+        arch='arm64',
+        srcs=[
+            'integration/version_script_example/example.cpp',
+        ],
+        version_script='integration/version_script_example/example.map.txt',
+        export_include_dirs=['integration/version_script_example'],
+        dumper_flags=['-output-format', 'Json'],
+        linker_flags=[
+            '-input-format', 'Json',
+            '-output-format', 'Json',
+            '-so', relative_to_abs_path(
+                'integration/version_script_example/prebuilts/' +
+                'libversion_script_example.so'
+            ),
+            '--exclude-symbol-version', 'LIBVERSION_SCRIPT_EXAMPLE_PRIVATE',
+        ]
+    ),
+    LsdumpModule(
+        name='libversion_script_example_no_mytag',
+        arch='arm64',
+        srcs=[
+            'integration/version_script_example/example.cpp',
+        ],
+        version_script='integration/version_script_example/example.map.txt',
+        export_include_dirs=['integration/version_script_example'],
+        dumper_flags=['-output-format', 'Json'],
+        linker_flags=[
+            '-input-format', 'Json',
+            '-output-format', 'Json',
+            '-so', relative_to_abs_path(
+                'integration/version_script_example/prebuilts/' +
+                'libversion_script_example.so'
+            ),
+            '--exclude-symbol-tag', 'mytag',
+        ]
     ),
 ]
 
-TEST_MODULES = { m.name: m for m in TEST_MODULES }
+TEST_MODULES = {m.name: m for m in TEST_MODULES}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm/known_issues.h.sdump
new file mode 100644
index 0000000..482c1b2
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/known_issues.h.sdump
@@ -0,0 +1,46 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 4
+  }
+ ],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" : [],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "non_type_template",
+   "name" : "non_type_template",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "return_type",
+   "name" : "return_type",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "template_arg_in_namespace",
+   "name" : "template_arg_in_namespace",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  }
+ ],
+ "lvalue_reference_types" : [],
+ "pointer_types" : [],
+ "qualified_types" : [],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump
index 0b2bc23..fff7d8c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump
@@ -31,10 +31,10 @@
     name: "Cstruct"
     size: 8
     alignment: 4
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct"
-    self_type: "type-6"
+    self_type: "type-5"
   }
   fields {
     referenced_type: "type-3"
@@ -43,7 +43,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     field_offset: 32
     field_name: "b"
     access: public_access
@@ -59,10 +59,10 @@
     name: "Cinner"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner"
-    self_type: "type-8"
+    self_type: "type-7"
   }
   fields {
     referenced_type: "type-3"
@@ -103,10 +103,10 @@
     name: "Cstruct **"
     size: 4
     alignment: 4
-    referenced_type: "type-5"
+    referenced_type: "type-4"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct **"
-    self_type: "type-4"
+    self_type: "type-8"
   }
 }
 pointer_types {
@@ -114,10 +114,10 @@
     name: "Cstruct *"
     size: 4
     alignment: 4
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct *"
-    self_type: "type-5"
+    self_type: "type-4"
   }
 }
 pointer_types {
@@ -125,10 +125,10 @@
     name: "Cinner *"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner *"
-    self_type: "type-7"
+    self_type: "type-6"
   }
 }
 builtin_types {
@@ -162,8 +162,9 @@
   function_name: "CFunction"
   source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
   parameters {
-    referenced_type: "type-4"
+    referenced_type: "type-8"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -175,17 +176,21 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump
index 03a7bd9..e234d0f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump
@@ -186,6 +186,7 @@
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -197,17 +198,21 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp.so.lsdump
index 37a453e..bebbf85 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_function.so.lsdump
index 0dd522c..7e97fa8 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_function.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_function.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -408,55 +436,72 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_function_sybmol_only.so.lsdump
similarity index 73%
rename from vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
rename to vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_function_sybmol_only.so.lsdump
index d4d4ce7..bd1e283 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_function_sybmol_only.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 8
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 32
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 8
     alignment: 4
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -55,24 +122,25 @@
     name: "LowVolumeSpeaker"
     size: 16
     alignment: 4
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     field_offset: 64
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 96
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -81,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +188,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 8
-    alignment: 4
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 32
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +222,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +247,21 @@
     name: "float *"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +269,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +282,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +295,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +308,188 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::~SuperSpeaker"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeakerD2Ev"
+  access: public_access
+}
+functions {
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_global_variable.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_global_variable.so.lsdump
index e427156..3a8c08a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_global_variable.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_add_global_variable.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
@@ -410,49 +438,65 @@
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZN17HighVolumeSpeaker21global_unprotected_idE"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_function_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_function_access.so.lsdump
index 3cb585f..fe06c23 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_function_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_function_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: private_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_member_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_member_access.so.lsdump
index b9a056d..743479f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_member_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_change_member_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_diff.so.lsdump
index 29cfe09..e1740a0 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,15 +201,15 @@
   underlying_type: "type-2"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: -1
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   access: private_access
   tag_info {
@@ -301,6 +319,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -312,6 +331,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +343,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +355,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +367,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +379,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +396,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +408,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_extended.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_extended.so.lsdump
index 02fdc97..35de389 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_extended.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_enum_extended.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,23 +201,23 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   enum_fields {
     enum_field_value: 5
-    name: "SuperSpeaker::Volume::LouderThanLoudest"
+    name: "SuperSpeaker::LouderThanLoudest"
   }
   access: private_access
   tag_info {
@@ -309,6 +327,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -320,6 +339,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -331,6 +351,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -342,6 +363,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -353,6 +375,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -364,10 +387,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -379,6 +404,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -390,43 +416,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_inheritance_type_changed.so.lsdump
similarity index 68%
copy from vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
copy to vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_inheritance_type_changed.so.lsdump
index d4d4ce7..7ead17a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_inheritance_type_changed.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 8
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 32
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 8
     alignment: 4
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -53,59 +120,126 @@
 record_types {
   type_info {
     name: "LowVolumeSpeaker"
-    size: 16
+    size: 20
     alignment: 4
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
-    field_offset: 64
+    referenced_type: "type-6"
+    field_offset: 32
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
-    field_offset: 96
+    referenced_type: "type-7"
+    field_offset: 64
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
-    is_virtual: false
+    referenced_type: "type-1"
+    is_virtual: true
     access: public_access
   }
   vtable_layout {
     vtable_components {
+      kind: VBaseOffset
+      mangled_component_name: ""
+      component_value: 12
+      is_pure: false
+    }
+    vtable_components {
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI16LowVolumeSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n12_N16LowVolumeSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n16_N16LowVolumeSpeaker6ListenEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZTv0_n20_N16LowVolumeSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZTv0_n20_N16LowVolumeSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +248,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 8
-    alignment: 4
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 32
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +282,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +307,21 @@
     name: "float *"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +329,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +342,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +355,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +368,160 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_json.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_json.so.lsdump
new file mode 100644
index 0000000..81603fc
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_json.so.lsdump
@@ -0,0 +1,412 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float",
+   "name" : "float",
+   "referenced_type" : "type-3",
+   "self_type" : "type-3",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "is_unsigned" : true,
+   "linker_set_key" : "unsigned int",
+   "name" : "unsigned int",
+   "referenced_type" : "type-6",
+   "self_type" : "type-6",
+   "size" : 4
+  },
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-10",
+   "self_type" : "type-10"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_Z26test_virtual_function_callP12SuperSpeaker"
+  },
+  {
+   "name" : "_ZN12NotReferenced"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker11SpeakLouderEv"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker9SpeakLoudEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker6ListenEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker6ListenEv"
+  }
+ ],
+ "elf_objects" :
+ [
+  {
+   "name" : "_ZTV16LowVolumeSpeaker"
+  },
+  {
+   "name" : "_ZTV17HighVolumeSpeaker"
+  }
+ ],
+ "enum_types" :
+ [
+  {
+   "access" : "private",
+   "alignment" : 4,
+   "enum_fields" :
+   [
+    {
+     "enum_field_value" : 1,
+     "name" : "SuperSpeaker::Loud"
+    },
+    {
+     "enum_field_value" : 2,
+     "name" : "SuperSpeaker::Louder"
+    },
+    {
+     "enum_field_value" : 3,
+     "name" : "SuperSpeaker::Loudest"
+    },
+    {
+     "enum_field_value" : 0,
+     "name" : "SuperSpeaker::Lower"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker::Volume",
+   "name" : "SuperSpeaker::Volume",
+   "referenced_type" : "type-8",
+   "self_type" : "type-8",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "underlying_type" : "type-6",
+   "unique_id" : "_ZTSN12SuperSpeaker6VolumeE"
+  }
+ ],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "SuperSpeaker::SpeakLouder",
+   "linker_set_key" : "_ZN12SuperSpeaker11SpeakLouderEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::CreateSuperSpeaker",
+   "linker_set_key" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-2"
+    }
+   ],
+   "return_type" : "type-9",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::SpeakLoud",
+   "linker_set_key" : "_ZN12SuperSpeaker9SpeakLoudEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-8",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::BadPractice",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker11BadPracticeEf",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    },
+    {
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-12",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "SuperSpeaker *",
+   "name" : "SuperSpeaker *",
+   "referenced_type" : "type-1",
+   "self_type" : "type-9",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "HighVolumeSpeaker *",
+   "name" : "HighVolumeSpeaker *",
+   "referenced_type" : "type-11",
+   "self_type" : "type-12",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float *",
+   "name" : "float *",
+   "referenced_type" : "type-3",
+   "self_type" : "type-7",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "LowVolumeSpeaker *",
+   "name" : "LowVolumeSpeaker *",
+   "referenced_type" : "type-5",
+   "self_type" : "type-4",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 4,
+   "fields" :
+   [
+    {
+     "access" : "private",
+     "field_name" : "mSpeakderId",
+     "field_offset" : 32,
+     "referenced_type" : "type-2"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker",
+   "name" : "SuperSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "unique_id" : "_ZTS12SuperSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI12SuperSpeaker"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker5SpeakEv"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 4,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "linker_set_key" : "HighVolumeSpeaker",
+   "name" : "HighVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-11",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h",
+   "unique_id" : "_ZTS17HighVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI17HighVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 4,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "fields" :
+   [
+    {
+     "field_name" : "speaker_uint_t",
+     "field_offset" : 64,
+     "referenced_type" : "type-6"
+    },
+    {
+     "field_name" : "speaker_float_star",
+     "field_offset" : 96,
+     "referenced_type" : "type-7"
+    }
+   ],
+   "linker_set_key" : "LowVolumeSpeaker",
+   "name" : "LowVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-5",
+   "self_type" : "type-5",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h",
+   "unique_id" : "_ZTS16LowVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI16LowVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD0Ev"
+    }
+   ]
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_cv_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_cv_diff.so.lsdump
index a9f7529..9a032a3 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_cv_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_cv_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -319,6 +337,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -330,6 +349,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -341,6 +361,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -352,6 +373,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -363,6 +385,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -374,10 +397,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -389,6 +414,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -400,43 +426,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_diff.so.lsdump
index 75d88e8..8461951 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_fake_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_fake_diff.so.lsdump
index 02fedd4..f5f3d0b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_fake_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_fake_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_integral_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_integral_type_diff.so.lsdump
index e283091..5a7b92f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_integral_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_integral_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-8"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_name_changed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_name_changed.so.lsdump
index 69ac3f1..481223c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_name_changed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_member_name_changed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_parameter_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_parameter_type_diff.so.lsdump
index 529a413..1c7097b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_parameter_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_parameter_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-5"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEi"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,52 +424,68 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_return_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_return_type_diff.so.lsdump
index 8b44979..e9096e8 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_return_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_return_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
index a30665c..1e93738 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,40 +412,52 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_vtable_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_vtable_diff.so.lsdump
index 687ee8c..e31e37c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_vtable_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_vtable_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -312,6 +330,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +342,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +354,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +366,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +378,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +395,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +407,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libpure_virtual_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libpure_virtual_function.so.lsdump
new file mode 100644
index 0000000..29a106d
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libpure_virtual_function.so.lsdump
@@ -0,0 +1,148 @@
+record_types {
+  type_info {
+    name: "PureVirtualBase"
+    size: 4
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase"
+    self_type: "type-1"
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI15PureVirtualBase"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD1Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD0Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase8foo_pureEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase11foo_virtualEv"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS15PureVirtualBase"
+  }
+}
+record_types {
+  type_info {
+    name: "DerivedBar"
+    size: 4
+    alignment: 4
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar"
+    self_type: "type-4"
+  }
+  base_specifiers {
+    referenced_type: "type-1"
+    is_virtual: false
+    access: public_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI10DerivedBar"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar8foo_pureEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar11foo_virtualEv"
+      component_value: 0
+      is_pure: true
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS10DerivedBar"
+  }
+}
+pointer_types {
+  type_info {
+    name: "PureVirtualBase *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase *"
+    self_type: "type-3"
+  }
+}
+pointer_types {
+  type_info {
+    name: "DerivedBar *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar *"
+    self_type: "type-5"
+  }
+}
+builtin_types {
+  type_info {
+    name: "void"
+    size: 0
+    alignment: 0
+    referenced_type: "type-2"
+    source_file: ""
+    linker_set_key: "void"
+    self_type: "type-2"
+  }
+  is_unsigned: false
+  is_integral: false
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libreproducability.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libreproducability.so.lsdump
index 673efb5..e810193 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libreproducability.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libreproducability.so.lsdump
@@ -35,4 +35,5 @@
 }
 elf_functions {
   name: "repro"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm/undeclared_types.h.sdump
new file mode 100644
index 0000000..ff0ffb7
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm/undeclared_types.h.sdump
@@ -0,0 +1,113 @@
+{
+ "array_types" : [],
+ "builtin_types" : [],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "inline_function",
+   "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-4",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "access" : "private",
+   "function_name" : "InvalidClass::member_function",
+   "linker_set_key" : "_ZN12InvalidClass15member_functionE1E",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-8"
+    },
+    {
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-6",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "a",
+   "name" : "a",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "b",
+   "name" : "b",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "c",
+   "name" : "c",
+   "referenced_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "template_in_macro",
+   "name" : "template_in_macro",
+   "referenced_type" : "type-11",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "lvalue_reference_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "namespace_a::A &",
+   "name" : "namespace_a::A &",
+   "referenced_type" : "type-1",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "InvalidClass *",
+   "name" : "InvalidClass *",
+   "referenced_type" : "type-7",
+   "self_type" : "type-8",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "TemplateInMacro<F> *",
+   "name" : "TemplateInMacro<F> *",
+   "referenced_type" : "type-10",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "qualified_types" :
+ [
+  {
+   "is_const" : true,
+   "linker_set_key" : "const namespace_b::template_b<const B *>",
+   "name" : "const namespace_b::template_b<const B *>",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/known_issues.h.sdump
new file mode 100644
index 0000000..482c1b2
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/known_issues.h.sdump
@@ -0,0 +1,46 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 4
+  }
+ ],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" : [],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "non_type_template",
+   "name" : "non_type_template",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "return_type",
+   "name" : "return_type",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "template_arg_in_namespace",
+   "name" : "template_arg_in_namespace",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  }
+ ],
+ "lvalue_reference_types" : [],
+ "pointer_types" : [],
+ "qualified_types" : [],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump
index d08357c..f0d247b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump
@@ -31,10 +31,10 @@
     name: "Cstruct"
     size: 16
     alignment: 8
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct"
-    self_type: "type-6"
+    self_type: "type-5"
   }
   fields {
     referenced_type: "type-3"
@@ -43,7 +43,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     field_offset: 64
     field_name: "b"
     access: public_access
@@ -59,10 +59,10 @@
     name: "Cinner"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner"
-    self_type: "type-8"
+    self_type: "type-7"
   }
   fields {
     referenced_type: "type-3"
@@ -103,10 +103,10 @@
     name: "Cstruct **"
     size: 8
     alignment: 8
-    referenced_type: "type-5"
+    referenced_type: "type-4"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct **"
-    self_type: "type-4"
+    self_type: "type-8"
   }
 }
 pointer_types {
@@ -114,10 +114,10 @@
     name: "Cstruct *"
     size: 8
     alignment: 8
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct *"
-    self_type: "type-5"
+    self_type: "type-4"
   }
 }
 pointer_types {
@@ -125,10 +125,10 @@
     name: "Cinner *"
     size: 8
     alignment: 8
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner *"
-    self_type: "type-7"
+    self_type: "type-6"
   }
 }
 builtin_types {
@@ -162,8 +162,9 @@
   function_name: "CFunction"
   source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
   parameters {
-    referenced_type: "type-4"
+    referenced_type: "type-8"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -175,17 +176,21 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump
index 498122a..af3896d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump
@@ -186,6 +186,7 @@
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -197,17 +198,21 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp.so.lsdump
index 3990163..383ad61 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_function.so.lsdump
index ccb26f6..b5afb3e 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_function.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_function.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -408,55 +436,72 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_function_sybmol_only.so.lsdump
similarity index 73%
rename from vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
rename to vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_function_sybmol_only.so.lsdump
index c8dc7f9..7f2114f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_function_sybmol_only.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 16
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 64
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 16
     alignment: 8
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -55,24 +122,25 @@
     name: "LowVolumeSpeaker"
     size: 24
     alignment: 8
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     field_offset: 96
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 128
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -81,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +188,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 16
-    alignment: 8
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 64
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +222,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 8
     alignment: 8
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +247,21 @@
     name: "float *"
     size: 8
     alignment: 8
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +269,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +282,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +295,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +308,188 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::~SuperSpeaker"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeakerD2Ev"
+  access: public_access
+}
+functions {
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_global_variable.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_global_variable.so.lsdump
index 4cf3373..337c3ba 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_global_variable.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_add_global_variable.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
@@ -410,49 +438,65 @@
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZN17HighVolumeSpeaker21global_unprotected_idE"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_function_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_function_access.so.lsdump
index 1aa765f..849148c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_function_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_function_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: private_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_member_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_member_access.so.lsdump
index 3dc6dff..db36507 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_member_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_change_member_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_diff.so.lsdump
index ca92c59..851585d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,15 +201,15 @@
   underlying_type: "type-2"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: -1
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   access: private_access
   tag_info {
@@ -301,6 +319,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -312,6 +331,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +343,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +355,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +367,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +379,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +396,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +408,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_extended.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_extended.so.lsdump
index 0a48efd..111190e 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_extended.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_enum_extended.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,23 +201,23 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   enum_fields {
     enum_field_value: 5
-    name: "SuperSpeaker::Volume::LouderThanLoudest"
+    name: "SuperSpeaker::LouderThanLoudest"
   }
   access: private_access
   tag_info {
@@ -309,6 +327,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -320,6 +339,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -331,6 +351,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -342,6 +363,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -353,6 +375,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -364,10 +387,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -379,6 +404,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -390,43 +416,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_inheritance_type_changed.so.lsdump
similarity index 68%
copy from vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
copy to vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_inheritance_type_changed.so.lsdump
index c8dc7f9..c58d080 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_inheritance_type_changed.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 16
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 64
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 16
     alignment: 8
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -53,59 +120,126 @@
 record_types {
   type_info {
     name: "LowVolumeSpeaker"
-    size: 24
+    size: 40
     alignment: 8
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
-    field_offset: 96
+    referenced_type: "type-6"
+    field_offset: 64
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 128
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
-    is_virtual: false
+    referenced_type: "type-1"
+    is_virtual: true
     access: public_access
   }
   vtable_layout {
     vtable_components {
+      kind: VBaseOffset
+      mangled_component_name: ""
+      component_value: 24
+      is_pure: false
+    }
+    vtable_components {
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI16LowVolumeSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n24_N16LowVolumeSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n32_N16LowVolumeSpeaker6ListenEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZTv0_n40_N16LowVolumeSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZTv0_n40_N16LowVolumeSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +248,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 16
-    alignment: 8
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 64
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +282,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 8
     alignment: 8
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +307,21 @@
     name: "float *"
     size: 8
     alignment: 8
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +329,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +342,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +355,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +368,160 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_json.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_json.so.lsdump
new file mode 100644
index 0000000..3732e93
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_json.so.lsdump
@@ -0,0 +1,412 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float",
+   "name" : "float",
+   "referenced_type" : "type-3",
+   "self_type" : "type-3",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "is_unsigned" : true,
+   "linker_set_key" : "unsigned int",
+   "name" : "unsigned int",
+   "referenced_type" : "type-6",
+   "self_type" : "type-6",
+   "size" : 4
+  },
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-10",
+   "self_type" : "type-10"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_Z26test_virtual_function_callP12SuperSpeaker"
+  },
+  {
+   "name" : "_ZN12NotReferenced"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker11SpeakLouderEv"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker9SpeakLoudEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker6ListenEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker6ListenEv"
+  }
+ ],
+ "elf_objects" :
+ [
+  {
+   "name" : "_ZTV16LowVolumeSpeaker"
+  },
+  {
+   "name" : "_ZTV17HighVolumeSpeaker"
+  }
+ ],
+ "enum_types" :
+ [
+  {
+   "access" : "private",
+   "alignment" : 4,
+   "enum_fields" :
+   [
+    {
+     "enum_field_value" : 1,
+     "name" : "SuperSpeaker::Loud"
+    },
+    {
+     "enum_field_value" : 2,
+     "name" : "SuperSpeaker::Louder"
+    },
+    {
+     "enum_field_value" : 3,
+     "name" : "SuperSpeaker::Loudest"
+    },
+    {
+     "enum_field_value" : 0,
+     "name" : "SuperSpeaker::Lower"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker::Volume",
+   "name" : "SuperSpeaker::Volume",
+   "referenced_type" : "type-8",
+   "self_type" : "type-8",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "underlying_type" : "type-6",
+   "unique_id" : "_ZTSN12SuperSpeaker6VolumeE"
+  }
+ ],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "SuperSpeaker::SpeakLouder",
+   "linker_set_key" : "_ZN12SuperSpeaker11SpeakLouderEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::CreateSuperSpeaker",
+   "linker_set_key" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-2"
+    }
+   ],
+   "return_type" : "type-9",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::SpeakLoud",
+   "linker_set_key" : "_ZN12SuperSpeaker9SpeakLoudEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-8",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::BadPractice",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker11BadPracticeEf",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    },
+    {
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-12",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "SuperSpeaker *",
+   "name" : "SuperSpeaker *",
+   "referenced_type" : "type-1",
+   "self_type" : "type-9",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "HighVolumeSpeaker *",
+   "name" : "HighVolumeSpeaker *",
+   "referenced_type" : "type-11",
+   "self_type" : "type-12",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "float *",
+   "name" : "float *",
+   "referenced_type" : "type-3",
+   "self_type" : "type-7",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "LowVolumeSpeaker *",
+   "name" : "LowVolumeSpeaker *",
+   "referenced_type" : "type-5",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 8,
+   "fields" :
+   [
+    {
+     "access" : "private",
+     "field_name" : "mSpeakderId",
+     "field_offset" : 64,
+     "referenced_type" : "type-2"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker",
+   "name" : "SuperSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "unique_id" : "_ZTS12SuperSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI12SuperSpeaker"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker5SpeakEv"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 8,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "linker_set_key" : "HighVolumeSpeaker",
+   "name" : "HighVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-11",
+   "self_type" : "type-11",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h",
+   "unique_id" : "_ZTS17HighVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI17HighVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 8,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "fields" :
+   [
+    {
+     "field_name" : "speaker_uint_t",
+     "field_offset" : 96,
+     "referenced_type" : "type-6"
+    },
+    {
+     "field_name" : "speaker_float_star",
+     "field_offset" : 128,
+     "referenced_type" : "type-7"
+    }
+   ],
+   "linker_set_key" : "LowVolumeSpeaker",
+   "name" : "LowVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-5",
+   "self_type" : "type-5",
+   "size" : 24,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h",
+   "unique_id" : "_ZTS16LowVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI16LowVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD0Ev"
+    }
+   ]
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_cv_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_cv_diff.so.lsdump
index 13e0bc3..a1417eb 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_cv_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_cv_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -319,6 +337,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -330,6 +349,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -341,6 +361,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -352,6 +373,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -363,6 +385,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -374,10 +397,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -389,6 +414,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -400,43 +426,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_diff.so.lsdump
index 25b8dfc..c84fa5b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_fake_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_fake_diff.so.lsdump
index cae72dc..7410dbb 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_fake_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_fake_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_integral_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_integral_type_diff.so.lsdump
index db7ac45..83a7990 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_integral_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_integral_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-8"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_name_changed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_name_changed.so.lsdump
index 718ae0d..612aba5 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_name_changed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_member_name_changed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_parameter_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_parameter_type_diff.so.lsdump
index 1c97d32..6165918 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_parameter_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_parameter_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-5"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEi"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,52 +424,68 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_return_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_return_type_diff.so.lsdump
index 03537d5..e42c934 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_return_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_return_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
index d99ecd5..afcf77d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,40 +412,52 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_vtable_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_vtable_diff.so.lsdump
index efbec4e..9a1ed4a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_vtable_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_vtable_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -312,6 +330,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +342,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +354,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +366,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +378,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +395,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +407,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libpure_virtual_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libpure_virtual_function.so.lsdump
new file mode 100644
index 0000000..573df85
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libpure_virtual_function.so.lsdump
@@ -0,0 +1,148 @@
+record_types {
+  type_info {
+    name: "PureVirtualBase"
+    size: 8
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase"
+    self_type: "type-1"
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI15PureVirtualBase"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD1Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD0Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase8foo_pureEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase11foo_virtualEv"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS15PureVirtualBase"
+  }
+}
+record_types {
+  type_info {
+    name: "DerivedBar"
+    size: 8
+    alignment: 8
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar"
+    self_type: "type-4"
+  }
+  base_specifiers {
+    referenced_type: "type-1"
+    is_virtual: false
+    access: public_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI10DerivedBar"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar8foo_pureEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar11foo_virtualEv"
+      component_value: 0
+      is_pure: true
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS10DerivedBar"
+  }
+}
+pointer_types {
+  type_info {
+    name: "PureVirtualBase *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase *"
+    self_type: "type-3"
+  }
+}
+pointer_types {
+  type_info {
+    name: "DerivedBar *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar *"
+    self_type: "type-5"
+  }
+}
+builtin_types {
+  type_info {
+    name: "void"
+    size: 0
+    alignment: 0
+    referenced_type: "type-2"
+    source_file: ""
+    linker_set_key: "void"
+    self_type: "type-2"
+  }
+  is_unsigned: false
+  is_integral: false
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libreproducability.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libreproducability.so.lsdump
index 673efb5..e810193 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libreproducability.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libreproducability.so.lsdump
@@ -35,4 +35,5 @@
 }
 elf_functions {
   name: "repro"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example.so.lsdump
new file mode 100644
index 0000000..3f8b02d
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example.so.lsdump
@@ -0,0 +1,121 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_ZN5Test34testEv"
+  },
+  {
+   "name" : "_ZN5Test44testEv"
+  },
+  {
+   "name" : "test1"
+  },
+  {
+   "name" : "test2"
+  }
+ ],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "Test3::test",
+   "linker_set_key" : "_ZN5Test34testEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "function_name" : "Test4::test",
+   "linker_set_key" : "_ZN5Test44testEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "function_name" : "test1",
+   "linker_set_key" : "test1",
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "function_name" : "test2",
+   "linker_set_key" : "test2",
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "Test3 *",
+   "name" : "Test3 *",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "Test4 *",
+   "name" : "Test4 *",
+   "referenced_type" : "type-4",
+   "self_type" : "type-5",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 1,
+   "linker_set_key" : "Test3",
+   "name" : "Test3",
+   "record_kind" : "class",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 1,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h",
+   "unique_id" : "_ZTS5Test3"
+  },
+  {
+   "alignment" : 1,
+   "linker_set_key" : "Test4",
+   "name" : "Test4",
+   "record_kind" : "class",
+   "referenced_type" : "type-4",
+   "self_type" : "type-4",
+   "size" : 1,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h",
+   "unique_id" : "_ZTS5Test4"
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example_no_mytag.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example_no_mytag.so.lsdump
new file mode 100644
index 0000000..f7c4559
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example_no_mytag.so.lsdump
@@ -0,0 +1,96 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_ZN5Test44testEv"
+  },
+  {
+   "name" : "test2"
+  }
+ ],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "Test4::test",
+   "linker_set_key" : "_ZN5Test44testEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "function_name" : "test2",
+   "linker_set_key" : "test2",
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "Test3 *",
+   "name" : "Test3 *",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "Test4 *",
+   "name" : "Test4 *",
+   "referenced_type" : "type-4",
+   "self_type" : "type-5",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 1,
+   "linker_set_key" : "Test3",
+   "name" : "Test3",
+   "record_kind" : "class",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 1,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h",
+   "unique_id" : "_ZTS5Test3"
+  },
+  {
+   "alignment" : 1,
+   "linker_set_key" : "Test4",
+   "name" : "Test4",
+   "record_kind" : "class",
+   "referenced_type" : "type-4",
+   "self_type" : "type-4",
+   "size" : 1,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h",
+   "unique_id" : "_ZTS5Test4"
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example_no_private.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example_no_private.so.lsdump
new file mode 100644
index 0000000..fcd69d8
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libversion_script_example_no_private.so.lsdump
@@ -0,0 +1,96 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_ZN5Test34testEv"
+  },
+  {
+   "name" : "test1"
+  }
+ ],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "Test3::test",
+   "linker_set_key" : "_ZN5Test34testEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "function_name" : "test1",
+   "linker_set_key" : "test1",
+   "return_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "Test3 *",
+   "name" : "Test3 *",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "Test4 *",
+   "name" : "Test4 *",
+   "referenced_type" : "type-4",
+   "self_type" : "type-5",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 1,
+   "linker_set_key" : "Test3",
+   "name" : "Test3",
+   "record_kind" : "class",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 1,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h",
+   "unique_id" : "_ZTS5Test3"
+  },
+  {
+   "alignment" : 1,
+   "linker_set_key" : "Test4",
+   "name" : "Test4",
+   "record_kind" : "class",
+   "referenced_type" : "type-4",
+   "self_type" : "type-4",
+   "size" : 1,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/version_script_example/example.h",
+   "unique_id" : "_ZTS5Test4"
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/undeclared_types.h.sdump
new file mode 100644
index 0000000..ff0ffb7
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/undeclared_types.h.sdump
@@ -0,0 +1,113 @@
+{
+ "array_types" : [],
+ "builtin_types" : [],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "inline_function",
+   "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-4",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "access" : "private",
+   "function_name" : "InvalidClass::member_function",
+   "linker_set_key" : "_ZN12InvalidClass15member_functionE1E",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-8"
+    },
+    {
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-6",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "a",
+   "name" : "a",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "b",
+   "name" : "b",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "c",
+   "name" : "c",
+   "referenced_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "template_in_macro",
+   "name" : "template_in_macro",
+   "referenced_type" : "type-11",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "lvalue_reference_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "namespace_a::A &",
+   "name" : "namespace_a::A &",
+   "referenced_type" : "type-1",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "InvalidClass *",
+   "name" : "InvalidClass *",
+   "referenced_type" : "type-7",
+   "self_type" : "type-8",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "TemplateInMacro<F> *",
+   "name" : "TemplateInMacro<F> *",
+   "referenced_type" : "type-10",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "qualified_types" :
+ [
+  {
+   "is_const" : true,
+   "linker_set_key" : "const namespace_b::template_b<const B *>",
+   "name" : "const namespace_b::template_b<const B *>",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips/known_issues.h.sdump
new file mode 100644
index 0000000..482c1b2
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/known_issues.h.sdump
@@ -0,0 +1,46 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 4
+  }
+ ],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" : [],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "non_type_template",
+   "name" : "non_type_template",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "return_type",
+   "name" : "return_type",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "template_arg_in_namespace",
+   "name" : "template_arg_in_namespace",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  }
+ ],
+ "lvalue_reference_types" : [],
+ "pointer_types" : [],
+ "qualified_types" : [],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump
index 0b2bc23..fff7d8c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump
@@ -31,10 +31,10 @@
     name: "Cstruct"
     size: 8
     alignment: 4
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct"
-    self_type: "type-6"
+    self_type: "type-5"
   }
   fields {
     referenced_type: "type-3"
@@ -43,7 +43,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     field_offset: 32
     field_name: "b"
     access: public_access
@@ -59,10 +59,10 @@
     name: "Cinner"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner"
-    self_type: "type-8"
+    self_type: "type-7"
   }
   fields {
     referenced_type: "type-3"
@@ -103,10 +103,10 @@
     name: "Cstruct **"
     size: 4
     alignment: 4
-    referenced_type: "type-5"
+    referenced_type: "type-4"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct **"
-    self_type: "type-4"
+    self_type: "type-8"
   }
 }
 pointer_types {
@@ -114,10 +114,10 @@
     name: "Cstruct *"
     size: 4
     alignment: 4
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct *"
-    self_type: "type-5"
+    self_type: "type-4"
   }
 }
 pointer_types {
@@ -125,10 +125,10 @@
     name: "Cinner *"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner *"
-    self_type: "type-7"
+    self_type: "type-6"
   }
 }
 builtin_types {
@@ -162,8 +162,9 @@
   function_name: "CFunction"
   source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
   parameters {
-    referenced_type: "type-4"
+    referenced_type: "type-8"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -175,17 +176,21 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump
index 03a7bd9..e234d0f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump
@@ -186,6 +186,7 @@
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -197,17 +198,21 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp.so.lsdump
index 37a453e..bebbf85 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_function.so.lsdump
index 0dd522c..7e97fa8 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_function.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_function.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -408,55 +436,72 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_function_sybmol_only.so.lsdump
similarity index 73%
copy from vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
copy to vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_function_sybmol_only.so.lsdump
index d4d4ce7..bd1e283 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_function_sybmol_only.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 8
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 32
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 8
     alignment: 4
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -55,24 +122,25 @@
     name: "LowVolumeSpeaker"
     size: 16
     alignment: 4
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     field_offset: 64
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 96
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -81,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +188,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 8
-    alignment: 4
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 32
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +222,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +247,21 @@
     name: "float *"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +269,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +282,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +295,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +308,188 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::~SuperSpeaker"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeakerD2Ev"
+  access: public_access
+}
+functions {
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_global_variable.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_global_variable.so.lsdump
index e427156..3a8c08a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_global_variable.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_add_global_variable.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
@@ -410,49 +438,65 @@
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZN17HighVolumeSpeaker21global_unprotected_idE"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_function_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_function_access.so.lsdump
index 3cb585f..fe06c23 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_function_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_function_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: private_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_member_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_member_access.so.lsdump
index b9a056d..743479f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_member_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_change_member_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_diff.so.lsdump
index 29cfe09..e1740a0 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,15 +201,15 @@
   underlying_type: "type-2"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: -1
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   access: private_access
   tag_info {
@@ -301,6 +319,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -312,6 +331,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +343,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +355,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +367,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +379,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +396,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +408,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_extended.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_extended.so.lsdump
index 02fdc97..35de389 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_extended.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_enum_extended.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,23 +201,23 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   enum_fields {
     enum_field_value: 5
-    name: "SuperSpeaker::Volume::LouderThanLoudest"
+    name: "SuperSpeaker::LouderThanLoudest"
   }
   access: private_access
   tag_info {
@@ -309,6 +327,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -320,6 +339,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -331,6 +351,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -342,6 +363,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -353,6 +375,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -364,10 +387,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -379,6 +404,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -390,43 +416,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_inheritance_type_changed.so.lsdump
similarity index 68%
rename from vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
rename to vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_inheritance_type_changed.so.lsdump
index d4d4ce7..7ead17a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_inheritance_type_changed.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 8
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 32
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 8
     alignment: 4
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -53,59 +120,126 @@
 record_types {
   type_info {
     name: "LowVolumeSpeaker"
-    size: 16
+    size: 20
     alignment: 4
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
-    field_offset: 64
+    referenced_type: "type-6"
+    field_offset: 32
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
-    field_offset: 96
+    referenced_type: "type-7"
+    field_offset: 64
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
-    is_virtual: false
+    referenced_type: "type-1"
+    is_virtual: true
     access: public_access
   }
   vtable_layout {
     vtable_components {
+      kind: VBaseOffset
+      mangled_component_name: ""
+      component_value: 12
+      is_pure: false
+    }
+    vtable_components {
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI16LowVolumeSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n12_N16LowVolumeSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n16_N16LowVolumeSpeaker6ListenEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZTv0_n20_N16LowVolumeSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZTv0_n20_N16LowVolumeSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +248,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 8
-    alignment: 4
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 32
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +282,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +307,21 @@
     name: "float *"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +329,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +342,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +355,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +368,160 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_json.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_json.so.lsdump
new file mode 100644
index 0000000..81603fc
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_json.so.lsdump
@@ -0,0 +1,412 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float",
+   "name" : "float",
+   "referenced_type" : "type-3",
+   "self_type" : "type-3",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "is_unsigned" : true,
+   "linker_set_key" : "unsigned int",
+   "name" : "unsigned int",
+   "referenced_type" : "type-6",
+   "self_type" : "type-6",
+   "size" : 4
+  },
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-10",
+   "self_type" : "type-10"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_Z26test_virtual_function_callP12SuperSpeaker"
+  },
+  {
+   "name" : "_ZN12NotReferenced"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker11SpeakLouderEv"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker9SpeakLoudEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker6ListenEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker6ListenEv"
+  }
+ ],
+ "elf_objects" :
+ [
+  {
+   "name" : "_ZTV16LowVolumeSpeaker"
+  },
+  {
+   "name" : "_ZTV17HighVolumeSpeaker"
+  }
+ ],
+ "enum_types" :
+ [
+  {
+   "access" : "private",
+   "alignment" : 4,
+   "enum_fields" :
+   [
+    {
+     "enum_field_value" : 1,
+     "name" : "SuperSpeaker::Loud"
+    },
+    {
+     "enum_field_value" : 2,
+     "name" : "SuperSpeaker::Louder"
+    },
+    {
+     "enum_field_value" : 3,
+     "name" : "SuperSpeaker::Loudest"
+    },
+    {
+     "enum_field_value" : 0,
+     "name" : "SuperSpeaker::Lower"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker::Volume",
+   "name" : "SuperSpeaker::Volume",
+   "referenced_type" : "type-8",
+   "self_type" : "type-8",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "underlying_type" : "type-6",
+   "unique_id" : "_ZTSN12SuperSpeaker6VolumeE"
+  }
+ ],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "SuperSpeaker::SpeakLouder",
+   "linker_set_key" : "_ZN12SuperSpeaker11SpeakLouderEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::CreateSuperSpeaker",
+   "linker_set_key" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-2"
+    }
+   ],
+   "return_type" : "type-9",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::SpeakLoud",
+   "linker_set_key" : "_ZN12SuperSpeaker9SpeakLoudEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-8",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::BadPractice",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker11BadPracticeEf",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    },
+    {
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-12",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "SuperSpeaker *",
+   "name" : "SuperSpeaker *",
+   "referenced_type" : "type-1",
+   "self_type" : "type-9",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "HighVolumeSpeaker *",
+   "name" : "HighVolumeSpeaker *",
+   "referenced_type" : "type-11",
+   "self_type" : "type-12",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float *",
+   "name" : "float *",
+   "referenced_type" : "type-3",
+   "self_type" : "type-7",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "LowVolumeSpeaker *",
+   "name" : "LowVolumeSpeaker *",
+   "referenced_type" : "type-5",
+   "self_type" : "type-4",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 4,
+   "fields" :
+   [
+    {
+     "access" : "private",
+     "field_name" : "mSpeakderId",
+     "field_offset" : 32,
+     "referenced_type" : "type-2"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker",
+   "name" : "SuperSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "unique_id" : "_ZTS12SuperSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI12SuperSpeaker"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker5SpeakEv"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 4,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "linker_set_key" : "HighVolumeSpeaker",
+   "name" : "HighVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-11",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h",
+   "unique_id" : "_ZTS17HighVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI17HighVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 4,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "fields" :
+   [
+    {
+     "field_name" : "speaker_uint_t",
+     "field_offset" : 64,
+     "referenced_type" : "type-6"
+    },
+    {
+     "field_name" : "speaker_float_star",
+     "field_offset" : 96,
+     "referenced_type" : "type-7"
+    }
+   ],
+   "linker_set_key" : "LowVolumeSpeaker",
+   "name" : "LowVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-5",
+   "self_type" : "type-5",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h",
+   "unique_id" : "_ZTS16LowVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI16LowVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD0Ev"
+    }
+   ]
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_cv_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_cv_diff.so.lsdump
index a9f7529..9a032a3 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_cv_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_cv_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -319,6 +337,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -330,6 +349,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -341,6 +361,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -352,6 +373,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -363,6 +385,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -374,10 +397,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -389,6 +414,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -400,43 +426,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_diff.so.lsdump
index 75d88e8..8461951 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_fake_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_fake_diff.so.lsdump
index 02fedd4..f5f3d0b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_fake_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_fake_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_integral_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_integral_type_diff.so.lsdump
index e283091..5a7b92f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_integral_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_integral_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-8"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_name_changed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_name_changed.so.lsdump
index 69ac3f1..481223c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_name_changed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_member_name_changed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_parameter_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_parameter_type_diff.so.lsdump
index 529a413..1c7097b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_parameter_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_parameter_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-5"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEi"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,52 +424,68 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_return_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_return_type_diff.so.lsdump
index 8b44979..e9096e8 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_return_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_return_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
index a30665c..1e93738 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,40 +412,52 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_vtable_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_vtable_diff.so.lsdump
index 687ee8c..e31e37c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_vtable_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libgolden_cpp_vtable_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -312,6 +330,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +342,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +354,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +366,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +378,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +395,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +407,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libpure_virtual_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libpure_virtual_function.so.lsdump
new file mode 100644
index 0000000..29a106d
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libpure_virtual_function.so.lsdump
@@ -0,0 +1,148 @@
+record_types {
+  type_info {
+    name: "PureVirtualBase"
+    size: 4
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase"
+    self_type: "type-1"
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI15PureVirtualBase"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD1Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD0Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase8foo_pureEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase11foo_virtualEv"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS15PureVirtualBase"
+  }
+}
+record_types {
+  type_info {
+    name: "DerivedBar"
+    size: 4
+    alignment: 4
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar"
+    self_type: "type-4"
+  }
+  base_specifiers {
+    referenced_type: "type-1"
+    is_virtual: false
+    access: public_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI10DerivedBar"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar8foo_pureEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar11foo_virtualEv"
+      component_value: 0
+      is_pure: true
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS10DerivedBar"
+  }
+}
+pointer_types {
+  type_info {
+    name: "PureVirtualBase *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase *"
+    self_type: "type-3"
+  }
+}
+pointer_types {
+  type_info {
+    name: "DerivedBar *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar *"
+    self_type: "type-5"
+  }
+}
+builtin_types {
+  type_info {
+    name: "void"
+    size: 0
+    alignment: 0
+    referenced_type: "type-2"
+    source_file: ""
+    linker_set_key: "void"
+    self_type: "type-2"
+  }
+  is_unsigned: false
+  is_integral: false
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libreproducability.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libreproducability.so.lsdump
index 673efb5..e810193 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips/libreproducability.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libreproducability.so.lsdump
@@ -35,4 +35,5 @@
 }
 elf_functions {
   name: "repro"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips/undeclared_types.h.sdump
new file mode 100644
index 0000000..ff0ffb7
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips/undeclared_types.h.sdump
@@ -0,0 +1,113 @@
+{
+ "array_types" : [],
+ "builtin_types" : [],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "inline_function",
+   "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-4",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "access" : "private",
+   "function_name" : "InvalidClass::member_function",
+   "linker_set_key" : "_ZN12InvalidClass15member_functionE1E",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-8"
+    },
+    {
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-6",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "a",
+   "name" : "a",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "b",
+   "name" : "b",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "c",
+   "name" : "c",
+   "referenced_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "template_in_macro",
+   "name" : "template_in_macro",
+   "referenced_type" : "type-11",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "lvalue_reference_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "namespace_a::A &",
+   "name" : "namespace_a::A &",
+   "referenced_type" : "type-1",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "InvalidClass *",
+   "name" : "InvalidClass *",
+   "referenced_type" : "type-7",
+   "self_type" : "type-8",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "TemplateInMacro<F> *",
+   "name" : "TemplateInMacro<F> *",
+   "referenced_type" : "type-10",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "qualified_types" :
+ [
+  {
+   "is_const" : true,
+   "linker_set_key" : "const namespace_b::template_b<const B *>",
+   "name" : "const namespace_b::template_b<const B *>",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/known_issues.h.sdump
new file mode 100644
index 0000000..482c1b2
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/known_issues.h.sdump
@@ -0,0 +1,46 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 4
+  }
+ ],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" : [],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "non_type_template",
+   "name" : "non_type_template",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "return_type",
+   "name" : "return_type",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "template_arg_in_namespace",
+   "name" : "template_arg_in_namespace",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  }
+ ],
+ "lvalue_reference_types" : [],
+ "pointer_types" : [],
+ "qualified_types" : [],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump
index d08357c..f0d247b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump
@@ -31,10 +31,10 @@
     name: "Cstruct"
     size: 16
     alignment: 8
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct"
-    self_type: "type-6"
+    self_type: "type-5"
   }
   fields {
     referenced_type: "type-3"
@@ -43,7 +43,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     field_offset: 64
     field_name: "b"
     access: public_access
@@ -59,10 +59,10 @@
     name: "Cinner"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner"
-    self_type: "type-8"
+    self_type: "type-7"
   }
   fields {
     referenced_type: "type-3"
@@ -103,10 +103,10 @@
     name: "Cstruct **"
     size: 8
     alignment: 8
-    referenced_type: "type-5"
+    referenced_type: "type-4"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct **"
-    self_type: "type-4"
+    self_type: "type-8"
   }
 }
 pointer_types {
@@ -114,10 +114,10 @@
     name: "Cstruct *"
     size: 8
     alignment: 8
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct *"
-    self_type: "type-5"
+    self_type: "type-4"
   }
 }
 pointer_types {
@@ -125,10 +125,10 @@
     name: "Cinner *"
     size: 8
     alignment: 8
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner *"
-    self_type: "type-7"
+    self_type: "type-6"
   }
 }
 builtin_types {
@@ -162,8 +162,9 @@
   function_name: "CFunction"
   source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
   parameters {
-    referenced_type: "type-4"
+    referenced_type: "type-8"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -175,17 +176,21 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump
index 498122a..af3896d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump
@@ -186,6 +186,7 @@
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -197,17 +198,21 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp.so.lsdump
index 3990163..383ad61 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_function.so.lsdump
index ccb26f6..b5afb3e 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_function.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_function.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -408,55 +436,72 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_function_sybmol_only.so.lsdump
similarity index 73%
copy from vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
copy to vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_function_sybmol_only.so.lsdump
index c8dc7f9..7f2114f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_function_sybmol_only.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 16
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 64
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 16
     alignment: 8
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -55,24 +122,25 @@
     name: "LowVolumeSpeaker"
     size: 24
     alignment: 8
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     field_offset: 96
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 128
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -81,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +188,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 16
-    alignment: 8
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 64
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +222,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 8
     alignment: 8
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +247,21 @@
     name: "float *"
     size: 8
     alignment: 8
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +269,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +282,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +295,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +308,188 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::~SuperSpeaker"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeakerD2Ev"
+  access: public_access
+}
+functions {
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_global_variable.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_global_variable.so.lsdump
index 4cf3373..337c3ba 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_global_variable.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_add_global_variable.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
@@ -410,49 +438,65 @@
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZN17HighVolumeSpeaker21global_unprotected_idE"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_function_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_function_access.so.lsdump
index 1aa765f..849148c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_function_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_function_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: private_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_member_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_member_access.so.lsdump
index 3dc6dff..db36507 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_member_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_change_member_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_diff.so.lsdump
index ca92c59..851585d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,15 +201,15 @@
   underlying_type: "type-2"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: -1
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   access: private_access
   tag_info {
@@ -301,6 +319,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -312,6 +331,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +343,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +355,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +367,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +379,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +396,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +408,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_extended.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_extended.so.lsdump
index 0a48efd..111190e 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_extended.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_enum_extended.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,23 +201,23 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   enum_fields {
     enum_field_value: 5
-    name: "SuperSpeaker::Volume::LouderThanLoudest"
+    name: "SuperSpeaker::LouderThanLoudest"
   }
   access: private_access
   tag_info {
@@ -309,6 +327,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -320,6 +339,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -331,6 +351,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -342,6 +363,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -353,6 +375,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -364,10 +387,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -379,6 +404,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -390,43 +416,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_inheritance_type_changed.so.lsdump
similarity index 68%
rename from vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
rename to vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_inheritance_type_changed.so.lsdump
index c8dc7f9..c58d080 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_inheritance_type_changed.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 16
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 64
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 16
     alignment: 8
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -53,59 +120,126 @@
 record_types {
   type_info {
     name: "LowVolumeSpeaker"
-    size: 24
+    size: 40
     alignment: 8
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
-    field_offset: 96
+    referenced_type: "type-6"
+    field_offset: 64
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 128
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
-    is_virtual: false
+    referenced_type: "type-1"
+    is_virtual: true
     access: public_access
   }
   vtable_layout {
     vtable_components {
+      kind: VBaseOffset
+      mangled_component_name: ""
+      component_value: 24
+      is_pure: false
+    }
+    vtable_components {
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI16LowVolumeSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n24_N16LowVolumeSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n32_N16LowVolumeSpeaker6ListenEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZTv0_n40_N16LowVolumeSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZTv0_n40_N16LowVolumeSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +248,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 16
-    alignment: 8
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 64
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +282,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 8
     alignment: 8
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +307,21 @@
     name: "float *"
     size: 8
     alignment: 8
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +329,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +342,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +355,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +368,160 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_json.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_json.so.lsdump
new file mode 100644
index 0000000..3732e93
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_json.so.lsdump
@@ -0,0 +1,412 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float",
+   "name" : "float",
+   "referenced_type" : "type-3",
+   "self_type" : "type-3",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "is_unsigned" : true,
+   "linker_set_key" : "unsigned int",
+   "name" : "unsigned int",
+   "referenced_type" : "type-6",
+   "self_type" : "type-6",
+   "size" : 4
+  },
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-10",
+   "self_type" : "type-10"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_Z26test_virtual_function_callP12SuperSpeaker"
+  },
+  {
+   "name" : "_ZN12NotReferenced"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker11SpeakLouderEv"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker9SpeakLoudEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker6ListenEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker6ListenEv"
+  }
+ ],
+ "elf_objects" :
+ [
+  {
+   "name" : "_ZTV16LowVolumeSpeaker"
+  },
+  {
+   "name" : "_ZTV17HighVolumeSpeaker"
+  }
+ ],
+ "enum_types" :
+ [
+  {
+   "access" : "private",
+   "alignment" : 4,
+   "enum_fields" :
+   [
+    {
+     "enum_field_value" : 1,
+     "name" : "SuperSpeaker::Loud"
+    },
+    {
+     "enum_field_value" : 2,
+     "name" : "SuperSpeaker::Louder"
+    },
+    {
+     "enum_field_value" : 3,
+     "name" : "SuperSpeaker::Loudest"
+    },
+    {
+     "enum_field_value" : 0,
+     "name" : "SuperSpeaker::Lower"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker::Volume",
+   "name" : "SuperSpeaker::Volume",
+   "referenced_type" : "type-8",
+   "self_type" : "type-8",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "underlying_type" : "type-6",
+   "unique_id" : "_ZTSN12SuperSpeaker6VolumeE"
+  }
+ ],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "SuperSpeaker::SpeakLouder",
+   "linker_set_key" : "_ZN12SuperSpeaker11SpeakLouderEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::CreateSuperSpeaker",
+   "linker_set_key" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-2"
+    }
+   ],
+   "return_type" : "type-9",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::SpeakLoud",
+   "linker_set_key" : "_ZN12SuperSpeaker9SpeakLoudEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-8",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::BadPractice",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker11BadPracticeEf",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    },
+    {
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-12",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "SuperSpeaker *",
+   "name" : "SuperSpeaker *",
+   "referenced_type" : "type-1",
+   "self_type" : "type-9",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "HighVolumeSpeaker *",
+   "name" : "HighVolumeSpeaker *",
+   "referenced_type" : "type-11",
+   "self_type" : "type-12",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "float *",
+   "name" : "float *",
+   "referenced_type" : "type-3",
+   "self_type" : "type-7",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "LowVolumeSpeaker *",
+   "name" : "LowVolumeSpeaker *",
+   "referenced_type" : "type-5",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 8,
+   "fields" :
+   [
+    {
+     "access" : "private",
+     "field_name" : "mSpeakderId",
+     "field_offset" : 64,
+     "referenced_type" : "type-2"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker",
+   "name" : "SuperSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "unique_id" : "_ZTS12SuperSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI12SuperSpeaker"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker5SpeakEv"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 8,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "linker_set_key" : "HighVolumeSpeaker",
+   "name" : "HighVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-11",
+   "self_type" : "type-11",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h",
+   "unique_id" : "_ZTS17HighVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI17HighVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 8,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "fields" :
+   [
+    {
+     "field_name" : "speaker_uint_t",
+     "field_offset" : 96,
+     "referenced_type" : "type-6"
+    },
+    {
+     "field_name" : "speaker_float_star",
+     "field_offset" : 128,
+     "referenced_type" : "type-7"
+    }
+   ],
+   "linker_set_key" : "LowVolumeSpeaker",
+   "name" : "LowVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-5",
+   "self_type" : "type-5",
+   "size" : 24,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h",
+   "unique_id" : "_ZTS16LowVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI16LowVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD0Ev"
+    }
+   ]
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_cv_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_cv_diff.so.lsdump
index 13e0bc3..a1417eb 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_cv_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_cv_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -319,6 +337,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -330,6 +349,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -341,6 +361,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -352,6 +373,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -363,6 +385,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -374,10 +397,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -389,6 +414,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -400,43 +426,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_diff.so.lsdump
index 25b8dfc..c84fa5b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_fake_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_fake_diff.so.lsdump
index cae72dc..7410dbb 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_fake_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_fake_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_integral_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_integral_type_diff.so.lsdump
index db7ac45..83a7990 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_integral_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_integral_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-8"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_name_changed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_name_changed.so.lsdump
index 718ae0d..612aba5 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_name_changed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_member_name_changed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_parameter_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_parameter_type_diff.so.lsdump
index 1c97d32..6165918 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_parameter_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_parameter_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-5"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEi"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,52 +424,68 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_return_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_return_type_diff.so.lsdump
index 03537d5..e42c934 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_return_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_return_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
index d99ecd5..afcf77d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,40 +412,52 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_vtable_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_vtable_diff.so.lsdump
index efbec4e..9a1ed4a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_vtable_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libgolden_cpp_vtable_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -312,6 +330,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +342,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +354,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +366,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +378,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +395,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +407,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libpure_virtual_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libpure_virtual_function.so.lsdump
new file mode 100644
index 0000000..573df85
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libpure_virtual_function.so.lsdump
@@ -0,0 +1,148 @@
+record_types {
+  type_info {
+    name: "PureVirtualBase"
+    size: 8
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase"
+    self_type: "type-1"
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI15PureVirtualBase"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD1Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD0Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase8foo_pureEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase11foo_virtualEv"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS15PureVirtualBase"
+  }
+}
+record_types {
+  type_info {
+    name: "DerivedBar"
+    size: 8
+    alignment: 8
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar"
+    self_type: "type-4"
+  }
+  base_specifiers {
+    referenced_type: "type-1"
+    is_virtual: false
+    access: public_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI10DerivedBar"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar8foo_pureEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar11foo_virtualEv"
+      component_value: 0
+      is_pure: true
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS10DerivedBar"
+  }
+}
+pointer_types {
+  type_info {
+    name: "PureVirtualBase *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase *"
+    self_type: "type-3"
+  }
+}
+pointer_types {
+  type_info {
+    name: "DerivedBar *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar *"
+    self_type: "type-5"
+  }
+}
+builtin_types {
+  type_info {
+    name: "void"
+    size: 0
+    alignment: 0
+    referenced_type: "type-2"
+    source_file: ""
+    linker_set_key: "void"
+    self_type: "type-2"
+  }
+  is_unsigned: false
+  is_integral: false
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libreproducability.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libreproducability.so.lsdump
index 673efb5..e810193 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libreproducability.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libreproducability.so.lsdump
@@ -35,4 +35,5 @@
 }
 elf_functions {
   name: "repro"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/undeclared_types.h.sdump
new file mode 100644
index 0000000..ff0ffb7
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/undeclared_types.h.sdump
@@ -0,0 +1,113 @@
+{
+ "array_types" : [],
+ "builtin_types" : [],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "inline_function",
+   "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-4",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "access" : "private",
+   "function_name" : "InvalidClass::member_function",
+   "linker_set_key" : "_ZN12InvalidClass15member_functionE1E",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-8"
+    },
+    {
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-6",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "a",
+   "name" : "a",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "b",
+   "name" : "b",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "c",
+   "name" : "c",
+   "referenced_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "template_in_macro",
+   "name" : "template_in_macro",
+   "referenced_type" : "type-11",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "lvalue_reference_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "namespace_a::A &",
+   "name" : "namespace_a::A &",
+   "referenced_type" : "type-1",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "InvalidClass *",
+   "name" : "InvalidClass *",
+   "referenced_type" : "type-7",
+   "self_type" : "type-8",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "TemplateInMacro<F> *",
+   "name" : "TemplateInMacro<F> *",
+   "referenced_type" : "type-10",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "qualified_types" :
+ [
+  {
+   "is_const" : true,
+   "linker_set_key" : "const namespace_b::template_b<const B *>",
+   "name" : "const namespace_b::template_b<const B *>",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86/known_issues.h.sdump
new file mode 100644
index 0000000..482c1b2
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/known_issues.h.sdump
@@ -0,0 +1,46 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 4
+  }
+ ],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" : [],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "non_type_template",
+   "name" : "non_type_template",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "return_type",
+   "name" : "return_type",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "template_arg_in_namespace",
+   "name" : "template_arg_in_namespace",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  }
+ ],
+ "lvalue_reference_types" : [],
+ "pointer_types" : [],
+ "qualified_types" : [],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump
index 0b2bc23..fff7d8c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump
@@ -31,10 +31,10 @@
     name: "Cstruct"
     size: 8
     alignment: 4
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct"
-    self_type: "type-6"
+    self_type: "type-5"
   }
   fields {
     referenced_type: "type-3"
@@ -43,7 +43,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     field_offset: 32
     field_name: "b"
     access: public_access
@@ -59,10 +59,10 @@
     name: "Cinner"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner"
-    self_type: "type-8"
+    self_type: "type-7"
   }
   fields {
     referenced_type: "type-3"
@@ -103,10 +103,10 @@
     name: "Cstruct **"
     size: 4
     alignment: 4
-    referenced_type: "type-5"
+    referenced_type: "type-4"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct **"
-    self_type: "type-4"
+    self_type: "type-8"
   }
 }
 pointer_types {
@@ -114,10 +114,10 @@
     name: "Cstruct *"
     size: 4
     alignment: 4
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct *"
-    self_type: "type-5"
+    self_type: "type-4"
   }
 }
 pointer_types {
@@ -125,10 +125,10 @@
     name: "Cinner *"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner *"
-    self_type: "type-7"
+    self_type: "type-6"
   }
 }
 builtin_types {
@@ -162,8 +162,9 @@
   function_name: "CFunction"
   source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
   parameters {
-    referenced_type: "type-4"
+    referenced_type: "type-8"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -175,17 +176,21 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump
index 03a7bd9..e234d0f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump
@@ -186,6 +186,7 @@
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -197,17 +198,21 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp.so.lsdump
index 37a453e..bebbf85 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_function.so.lsdump
index 0dd522c..7e97fa8 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_function.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_function.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -408,55 +436,72 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_function_sybmol_only.so.lsdump
similarity index 73%
copy from vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
copy to vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_function_sybmol_only.so.lsdump
index d4d4ce7..bd1e283 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_function_sybmol_only.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 8
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 32
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 8
     alignment: 4
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -55,24 +122,25 @@
     name: "LowVolumeSpeaker"
     size: 16
     alignment: 4
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     field_offset: 64
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 96
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -81,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +188,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 8
-    alignment: 4
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 32
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +222,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +247,21 @@
     name: "float *"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +269,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +282,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +295,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +308,188 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::~SuperSpeaker"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeakerD2Ev"
+  access: public_access
+}
+functions {
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_global_variable.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_global_variable.so.lsdump
index e427156..3a8c08a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_global_variable.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_add_global_variable.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
@@ -410,49 +438,65 @@
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZN17HighVolumeSpeaker21global_unprotected_idE"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_function_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_function_access.so.lsdump
index 3cb585f..fe06c23 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_function_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_function_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: private_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_member_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_member_access.so.lsdump
index b9a056d..743479f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_member_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_change_member_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_diff.so.lsdump
index 29cfe09..e1740a0 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,15 +201,15 @@
   underlying_type: "type-2"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: -1
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   access: private_access
   tag_info {
@@ -301,6 +319,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -312,6 +331,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +343,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +355,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +367,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +379,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +396,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +408,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_extended.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_extended.so.lsdump
index 02fdc97..35de389 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_extended.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_enum_extended.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,23 +201,23 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   enum_fields {
     enum_field_value: 5
-    name: "SuperSpeaker::Volume::LouderThanLoudest"
+    name: "SuperSpeaker::LouderThanLoudest"
   }
   access: private_access
   tag_info {
@@ -309,6 +327,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -320,6 +339,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -331,6 +351,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -342,6 +363,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -353,6 +375,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -364,10 +387,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -379,6 +404,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -390,43 +416,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_inheritance_type_changed.so.lsdump
similarity index 68%
rename from vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
rename to vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_inheritance_type_changed.so.lsdump
index d4d4ce7..7ead17a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_inheritance_type_changed.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 8
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 32
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 8
     alignment: 4
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -53,59 +120,126 @@
 record_types {
   type_info {
     name: "LowVolumeSpeaker"
-    size: 16
+    size: 20
     alignment: 4
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
-    field_offset: 64
+    referenced_type: "type-6"
+    field_offset: 32
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
-    field_offset: 96
+    referenced_type: "type-7"
+    field_offset: 64
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
-    is_virtual: false
+    referenced_type: "type-1"
+    is_virtual: true
     access: public_access
   }
   vtable_layout {
     vtable_components {
+      kind: VBaseOffset
+      mangled_component_name: ""
+      component_value: 12
+      is_pure: false
+    }
+    vtable_components {
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: -12
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI16LowVolumeSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n12_N16LowVolumeSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n16_N16LowVolumeSpeaker6ListenEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZTv0_n20_N16LowVolumeSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZTv0_n20_N16LowVolumeSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +248,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 8
-    alignment: 4
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 32
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +282,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 4
-    alignment: 4
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +307,21 @@
     name: "float *"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +329,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +342,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +355,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +368,160 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_json.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_json.so.lsdump
new file mode 100644
index 0000000..81603fc
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_json.so.lsdump
@@ -0,0 +1,412 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float",
+   "name" : "float",
+   "referenced_type" : "type-3",
+   "self_type" : "type-3",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "is_unsigned" : true,
+   "linker_set_key" : "unsigned int",
+   "name" : "unsigned int",
+   "referenced_type" : "type-6",
+   "self_type" : "type-6",
+   "size" : 4
+  },
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-10",
+   "self_type" : "type-10"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_Z26test_virtual_function_callP12SuperSpeaker"
+  },
+  {
+   "name" : "_ZN12NotReferenced"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker11SpeakLouderEv"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker9SpeakLoudEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker6ListenEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker6ListenEv"
+  }
+ ],
+ "elf_objects" :
+ [
+  {
+   "name" : "_ZTV16LowVolumeSpeaker"
+  },
+  {
+   "name" : "_ZTV17HighVolumeSpeaker"
+  }
+ ],
+ "enum_types" :
+ [
+  {
+   "access" : "private",
+   "alignment" : 4,
+   "enum_fields" :
+   [
+    {
+     "enum_field_value" : 1,
+     "name" : "SuperSpeaker::Loud"
+    },
+    {
+     "enum_field_value" : 2,
+     "name" : "SuperSpeaker::Louder"
+    },
+    {
+     "enum_field_value" : 3,
+     "name" : "SuperSpeaker::Loudest"
+    },
+    {
+     "enum_field_value" : 0,
+     "name" : "SuperSpeaker::Lower"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker::Volume",
+   "name" : "SuperSpeaker::Volume",
+   "referenced_type" : "type-8",
+   "self_type" : "type-8",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "underlying_type" : "type-6",
+   "unique_id" : "_ZTSN12SuperSpeaker6VolumeE"
+  }
+ ],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "SuperSpeaker::SpeakLouder",
+   "linker_set_key" : "_ZN12SuperSpeaker11SpeakLouderEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::CreateSuperSpeaker",
+   "linker_set_key" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-2"
+    }
+   ],
+   "return_type" : "type-9",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::SpeakLoud",
+   "linker_set_key" : "_ZN12SuperSpeaker9SpeakLoudEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-8",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::BadPractice",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker11BadPracticeEf",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    },
+    {
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-12",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "SuperSpeaker *",
+   "name" : "SuperSpeaker *",
+   "referenced_type" : "type-1",
+   "self_type" : "type-9",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "HighVolumeSpeaker *",
+   "name" : "HighVolumeSpeaker *",
+   "referenced_type" : "type-11",
+   "self_type" : "type-12",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float *",
+   "name" : "float *",
+   "referenced_type" : "type-3",
+   "self_type" : "type-7",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "alignment" : 4,
+   "linker_set_key" : "LowVolumeSpeaker *",
+   "name" : "LowVolumeSpeaker *",
+   "referenced_type" : "type-5",
+   "self_type" : "type-4",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 4,
+   "fields" :
+   [
+    {
+     "access" : "private",
+     "field_name" : "mSpeakderId",
+     "field_offset" : 32,
+     "referenced_type" : "type-2"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker",
+   "name" : "SuperSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "unique_id" : "_ZTS12SuperSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI12SuperSpeaker"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker5SpeakEv"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 4,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "linker_set_key" : "HighVolumeSpeaker",
+   "name" : "HighVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-11",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h",
+   "unique_id" : "_ZTS17HighVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI17HighVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 4,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "fields" :
+   [
+    {
+     "field_name" : "speaker_uint_t",
+     "field_offset" : 64,
+     "referenced_type" : "type-6"
+    },
+    {
+     "field_name" : "speaker_float_star",
+     "field_offset" : 96,
+     "referenced_type" : "type-7"
+    }
+   ],
+   "linker_set_key" : "LowVolumeSpeaker",
+   "name" : "LowVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-5",
+   "self_type" : "type-5",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h",
+   "unique_id" : "_ZTS16LowVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI16LowVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD0Ev"
+    }
+   ]
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_cv_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_cv_diff.so.lsdump
index a9f7529..9a032a3 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_cv_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_cv_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -319,6 +337,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -330,6 +349,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -341,6 +361,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -352,6 +373,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -363,6 +385,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -374,10 +397,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -389,6 +414,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -400,43 +426,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_diff.so.lsdump
index 2f4f5eb..643f22a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_fake_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_fake_diff.so.lsdump
index 02fedd4..f5f3d0b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_fake_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_fake_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_integral_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_integral_type_diff.so.lsdump
index e283091..5a7b92f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_integral_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_integral_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-8"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_name_changed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_name_changed.so.lsdump
index 69ac3f1..481223c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_name_changed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_member_name_changed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_parameter_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_parameter_type_diff.so.lsdump
index 529a413..1c7097b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_parameter_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_parameter_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-5"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEi"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,52 +424,68 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_return_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_return_type_diff.so.lsdump
index 8b44979..e9096e8 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_return_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_return_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
index a30665c..1e93738 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,40 +412,52 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_vtable_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_vtable_diff.so.lsdump
index 687ee8c..e31e37c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_vtable_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libgolden_cpp_vtable_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -312,6 +330,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +342,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +354,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +366,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +378,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +395,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +407,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libpure_virtual_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libpure_virtual_function.so.lsdump
new file mode 100644
index 0000000..29a106d
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libpure_virtual_function.so.lsdump
@@ -0,0 +1,148 @@
+record_types {
+  type_info {
+    name: "PureVirtualBase"
+    size: 4
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase"
+    self_type: "type-1"
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI15PureVirtualBase"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD1Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD0Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase8foo_pureEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase11foo_virtualEv"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS15PureVirtualBase"
+  }
+}
+record_types {
+  type_info {
+    name: "DerivedBar"
+    size: 4
+    alignment: 4
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar"
+    self_type: "type-4"
+  }
+  base_specifiers {
+    referenced_type: "type-1"
+    is_virtual: false
+    access: public_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI10DerivedBar"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar8foo_pureEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar11foo_virtualEv"
+      component_value: 0
+      is_pure: true
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS10DerivedBar"
+  }
+}
+pointer_types {
+  type_info {
+    name: "PureVirtualBase *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase *"
+    self_type: "type-3"
+  }
+}
+pointer_types {
+  type_info {
+    name: "DerivedBar *"
+    size: 4
+    alignment: 4
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar *"
+    self_type: "type-5"
+  }
+}
+builtin_types {
+  type_info {
+    name: "void"
+    size: 0
+    alignment: 0
+    referenced_type: "type-2"
+    source_file: ""
+    linker_set_key: "void"
+    self_type: "type-2"
+  }
+  is_unsigned: false
+  is_integral: false
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libreproducability.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libreproducability.so.lsdump
index 673efb5..e810193 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86/libreproducability.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libreproducability.so.lsdump
@@ -35,4 +35,5 @@
 }
 elf_functions {
   name: "repro"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86/undeclared_types.h.sdump
new file mode 100644
index 0000000..ff0ffb7
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86/undeclared_types.h.sdump
@@ -0,0 +1,113 @@
+{
+ "array_types" : [],
+ "builtin_types" : [],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "inline_function",
+   "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-4",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "access" : "private",
+   "function_name" : "InvalidClass::member_function",
+   "linker_set_key" : "_ZN12InvalidClass15member_functionE1E",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-8"
+    },
+    {
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-6",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "a",
+   "name" : "a",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "b",
+   "name" : "b",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "c",
+   "name" : "c",
+   "referenced_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "template_in_macro",
+   "name" : "template_in_macro",
+   "referenced_type" : "type-11",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "lvalue_reference_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "namespace_a::A &",
+   "name" : "namespace_a::A &",
+   "referenced_type" : "type-1",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "InvalidClass *",
+   "name" : "InvalidClass *",
+   "referenced_type" : "type-7",
+   "self_type" : "type-8",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "TemplateInMacro<F> *",
+   "name" : "TemplateInMacro<F> *",
+   "referenced_type" : "type-10",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "qualified_types" :
+ [
+  {
+   "is_const" : true,
+   "linker_set_key" : "const namespace_b::template_b<const B *>",
+   "name" : "const namespace_b::template_b<const B *>",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/known_issues.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/known_issues.h.sdump
new file mode 100644
index 0000000..482c1b2
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/known_issues.h.sdump
@@ -0,0 +1,46 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 4
+  }
+ ],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" : [],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "non_type_template",
+   "name" : "non_type_template",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "return_type",
+   "name" : "return_type",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  },
+  {
+   "linker_set_key" : "template_arg_in_namespace",
+   "name" : "template_arg_in_namespace",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/known_issues.h"
+  }
+ ],
+ "lvalue_reference_types" : [],
+ "pointer_types" : [],
+ "qualified_types" : [],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump
index d08357c..f0d247b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump
@@ -31,10 +31,10 @@
     name: "Cstruct"
     size: 16
     alignment: 8
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct"
-    self_type: "type-6"
+    self_type: "type-5"
   }
   fields {
     referenced_type: "type-3"
@@ -43,7 +43,7 @@
     access: public_access
   }
   fields {
-    referenced_type: "type-7"
+    referenced_type: "type-6"
     field_offset: 64
     field_name: "b"
     access: public_access
@@ -59,10 +59,10 @@
     name: "Cinner"
     size: 4
     alignment: 4
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner"
-    self_type: "type-8"
+    self_type: "type-7"
   }
   fields {
     referenced_type: "type-3"
@@ -103,10 +103,10 @@
     name: "Cstruct **"
     size: 8
     alignment: 8
-    referenced_type: "type-5"
+    referenced_type: "type-4"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct **"
-    self_type: "type-4"
+    self_type: "type-8"
   }
 }
 pointer_types {
@@ -114,10 +114,10 @@
     name: "Cstruct *"
     size: 8
     alignment: 8
-    referenced_type: "type-6"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cstruct *"
-    self_type: "type-5"
+    self_type: "type-4"
   }
 }
 pointer_types {
@@ -125,10 +125,10 @@
     name: "Cinner *"
     size: 8
     alignment: 8
-    referenced_type: "type-8"
+    referenced_type: "type-7"
     source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
     linker_set_key: "Cinner *"
-    self_type: "type-7"
+    self_type: "type-6"
   }
 }
 builtin_types {
@@ -162,8 +162,9 @@
   function_name: "CFunction"
   source_file: "/development/vndk/tools/header-checker/tests/integration/c_and_cpp/include/c_include.h"
   parameters {
-    referenced_type: "type-4"
+    referenced_type: "type-8"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -175,17 +176,21 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump
index 498122a..af3896d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump
@@ -186,6 +186,7 @@
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "CFunction"
   access: public_access
@@ -197,17 +198,21 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_Z3fooPiS_"
   access: public_access
 }
 elf_functions {
   name: "CFunction"
+  binding: Global
 }
 elf_functions {
   name: "_Z3fooPiS_"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp.so.lsdump
index 3990163..383ad61 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_function.so.lsdump
index ccb26f6..b5afb3e 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_function.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_function.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -408,55 +436,72 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_function_sybmol_only.so.lsdump
similarity index 73%
copy from vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
copy to vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_function_sybmol_only.so.lsdump
index c8dc7f9..7f2114f 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_function_sybmol_only.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 16
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 64
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 16
     alignment: 8
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -55,24 +122,25 @@
     name: "LowVolumeSpeaker"
     size: 24
     alignment: 8
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     field_offset: 96
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 128
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -81,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +188,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 16
-    alignment: 8
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 64
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +222,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 8
     alignment: 8
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +247,21 @@
     name: "float *"
     size: 8
     alignment: 8
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +269,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +282,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +295,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +308,188 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::~SuperSpeaker"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeakerD2Ev"
+  access: public_access
+}
+functions {
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeaker13AddedFunctionEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
+}
+elf_functions {
+  name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_global_variable.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_global_variable.so.lsdump
index 4cf3373..337c3ba 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_global_variable.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_add_global_variable.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,6 +424,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
@@ -410,49 +438,65 @@
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZN17HighVolumeSpeaker21global_unprotected_idE"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_function_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_function_access.so.lsdump
index 1aa765f..849148c 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_function_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_function_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: private_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_member_access.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_member_access.so.lsdump
index 3dc6dff..db36507 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_member_access.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_change_member_access.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_diff.so.lsdump
index ca92c59..851585d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,15 +201,15 @@
   underlying_type: "type-2"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: -1
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   access: private_access
   tag_info {
@@ -301,6 +319,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -312,6 +331,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +343,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +355,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +367,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +379,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-7"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +396,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +408,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_extended.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_extended.so.lsdump
index 0a48efd..111190e 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_extended.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_enum_extended.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,23 +201,23 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   enum_fields {
     enum_field_value: 5
-    name: "SuperSpeaker::Volume::LouderThanLoudest"
+    name: "SuperSpeaker::LouderThanLoudest"
   }
   access: private_access
   tag_info {
@@ -309,6 +327,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -320,6 +339,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -331,6 +351,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -342,6 +363,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -353,6 +375,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -364,10 +387,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -379,6 +404,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -390,43 +416,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_inheritance_type_changed.so.lsdump
similarity index 68%
rename from vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
rename to vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_inheritance_type_changed.so.lsdump
index c8dc7f9..c58d080 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_fabricated_function_ast_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_inheritance_type_changed.so.lsdump
@@ -1,14 +1,75 @@
 record_types {
   type_info {
+    name: "SuperSpeaker"
+    size: 16
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+    linker_set_key: "SuperSpeaker"
+    self_type: "type-1"
+  }
+  fields {
+    referenced_type: "type-2"
+    field_offset: 64
+    field_name: "mSpeakderId"
+    access: private_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI12SuperSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS12SuperSpeaker"
+  }
+}
+record_types {
+  type_info {
     name: "HighVolumeSpeaker"
     size: 16
     alignment: 8
-    referenced_type: "HighVolumeSpeaker"
+    referenced_type: "type-11"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
     linker_set_key: "HighVolumeSpeaker"
+    self_type: "type-11"
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     is_virtual: false
     access: public_access
   }
@@ -17,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -53,59 +120,126 @@
 record_types {
   type_info {
     name: "LowVolumeSpeaker"
-    size: 24
+    size: 40
     alignment: 8
-    referenced_type: "LowVolumeSpeaker"
+    referenced_type: "type-5"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "LowVolumeSpeaker"
+    self_type: "type-5"
   }
   fields {
-    referenced_type: "unsigned int"
-    field_offset: 96
+    referenced_type: "type-6"
+    field_offset: 64
     field_name: "speaker_uint_t"
     access: public_access
   }
   fields {
-    referenced_type: "float *"
+    referenced_type: "type-7"
     field_offset: 128
     field_name: "speaker_float_star"
     access: public_access
   }
   base_specifiers {
-    referenced_type: "SuperSpeaker"
-    is_virtual: false
+    referenced_type: "type-1"
+    is_virtual: true
     access: public_access
   }
   vtable_layout {
     vtable_components {
+      kind: VBaseOffset
+      mangled_component_name: ""
+      component_value: 24
+      is_pure: false
+    }
+    vtable_components {
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: VCallOffset
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: -24
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI16LowVolumeSpeaker"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n24_N16LowVolumeSpeaker5SpeakEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZTv0_n32_N16LowVolumeSpeaker6ListenEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZTv0_n40_N16LowVolumeSpeakerD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZTv0_n40_N16LowVolumeSpeakerD0Ev"
+      component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -114,84 +248,32 @@
     unique_id: "_ZTS16LowVolumeSpeaker"
   }
 }
-record_types {
-  type_info {
-    name: "SuperSpeaker"
-    size: 16
-    alignment: 8
-    referenced_type: "SuperSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
-    linker_set_key: "SuperSpeaker"
-  }
-  fields {
-    referenced_type: "int"
-    field_offset: 64
-    field_name: "mSpeakderId"
-    access: private_access
-  }
-  vtable_layout {
-    vtable_components {
-      kind: OffsetToTop
-      mangled_component_name: ""
-      component_value: 0
-    }
-    vtable_components {
-      kind: RTTI
-      mangled_component_name: "_ZTI12SuperSpeaker"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: FunctionPointer
-      mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
-      component_value: 0
-    }
-    vtable_components {
-      kind: CompleteDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD1Ev"
-      component_value: 0
-    }
-    vtable_components {
-      kind: DeletingDtorPointer
-      mangled_component_name: "_ZN12SuperSpeakerD0Ev"
-      component_value: 0
-    }
-  }
-  access: public_access
-  record_kind: class_kind
-  tag_info {
-    unique_id: "_ZTS12SuperSpeaker"
-  }
-}
 enum_types {
   type_info {
     name: "SuperSpeaker::Volume"
     size: 4
     alignment: 4
-    referenced_type: "SuperSpeaker::Volume"
+    referenced_type: "type-8"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker::Volume"
+    self_type: "type-8"
   }
-  underlying_type: "unsigned int"
+  underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -200,32 +282,24 @@
 }
 pointer_types {
   type_info {
-    name: "HighVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "HighVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
-    linker_set_key: "HighVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
-    name: "LowVolumeSpeaker *"
-    size: 8
-    alignment: 8
-    referenced_type: "LowVolumeSpeaker"
-    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
-    linker_set_key: "LowVolumeSpeaker *"
-  }
-}
-pointer_types {
-  type_info {
     name: "SuperSpeaker *"
     size: 8
     alignment: 8
-    referenced_type: "SuperSpeaker"
+    referenced_type: "type-1"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
     linker_set_key: "SuperSpeaker *"
+    self_type: "type-9"
+  }
+}
+pointer_types {
+  type_info {
+    name: "HighVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-11"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+    linker_set_key: "HighVolumeSpeaker *"
+    self_type: "type-12"
   }
 }
 pointer_types {
@@ -233,9 +307,21 @@
     name: "float *"
     size: 8
     alignment: 8
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
     linker_set_key: "float *"
+    self_type: "type-7"
+  }
+}
+pointer_types {
+  type_info {
+    name: "LowVolumeSpeaker *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-5"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+    linker_set_key: "LowVolumeSpeaker *"
+    self_type: "type-4"
   }
 }
 builtin_types {
@@ -243,9 +329,10 @@
     name: "float"
     size: 4
     alignment: 4
-    referenced_type: "float"
+    referenced_type: "type-3"
     source_file: ""
     linker_set_key: "float"
+    self_type: "type-3"
   }
   is_unsigned: false
   is_integral: false
@@ -255,9 +342,10 @@
     name: "int"
     size: 4
     alignment: 4
-    referenced_type: "int"
+    referenced_type: "type-2"
     source_file: ""
     linker_set_key: "int"
+    self_type: "type-2"
   }
   is_unsigned: false
   is_integral: true
@@ -267,9 +355,10 @@
     name: "unsigned int"
     size: 4
     alignment: 4
-    referenced_type: "unsigned int"
+    referenced_type: "type-6"
     source_file: ""
     linker_set_key: "unsigned int"
+    self_type: "type-6"
   }
   is_unsigned: true
   is_integral: true
@@ -279,127 +368,160 @@
     name: "void"
     size: 0
     alignment: 0
-    referenced_type: "void"
+    referenced_type: "type-10"
     source_file: ""
     linker_set_key: "void"
+    self_type: "type-10"
   }
   is_unsigned: false
   is_integral: false
 }
 functions {
-  return_type: "SuperSpeaker *"
+  return_type: "type-10"
+  function_name: "SuperSpeaker::SpeakLouder"
+  source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  parameters {
+    referenced_type: "type-9"
+    default_arg: false
+    is_this_ptr: true
+  }
+  linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
+  access: public_access
+}
+functions {
+  return_type: "type-9"
   function_name: "SuperSpeaker::CreateSuperSpeaker"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "int"
+    referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
 }
 functions {
-  return_type: "SuperSpeaker::Volume"
+  return_type: "type-8"
   function_name: "SuperSpeaker::SpeakLoud"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
   parameters {
-    referenced_type: "SuperSpeaker *"
+    referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "LowVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
   parameters {
-    referenced_type: "LowVolumeSpeaker *"
+    referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
 }
 functions {
-  return_type: "HighVolumeSpeaker *"
+  return_type: "type-12"
   function_name: "HighVolumeSpeaker::BadPractice"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
-    referenced_type: "float"
+    referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Speak"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
 }
 functions {
-  return_type: "void"
+  return_type: "type-10"
   function_name: "HighVolumeSpeaker::Listen"
   source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
   parameters {
-    referenced_type: "HighVolumeSpeaker *"
+    referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_json.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_json.so.lsdump
new file mode 100644
index 0000000..3732e93
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_json.so.lsdump
@@ -0,0 +1,412 @@
+{
+ "array_types" : [],
+ "builtin_types" :
+ [
+  {
+   "alignment" : 4,
+   "linker_set_key" : "float",
+   "name" : "float",
+   "referenced_type" : "type-3",
+   "self_type" : "type-3",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "linker_set_key" : "int",
+   "name" : "int",
+   "referenced_type" : "type-2",
+   "self_type" : "type-2",
+   "size" : 4
+  },
+  {
+   "alignment" : 4,
+   "is_integral" : true,
+   "is_unsigned" : true,
+   "linker_set_key" : "unsigned int",
+   "name" : "unsigned int",
+   "referenced_type" : "type-6",
+   "self_type" : "type-6",
+   "size" : 4
+  },
+  {
+   "linker_set_key" : "void",
+   "name" : "void",
+   "referenced_type" : "type-10",
+   "self_type" : "type-10"
+  }
+ ],
+ "elf_functions" :
+ [
+  {
+   "name" : "_Z26test_virtual_function_callP12SuperSpeaker"
+  },
+  {
+   "name" : "_ZN12NotReferenced"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker11SpeakLouderEv"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  },
+  {
+   "name" : "_ZN12SuperSpeaker9SpeakLoudEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN16LowVolumeSpeaker6ListenEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+  },
+  {
+   "name" : "_ZN17HighVolumeSpeaker6ListenEv"
+  }
+ ],
+ "elf_objects" :
+ [
+  {
+   "name" : "_ZTV16LowVolumeSpeaker"
+  },
+  {
+   "name" : "_ZTV17HighVolumeSpeaker"
+  }
+ ],
+ "enum_types" :
+ [
+  {
+   "access" : "private",
+   "alignment" : 4,
+   "enum_fields" :
+   [
+    {
+     "enum_field_value" : 1,
+     "name" : "SuperSpeaker::Loud"
+    },
+    {
+     "enum_field_value" : 2,
+     "name" : "SuperSpeaker::Louder"
+    },
+    {
+     "enum_field_value" : 3,
+     "name" : "SuperSpeaker::Loudest"
+    },
+    {
+     "enum_field_value" : 0,
+     "name" : "SuperSpeaker::Lower"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker::Volume",
+   "name" : "SuperSpeaker::Volume",
+   "referenced_type" : "type-8",
+   "self_type" : "type-8",
+   "size" : 4,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "underlying_type" : "type-6",
+   "unique_id" : "_ZTSN12SuperSpeaker6VolumeE"
+  }
+ ],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "SuperSpeaker::SpeakLouder",
+   "linker_set_key" : "_ZN12SuperSpeaker11SpeakLouderEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::CreateSuperSpeaker",
+   "linker_set_key" : "_ZN12SuperSpeaker18CreateSuperSpeakerEi",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-2"
+    }
+   ],
+   "return_type" : "type-9",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "SuperSpeaker::SpeakLoud",
+   "linker_set_key" : "_ZN12SuperSpeaker9SpeakLoudEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-8",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "LowVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN16LowVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-4"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::BadPractice",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker11BadPracticeEf",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    },
+    {
+     "referenced_type" : "type-3"
+    }
+   ],
+   "return_type" : "type-12",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Speak",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker5SpeakEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "function_name" : "HighVolumeSpeaker::Listen",
+   "linker_set_key" : "_ZN17HighVolumeSpeaker6ListenEv",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-12"
+    }
+   ],
+   "return_type" : "type-10",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "SuperSpeaker *",
+   "name" : "SuperSpeaker *",
+   "referenced_type" : "type-1",
+   "self_type" : "type-9",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "HighVolumeSpeaker *",
+   "name" : "HighVolumeSpeaker *",
+   "referenced_type" : "type-11",
+   "self_type" : "type-12",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "float *",
+   "name" : "float *",
+   "referenced_type" : "type-3",
+   "self_type" : "type-7",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "LowVolumeSpeaker *",
+   "name" : "LowVolumeSpeaker *",
+   "referenced_type" : "type-5",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h"
+  }
+ ],
+ "qualified_types" : [],
+ "record_types" :
+ [
+  {
+   "alignment" : 8,
+   "fields" :
+   [
+    {
+     "access" : "private",
+     "field_name" : "mSpeakderId",
+     "field_offset" : 64,
+     "referenced_type" : "type-2"
+    }
+   ],
+   "linker_set_key" : "SuperSpeaker",
+   "name" : "SuperSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-1",
+   "self_type" : "type-1",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/abstract_class.h",
+   "unique_id" : "_ZTS12SuperSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI12SuperSpeaker"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker5SpeakEv"
+    },
+    {
+     "is_pure" : true,
+     "mangled_component_name" : "_ZN12SuperSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN12SuperSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 8,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "linker_set_key" : "HighVolumeSpeaker",
+   "name" : "HighVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-11",
+   "self_type" : "type-11",
+   "size" : 16,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/high_volume_speaker.h",
+   "unique_id" : "_ZTS17HighVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI17HighVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN17HighVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN17HighVolumeSpeakerD0Ev"
+    }
+   ]
+  },
+  {
+   "alignment" : 8,
+   "base_specifiers" :
+   [
+    {
+     "referenced_type" : "type-1"
+    }
+   ],
+   "fields" :
+   [
+    {
+     "field_name" : "speaker_uint_t",
+     "field_offset" : 96,
+     "referenced_type" : "type-6"
+    },
+    {
+     "field_name" : "speaker_float_star",
+     "field_offset" : 128,
+     "referenced_type" : "type-7"
+    }
+   ],
+   "linker_set_key" : "LowVolumeSpeaker",
+   "name" : "LowVolumeSpeaker",
+   "record_kind" : "class",
+   "referenced_type" : "type-5",
+   "self_type" : "type-5",
+   "size" : 24,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/gold/include/low_volume_speaker.h",
+   "unique_id" : "_ZTS16LowVolumeSpeaker",
+   "vtable_components" :
+   [
+    {
+     "kind" : "offset_to_top"
+    },
+    {
+     "kind" : "rtti",
+     "mangled_component_name" : "_ZTI16LowVolumeSpeaker"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker5SpeakEv"
+    },
+    {
+     "mangled_component_name" : "_ZN16LowVolumeSpeaker6ListenEv"
+    },
+    {
+     "kind" : "complete_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD1Ev"
+    },
+    {
+     "kind" : "deleting_dtor_pointer",
+     "mangled_component_name" : "_ZN16LowVolumeSpeakerD0Ev"
+    }
+   ]
+  }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_cv_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_cv_diff.so.lsdump
index 13e0bc3..a1417eb 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_cv_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_cv_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -319,6 +337,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -330,6 +349,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -341,6 +361,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -352,6 +373,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -363,6 +385,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -374,10 +397,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -389,6 +414,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -400,43 +426,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_diff.so.lsdump
index 25b8dfc..c84fa5b 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_fake_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_fake_diff.so.lsdump
index cae72dc..7410dbb 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_fake_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_fake_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-9"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -318,6 +336,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -329,6 +348,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -340,6 +360,7 @@
   parameters {
     referenced_type: "type-10"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -351,6 +372,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -362,6 +384,7 @@
   parameters {
     referenced_type: "type-5"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -373,10 +396,12 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -388,6 +413,7 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -399,43 +425,56 @@
   parameters {
     referenced_type: "type-13"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_integral_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_integral_type_diff.so.lsdump
index db7ac45..83a7990 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_integral_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_integral_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-8"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_name_changed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_name_changed.so.lsdump
index 718ae0d..612aba5 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_name_changed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_member_name_changed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_parameter_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_parameter_type_diff.so.lsdump
index 1c97d32..6165918 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_parameter_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_parameter_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-5"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeakerD2Ev"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -360,6 +383,7 @@
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -371,10 +395,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEi"
   access: public_access
@@ -386,6 +412,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -397,52 +424,68 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeakerD2Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeakerD0Ev"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_return_type_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_return_type_diff.so.lsdump
index 03537d5..e42c934 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_return_type_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_return_type_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,43 +412,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
index d99ecd5..afcf77d 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_unreferenced_elf_symbol_removed.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -305,6 +323,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker11SpeakLouderEv"
   access: public_access
@@ -316,6 +335,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -327,6 +347,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -338,6 +359,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -349,6 +371,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -360,10 +383,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -375,6 +400,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -386,40 +412,52 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_vtable_diff.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_vtable_diff.so.lsdump
index efbec4e..9a1ed4a 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_vtable_diff.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libgolden_cpp_vtable_diff.so.lsdump
@@ -19,31 +19,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI12SuperSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker6ListenEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN12SuperSpeaker5SpeakEv"
       component_value: 0
+      is_pure: true
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN12SuperSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -72,31 +78,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI17HighVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN17HighVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN17HighVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -137,31 +149,37 @@
       kind: OffsetToTop
       mangled_component_name: ""
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: RTTI
       mangled_component_name: "_ZTI16LowVolumeSpeaker"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker6ListenEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: FunctionPointer
       mangled_component_name: "_ZN16LowVolumeSpeaker5SpeakEv"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: CompleteDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD1Ev"
       component_value: 0
+      is_pure: false
     }
     vtable_components {
       kind: DeletingDtorPointer
       mangled_component_name: "_ZN16LowVolumeSpeakerD0Ev"
       component_value: 0
+      is_pure: false
     }
   }
   access: public_access
@@ -183,19 +201,19 @@
   underlying_type: "type-6"
   enum_fields {
     enum_field_value: 1
-    name: "SuperSpeaker::Volume::Loud"
+    name: "SuperSpeaker::Loud"
   }
   enum_fields {
     enum_field_value: 2
-    name: "SuperSpeaker::Volume::Louder"
+    name: "SuperSpeaker::Louder"
   }
   enum_fields {
     enum_field_value: 3
-    name: "SuperSpeaker::Volume::Loudest"
+    name: "SuperSpeaker::Loudest"
   }
   enum_fields {
-    enum_field_value: 4
-    name: "SuperSpeaker::Volume::Lower"
+    enum_field_value: 0
+    name: "SuperSpeaker::Lower"
   }
   access: private_access
   tag_info {
@@ -312,6 +330,7 @@
   parameters {
     referenced_type: "type-2"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
   access: public_access
@@ -323,6 +342,7 @@
   parameters {
     referenced_type: "type-9"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN12SuperSpeaker9SpeakLoudEv"
   access: public_access
@@ -334,6 +354,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker5SpeakEv"
   access: public_access
@@ -345,6 +366,7 @@
   parameters {
     referenced_type: "type-4"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN16LowVolumeSpeaker6ListenEv"
   access: public_access
@@ -356,10 +378,12 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   parameters {
     referenced_type: "type-3"
     default_arg: false
+    is_this_ptr: false
   }
   linker_set_key: "_ZN17HighVolumeSpeaker11BadPracticeEf"
   access: public_access
@@ -371,6 +395,7 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker5SpeakEv"
   access: public_access
@@ -382,43 +407,56 @@
   parameters {
     referenced_type: "type-12"
     default_arg: false
+    is_this_ptr: true
   }
   linker_set_key: "_ZN17HighVolumeSpeaker6ListenEv"
   access: public_access
 }
 elf_functions {
   name: "_Z26test_virtual_function_callP12SuperSpeaker"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12NotReferenced"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker11SpeakLouderEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker18CreateSuperSpeakerEi"
+  binding: Global
 }
 elf_functions {
   name: "_ZN12SuperSpeaker9SpeakLoudEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN16LowVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker11BadPracticeEf"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker5SpeakEv"
+  binding: Global
 }
 elf_functions {
   name: "_ZN17HighVolumeSpeaker6ListenEv"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV16LowVolumeSpeaker"
+  binding: Global
 }
 elf_objects {
   name: "_ZTV17HighVolumeSpeaker"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libpure_virtual_function.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libpure_virtual_function.so.lsdump
new file mode 100644
index 0000000..573df85
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libpure_virtual_function.so.lsdump
@@ -0,0 +1,148 @@
+record_types {
+  type_info {
+    name: "PureVirtualBase"
+    size: 8
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase"
+    self_type: "type-1"
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI15PureVirtualBase"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD1Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN15PureVirtualBaseD0Ev"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase8foo_pureEv"
+      component_value: 0
+      is_pure: true
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN15PureVirtualBase11foo_virtualEv"
+      component_value: 0
+      is_pure: false
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS15PureVirtualBase"
+  }
+}
+record_types {
+  type_info {
+    name: "DerivedBar"
+    size: 8
+    alignment: 8
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar"
+    self_type: "type-4"
+  }
+  base_specifiers {
+    referenced_type: "type-1"
+    is_virtual: false
+    access: public_access
+  }
+  vtable_layout {
+    vtable_components {
+      kind: OffsetToTop
+      mangled_component_name: ""
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: RTTI
+      mangled_component_name: "_ZTI10DerivedBar"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: CompleteDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD1Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: DeletingDtorPointer
+      mangled_component_name: "_ZN10DerivedBarD0Ev"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar8foo_pureEv"
+      component_value: 0
+      is_pure: false
+    }
+    vtable_components {
+      kind: FunctionPointer
+      mangled_component_name: "_ZN10DerivedBar11foo_virtualEv"
+      component_value: 0
+      is_pure: true
+    }
+  }
+  access: public_access
+  record_kind: class_kind
+  tag_info {
+    unique_id: "_ZTS10DerivedBar"
+  }
+}
+pointer_types {
+  type_info {
+    name: "PureVirtualBase *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-1"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "PureVirtualBase *"
+    self_type: "type-3"
+  }
+}
+pointer_types {
+  type_info {
+    name: "DerivedBar *"
+    size: 8
+    alignment: 8
+    referenced_type: "type-4"
+    source_file: "/development/vndk/tools/header-checker/tests/integration/cpp/pure_virtual/include/header1.h"
+    linker_set_key: "DerivedBar *"
+    self_type: "type-5"
+  }
+}
+builtin_types {
+  type_info {
+    name: "void"
+    size: 0
+    alignment: 0
+    referenced_type: "type-2"
+    source_file: ""
+    linker_set_key: "void"
+    self_type: "type-2"
+  }
+  is_unsigned: false
+  is_integral: false
+}
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libreproducability.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libreproducability.so.lsdump
index 673efb5..e810193 100644
--- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libreproducability.so.lsdump
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libreproducability.so.lsdump
@@ -35,4 +35,5 @@
 }
 elf_functions {
   name: "repro"
+  binding: Global
 }
diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/undeclared_types.h.sdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/undeclared_types.h.sdump
new file mode 100644
index 0000000..ff0ffb7
--- /dev/null
+++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/undeclared_types.h.sdump
@@ -0,0 +1,113 @@
+{
+ "array_types" : [],
+ "builtin_types" : [],
+ "elf_functions" : [],
+ "elf_objects" : [],
+ "enum_types" : [],
+ "function_types" : [],
+ "functions" :
+ [
+  {
+   "function_name" : "inline_function",
+   "linker_set_key" : "_Z15inline_function10template_cIJ10template_dIJA_N11namespace_c1CEEEEE",
+   "parameters" :
+   [
+    {
+     "referenced_type" : "type-5"
+    }
+   ],
+   "return_type" : "type-4",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "access" : "private",
+   "function_name" : "InvalidClass::member_function",
+   "linker_set_key" : "_ZN12InvalidClass15member_functionE1E",
+   "parameters" :
+   [
+    {
+     "is_this_ptr" : true,
+     "referenced_type" : "type-8"
+    },
+    {
+     "referenced_type" : "type-9"
+    }
+   ],
+   "return_type" : "type-6",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "global_vars" :
+ [
+  {
+   "linker_set_key" : "a",
+   "name" : "a",
+   "referenced_type" : "type-1",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "b",
+   "name" : "b",
+   "referenced_type" : "type-2",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "c",
+   "name" : "c",
+   "referenced_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "linker_set_key" : "template_in_macro",
+   "name" : "template_in_macro",
+   "referenced_type" : "type-11",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "lvalue_reference_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "namespace_a::A &",
+   "name" : "namespace_a::A &",
+   "referenced_type" : "type-1",
+   "self_type" : "type-4",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "pointer_types" :
+ [
+  {
+   "alignment" : 8,
+   "linker_set_key" : "InvalidClass *",
+   "name" : "InvalidClass *",
+   "referenced_type" : "type-7",
+   "self_type" : "type-8",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  },
+  {
+   "alignment" : 8,
+   "linker_set_key" : "TemplateInMacro<F> *",
+   "name" : "TemplateInMacro<F> *",
+   "referenced_type" : "type-10",
+   "self_type" : "type-11",
+   "size" : 8,
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "qualified_types" :
+ [
+  {
+   "is_const" : true,
+   "linker_set_key" : "const namespace_b::template_b<const B *>",
+   "name" : "const namespace_b::template_b<const B *>",
+   "referenced_type" : "type-2",
+   "self_type" : "type-3",
+   "source_file" : "/development/vndk/tools/header-checker/tests/integration/cpp/header/undeclared_types.h"
+  }
+ ],
+ "record_types" : [],
+ "rvalue_reference_types" : []
+}
diff --git a/vndk/tools/header-checker/tests/test.py b/vndk/tools/header-checker/tests/test.py
index 526735c..1ed8852 100755
--- a/vndk/tools/header-checker/tests/test.py
+++ b/vndk/tools/header-checker/tests/test.py
@@ -9,32 +9,52 @@
 import_path = os.path.abspath(os.path.join(import_path, 'utils'))
 sys.path.insert(1, import_path)
 
-from utils import (
-        AOSP_DIR, SOURCE_ABI_DUMP_EXT, TARGET_ARCHS, read_output_content,
-        run_abi_diff, run_header_abi_dumper)
+from utils import (AOSP_DIR, read_output_content, run_abi_diff,
+                   run_header_abi_dumper)
 from module import Module
-from gen_all import make_and_copy_reference_dumps
+
 
 SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
 INPUT_DIR = os.path.join(SCRIPT_DIR, 'input')
 EXPECTED_DIR = os.path.join(SCRIPT_DIR, 'expected')
-REF_DUMP_DIR = os.path.join(SCRIPT_DIR,  'reference_dumps')
+REF_DUMP_DIR = os.path.join(SCRIPT_DIR, 'reference_dumps')
 
-class MyTest(unittest.TestCase):
+
+def make_and_copy_reference_dumps(module, reference_dump_dir=REF_DUMP_DIR):
+    output_content = module.make_dump()
+
+    dump_dir = os.path.join(reference_dump_dir, module.arch)
+    os.makedirs(dump_dir, exist_ok=True)
+
+    dump_path = os.path.join(dump_dir, module.get_dump_name())
+    with open(dump_path, 'w') as f:
+        f.write(output_content)
+
+    return dump_path
+
+
+class HeaderCheckerTest(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
         cls.maxDiff = None
 
-    def get_reference_dump_path(self, name, target_arch):
-        ref_dump_dir = os.path.join(REF_DUMP_DIR, target_arch)
-        ref_dump_path = os.path.join(ref_dump_dir,
-                                     name + SOURCE_ABI_DUMP_EXT)
-        return ref_dump_path
+    def setUp(self):
+        self.tmp_dir = None
+
+    def tearDown(self):
+        if self.tmp_dir:
+            self.tmp_dir.cleanup()
+            self.tmp_dir = None
+
+    def get_tmp_dir(self):
+        if not self.tmp_dir:
+            self.tmp_dir = tempfile.TemporaryDirectory()
+        return self.tmp_dir.name
 
     def run_and_compare(self, input_path, expected_path, cflags=[]):
         with open(expected_path, 'r') as f:
             expected_output = f.read()
-        actual_output = run_header_abi_dumper(input_path, True, cflags)
+        actual_output = run_header_abi_dumper(input_path, cflags)
         self.assertEqual(actual_output, expected_output)
 
     def run_and_compare_name(self, name, cflags=[]):
@@ -50,75 +70,74 @@
         self.run_and_compare_name_cpp(name, cflags)
 
     def run_and_compare_abi_diff(self, old_dump, new_dump, lib, arch,
-                                 expected_return_code, flags=[]) :
+                                 expected_return_code, flags=[]):
         actual_output = run_abi_diff(old_dump, new_dump, arch, lib, flags)
         self.assertEqual(actual_output, expected_return_code)
 
     def prepare_and_run_abi_diff(self, old_ref_dump_path, new_ref_dump_path,
                                  target_arch, expected_return_code, flags=[]):
         self.run_and_compare_abi_diff(old_ref_dump_path, new_ref_dump_path,
-                                      'test', target_arch, expected_return_code,
-                                      flags)
+                                      'test', target_arch,
+                                      expected_return_code, flags)
 
-    def create_ref_dump(self, name, dir_name, target_arch):
-        module_bare = Module.get_test_module_by_name(name)
-        module = Module.mutate_module_for_arch(module_bare, target_arch)
-        return make_and_copy_reference_dumps(module, [],
-                                             dir_name)
-
-    def get_or_create_ref_dump(self, name, target_arch, dir_name, create):
-        if create == True:
-            return self.create_ref_dump(name, dir_name, target_arch)
-        return self.get_reference_dump_path(name, target_arch)
+    def get_or_create_ref_dump(self, module, create):
+        if create:
+            return make_and_copy_reference_dumps(module, self.get_tmp_dir())
+        return os.path.join(REF_DUMP_DIR, module.arch, module.get_dump_name())
 
     def prepare_and_run_abi_diff_all_archs(self, old_lib, new_lib,
                                            expected_return_code, flags=[],
                                            create_old=False, create_new=True):
-        with tempfile.TemporaryDirectory() as tmp:
-            for target_arch in TARGET_ARCHS:
-                old_ref_dump_path = self.get_or_create_ref_dump(old_lib,
-                                                                target_arch,
-                                                                tmp, create_old)
-                new_ref_dump_path = self.get_or_create_ref_dump(new_lib,
-                                                                target_arch,
-                                                                tmp, create_new)
-                self.prepare_and_run_abi_diff(old_ref_dump_path,
-                                              new_ref_dump_path, target_arch,
-                                              expected_return_code, flags)
+        old_modules = Module.get_test_modules_by_name(old_lib)
+        new_modules = Module.get_test_modules_by_name(new_lib)
+        self.assertEqual(len(old_modules), len(new_modules))
 
-    def prepare_and_absolute_diff_all_archs(self, old_lib, new_lib,
-                                            flags=[], create=True):
-        with tempfile.TemporaryDirectory() as tmp:
-            for target_arch in TARGET_ARCHS:
-                old_ref_dump_path = self.get_or_create_ref_dump(old_lib,
-                                                                target_arch,
-                                                                tmp, False)
-                new_ref_dump_path = self.get_or_create_ref_dump(new_lib,
-                                                                target_arch,
-                                                                tmp, create)
-                self.assertEqual(
-                    read_output_content(old_ref_dump_path, AOSP_DIR),
-                    read_output_content(new_ref_dump_path, AOSP_DIR))
+        for old_module, new_module in zip(old_modules, new_modules):
+            self.assertEqual(old_module.arch, new_module.arch)
+            old_ref_dump_path = self.get_or_create_ref_dump(old_module,
+                                                            create_old)
+            new_ref_dump_path = self.get_or_create_ref_dump(new_module,
+                                                            create_new)
+            self.prepare_and_run_abi_diff(
+                old_ref_dump_path, new_ref_dump_path, new_module.arch,
+                expected_return_code, flags)
 
-    def test_func_decl_no_args(self):
-        self.run_and_compare_name_c_cpp('func_decl_no_args.h')
+    def prepare_and_absolute_diff_all_archs(self, old_lib, new_lib):
+        old_modules = Module.get_test_modules_by_name(old_lib)
+        new_modules = Module.get_test_modules_by_name(new_lib)
+        self.assertEqual(len(old_modules), len(new_modules))
 
-    def test_func_decl_one_arg(self):
-        self.run_and_compare_name_c_cpp('func_decl_one_arg.h')
+        for old_module, new_module in zip(old_modules, new_modules):
+            self.assertEqual(old_module.arch, new_module.arch)
+            old_ref_dump_path = self.get_or_create_ref_dump(old_module, False)
+            new_ref_dump_path = self.get_or_create_ref_dump(new_module, True)
+            self.assertEqual(
+                read_output_content(old_ref_dump_path, AOSP_DIR),
+                read_output_content(new_ref_dump_path, AOSP_DIR))
 
-    def test_func_decl_two_args(self):
-        self.run_and_compare_name_c_cpp('func_decl_two_args.h')
+    def test_example1_cpp(self):
+        self.run_and_compare_name_cpp('example1.cpp')
 
-    def test_func_decl_one_arg_ret(self):
-        self.run_and_compare_name_c_cpp('func_decl_one_arg_ret.h')
-
-    def test_example1(self):
+    def test_example1_h(self):
         self.run_and_compare_name_cpp('example1.h')
+
+    def test_example2_h(self):
         self.run_and_compare_name_cpp('example2.h')
 
+    def test_example3_h(self):
+        self.run_and_compare_name_cpp('example3.h')
+
+    def test_undeclared_types_h(self):
+        self.prepare_and_absolute_diff_all_archs(
+            'undeclared_types.h', 'undeclared_types.h')
+
+    def test_known_issues_h(self):
+        self.prepare_and_absolute_diff_all_archs(
+            'known_issues.h', 'known_issues.h')
+
     def test_libc_and_cpp(self):
-        self.prepare_and_run_abi_diff_all_archs("libc_and_cpp", "libc_and_cpp",
-                                                 0)
+        self.prepare_and_run_abi_diff_all_archs(
+            "libc_and_cpp", "libc_and_cpp", 0)
 
     def test_libc_and_cpp_and_libc_and_cpp_with_unused_struct(self):
         self.prepare_and_run_abi_diff_all_archs(
@@ -134,18 +153,25 @@
             "libc_and_cpp", "libc_and_cpp_with_unused_struct", 1,
             ['-check-all-apis'])
 
-    def test_libc_and_cpp_with_unused_struct_and_libc_and_cpp_with_unused_cstruct(self):
+    def test_libc_and_cpp_with_unused_struct_and_libc_and_cpp_with_unused_cstruct(
+            self):
         self.prepare_and_run_abi_diff_all_archs(
             "libc_and_cpp_with_unused_struct",
             "libc_and_cpp_with_unused_cstruct", 0,
             ['-check-all-apis', '-allow-unreferenced-changes'])
 
     def test_libc_and_cpp_and_libc_and_cpp_with_unused_struct_check_all_advice(
-        self):
+            self):
         self.prepare_and_run_abi_diff_all_archs(
             "libc_and_cpp", "libc_and_cpp_with_unused_struct", 0,
             ['-check-all-apis', '-advice-only'])
 
+    def test_libc_and_cpp_opaque_pointer_diff(self):
+        self.prepare_and_run_abi_diff_all_archs(
+            "libc_and_cpp_with_opaque_ptr_a",
+            "libc_and_cpp_with_opaque_ptr_b", 8,
+            ['-consider-opaque-types-different'], True, True)
+
     def test_libgolden_cpp_return_type_diff(self):
         self.prepare_and_run_abi_diff_all_archs(
             "libgolden_cpp", "libgolden_cpp_return_type_diff", 8)
@@ -169,6 +195,11 @@
             "libgolden_cpp", "libgolden_cpp_add_function_and_unexported_elf",
             4)
 
+    def test_libgolden_cpp_fabricated_function_ast_removed_diff(self):
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp_add_function_sybmol_only",
+            "libgolden_cpp_add_function", 0, [], False, False)
+
     def test_libgolden_cpp_change_function_access(self):
         self.prepare_and_run_abi_diff_all_archs(
             "libgolden_cpp", "libgolden_cpp_change_function_access", 8)
@@ -187,34 +218,28 @@
             "libgolden_cpp", "libgolden_cpp_parameter_type_diff", 8)
 
     def test_libgolden_cpp_with_vtable_diff(self):
-        self.prepare_and_run_abi_diff_all_archs("libgolden_cpp",
-                                                "libgolden_cpp_vtable_diff", 8)
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp", "libgolden_cpp_vtable_diff", 8)
 
     def test_libgolden_cpp_member_diff_advice_only(self):
-        self.prepare_and_run_abi_diff_all_archs("libgolden_cpp",
-                                                "libgolden_cpp_member_diff",
-                                                 0, ['-advice-only'])
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp", "libgolden_cpp_member_diff", 0, ['-advice-only'])
 
     def test_libgolden_cpp_member_diff(self):
-        self.prepare_and_run_abi_diff_all_archs("libgolden_cpp",
-                                                "libgolden_cpp_member_diff", 8)
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp", "libgolden_cpp_member_diff", 8)
 
     def test_libgolden_cpp_change_member_access(self):
         self.prepare_and_run_abi_diff_all_archs(
             "libgolden_cpp", "libgolden_cpp_change_member_access", 8)
 
     def test_libgolden_cpp_enum_extended(self):
-        self.prepare_and_run_abi_diff_all_archs("libgolden_cpp",
-                                                "libgolden_cpp_enum_extended",
-                                                4)
-    def test_libgolden_cpp_enum_diff(self):
-        self.prepare_and_run_abi_diff_all_archs("libgolden_cpp",
-                                                "libgolden_cpp_enum_diff", 8)
-
-    def test_libgolden_cpp_fabricated_function_ast_removed_diff(self):
         self.prepare_and_run_abi_diff_all_archs(
-            "libgolden_cpp_fabricated_function_ast_removed", "libgolden_cpp", 0,
-            [], False)
+            "libgolden_cpp", "libgolden_cpp_enum_extended", 4)
+
+    def test_libgolden_cpp_enum_diff(self):
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp", "libgolden_cpp_enum_diff", 8)
 
     def test_libgolden_cpp_member_fake_diff(self):
         self.prepare_and_run_abi_diff_all_archs(
@@ -230,24 +255,78 @@
 
     def test_libgolden_cpp_unreferenced_elf_symbol_removed(self):
         self.prepare_and_run_abi_diff_all_archs(
-            "libgolden_cpp",
-            "libgolden_cpp_unreferenced_elf_symbol_removed", 16)
+            "libgolden_cpp", "libgolden_cpp_unreferenced_elf_symbol_removed",
+            16)
 
     def test_libreproducability(self):
-        self.prepare_and_absolute_diff_all_archs("libreproducability",
-                                                 "libreproducability")
+        self.prepare_and_absolute_diff_all_archs(
+            "libreproducability", "libreproducability")
 
     def test_libgolden_cpp_member_name_changed(self):
         self.prepare_and_run_abi_diff_all_archs(
-            "libgolden_cpp",
-            "libgolden_cpp_member_name_changed", 0)
+            "libgolden_cpp", "libgolden_cpp_member_name_changed", 0)
 
     def test_libgolden_cpp_member_function_pointer_changed(self):
         self.prepare_and_run_abi_diff_all_archs(
             "libgolden_cpp_function_pointer",
-            "libgolden_cpp_function_pointer_parameter_added", 8, [], False,
-            False)
+            "libgolden_cpp_function_pointer_parameter_added", 8, [],
+            True, True)
 
+    def test_libgolden_cpp_internal_struct_access_upgraded(self):
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp_internal_private_struct",
+            "libgolden_cpp_internal_public_struct", 0, [], True, True)
+
+    def test_libgolden_cpp_internal_struct_access_downgraded(self):
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp_internal_public_struct",
+            "libgolden_cpp_internal_private_struct", 8, [], True, True)
+
+    def test_libgolden_cpp_inheritance_type_changed(self):
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp", "libgolden_cpp_inheritance_type_changed", 8, [],
+            True, True)
+
+    def test_libpure_virtual_function(self):
+        self.prepare_and_absolute_diff_all_archs(
+            "libpure_virtual_function", "libpure_virtual_function")
+
+    def test_libc_and_cpp_in_json(self):
+        self.prepare_and_absolute_diff_all_archs(
+            "libgolden_cpp_json", "libgolden_cpp_json")
+
+    def test_libc_and_cpp_in_protobuf_and_json(self):
+        self.prepare_and_run_abi_diff_all_archs(
+            "libgolden_cpp", "libgolden_cpp_json", 0,
+            ["-input-format-old", "ProtobufTextFormat",
+             "-input-format-new", "Json"])
+
+    def test_opaque_type_self_diff(self):
+        lsdump = os.path.join(
+            SCRIPT_DIR, "abi_dumps", "opaque_ptr_types.lsdump")
+        self.run_and_compare_abi_diff(
+            lsdump, lsdump, "libexample", "arm64", 0,
+            ["-input-format-old", "Json", "-input-format-new", "Json",
+             "-consider-opaque-types-different"])
+
+    def test_linker_shared_object_file_and_version_script(self):
+        base_dir = os.path.join(
+            SCRIPT_DIR, 'integration', 'version_script_example')
+
+        cases = [
+            'libversion_script_example',
+            'libversion_script_example_no_mytag',
+            'libversion_script_example_no_private',
+        ]
+
+        for module_name in cases:
+            module = Module.get_test_modules_by_name(module_name)[0]
+            example_lsdump_old = self.get_or_create_ref_dump(module, False)
+            example_lsdump_new = self.get_or_create_ref_dump(module, True)
+            self.run_and_compare_abi_diff(
+                example_lsdump_old, example_lsdump_new,
+                module_name, "arm64", 0,
+                ["-input-format-old", "Json", "-input-format-new", "Json"])
 
 
 if __name__ == '__main__':
diff --git a/vndk/tools/header-checker/utils/create_reference_dumps.py b/vndk/tools/header-checker/utils/create_reference_dumps.py
index d9cc7a3..80e51d2 100755
--- a/vndk/tools/header-checker/utils/create_reference_dumps.py
+++ b/vndk/tools/header-checker/utils/create_reference_dumps.py
@@ -1,22 +1,26 @@
 #!/usr/bin/env python3
 
-import os
-import re
-import sys
-import subprocess
 import argparse
+import collections
+import os
+import shutil
 import time
 
-from utils import (make_libraries, make_tree, find_lib_lsdumps,
-                   get_build_vars_for_product, AOSP_DIR, read_output_content,
-                   copy_reference_dumps, COMPRESSED_SOURCE_ABI_DUMP_EXT,
-                   SOURCE_ABI_DUMP_EXT, SOURCE_ABI_DUMP_EXT_END, SO_EXT,
-                   make_targets)
+from utils import (
+    AOSP_DIR, COMPRESSED_SOURCE_ABI_DUMP_EXT, SOURCE_ABI_DUMP_EXT,
+    SOURCE_ABI_DUMP_EXT_END, SO_EXT, copy_reference_dumps, find_lib_lsdumps,
+    get_build_vars_for_product, get_module_variant_dir_name, make_libraries,
+    make_tree)
 
-PRODUCTS = ['aosp_arm_ab', 'aosp_arm', 'aosp_arm64', 'aosp_x86_ab', 'aosp_x86',
-            'aosp_x86_64']
+
+PRODUCTS_DEFAULT = ['aosp_arm_ab', 'aosp_arm', 'aosp_arm64', 'aosp_x86_ab',
+                    'aosp_x86', 'aosp_x86_64']
+
+PREBUILTS_ABI_DUMPS_DEFAULT = os.path.join(AOSP_DIR, 'prebuilts', 'abi-dumps')
+
 SOONG_DIR = os.path.join(AOSP_DIR, 'out', 'soong', '.intermediates')
 
+
 class Target(object):
     def __init__(self, has_2nd, product):
         extra = '_2ND' if has_2nd else ''
@@ -30,57 +34,101 @@
         self.arch_variant = build_vars[2]
         self.cpu_variant = build_vars[3]
 
+
 def get_lsdump_paths(product, libs):
     if libs is None:
         return get_lsdump_paths_from_out(product)
     return search_for_lsdump_paths(SOONG_DIR, libs)
 
+
 def get_lsdump_paths_from_out(product):
     build_vars_to_fetch = ['OUT_DIR', 'TARGET_DEVICE']
     build_vars = get_build_vars_for_product(build_vars_to_fetch, product)
-    lsdump_paths_file = os.path.join(AOSP_DIR, build_vars[0],'target',
-                                     'product', build_vars[1],
-                                     'lsdump_paths.txt')
-    assert(os.path.exists(lsdump_paths_file) == True)
-    lsdump_paths = dict()
+    lsdump_paths_file = os.path.join(
+        AOSP_DIR, build_vars[0], 'target', 'product', build_vars[1],
+        'lsdump_paths.txt')
+    assert os.path.exists(lsdump_paths_file)
+    lsdump_paths = collections.defaultdict(list)
     with open(lsdump_paths_file) as f:
-        for path in f.read().split(' '):
-            add_to_path_dict(path, lsdump_paths)
+        for path in f:
+            add_to_path_dict(path.rstrip(), lsdump_paths)
     return lsdump_paths
 
+
 def get_lib_arch_str(target):
-    assert(target.primary_arch != '')
+    assert target.primary_arch != ''
     target_arch_variant_str = ''
-    # if TARGET_ARCH == TARGET_ARCH_VARIANT, soong makes targetArchVariant empty
-    # this is the case for aosp_x86_64_ab and aosp_x86
+    # If TARGET_ARCH == TARGET_ARCH_VARIANT, soong makes targetArchVariant
+    # empty. This is the case for aosp_x86_64 and aosp_x86_ab.
     if target.arch_variant != target.arch:
         target_arch_variant_str = '_' + target.arch_variant
     return target.arch + target_arch_variant_str
 
 
+# FIXME (b/121986692): Before aosp/858259 is merged, apex mutator adds
+# `_platform` suffix if the module is used by some apex modules. This
+# workaround searches for lsdump with and without `_platform`.
+_WORKAROUND_APEX_PLATFORM_LSDUMPS = True
+
+if _WORKAROUND_APEX_PLATFORM_LSDUMPS:
+    def _find_lib_lsdumps_workaround(dir_name, lsdump_paths, libs):
+        dir_name_platform = dir_name + '_platform'
+
+        matched_lsdump_paths = set(find_lib_lsdumps(
+            dir_name, lsdump_paths, libs))
+
+        matched_lsdump_paths_platform = set(find_lib_lsdumps(
+            dir_name_platform, lsdump_paths, libs))
+
+        # Pick the lsdump file with latest modification time if both of them
+        # exist.
+        matched_lsdump_paths_replaced = set(
+            path.replace(dir_name, dir_name_platform)
+            for path in matched_lsdump_paths)
+
+        both = matched_lsdump_paths_replaced & matched_lsdump_paths_platform
+
+        for path_platform in both:
+            path = path_platform.replace(dir_name_platform, dir_name)
+            if os.stat(path).st_mtime >= os.stat(path_platform).st_mtime:
+                matched_lsdump_paths_platform.remove(path_platform)
+            else:
+                matched_lsdump_paths.remove(path)
+
+        return sorted(matched_lsdump_paths | matched_lsdump_paths_platform)
+
+
 def find_and_copy_lib_lsdumps(target, ref_dump_dir_stem, ref_dump_dir_insertion,
-                              core_or_vendor_shared_str, libs, lsdump_paths):
-    arch_lsdump_paths = find_lib_lsdumps(target.arch, target.arch_variant,
-                                         target.cpu_variant, lsdump_paths,
-                                         core_or_vendor_shared_str,
-                                         libs)
-    # Copy the contents of the lsdump into it's corresponding
-    # reference  directory.
+                              core_or_vendor_shared_str, libs, lsdump_paths,
+                              compress):
+    module_variant_dir_name = get_module_variant_dir_name(
+        target.arch, target.arch_variant, target.cpu_variant,
+        core_or_vendor_shared_str)
+
+    if _WORKAROUND_APEX_PLATFORM_LSDUMPS:
+        arch_lsdump_paths = _find_lib_lsdumps_workaround(
+            module_variant_dir_name, lsdump_paths, libs)
+    else:
+        arch_lsdump_paths = find_lib_lsdumps(
+            module_variant_dir_name, lsdump_paths, libs)
+
+    # Copy the contents of the lsdump into their corresponding reference ABI
+    # dumps directories.
     return copy_reference_dumps(arch_lsdump_paths, ref_dump_dir_stem,
                                 ref_dump_dir_insertion,
-                                get_lib_arch_str(target))
+                                get_lib_arch_str(target), compress)
 
-def choose_vndk_version(args_version, platform_vndk_version,
-                        board_vndk_version):
-    version = args_version
+
+def choose_vndk_version(version, platform_vndk_version, board_vndk_version):
     if version is None:
-        # This logic is to be kept in sync with the references directory logic
-        # in build/soong/library.go .
+        # This logic must be in sync with the logic for reference ABI dumps
+        # directory in `build/soong/cc/library.go`.
         version = platform_vndk_version
-        if board_vndk_version != 'current' and board_vndk_version != '':
+        if board_vndk_version not in ('current', ''):
             version = board_vndk_version
     return version
 
+
 def get_ref_dump_dir_stem(args, vndk_or_ndk, product, chosen_vndk_version):
     binder_bitness = '64'
     if get_build_vars_for_product(['BINDER32BIT'], product)[0] == 'true':
@@ -91,134 +139,179 @@
 
     return ref_dump_dir_stem
 
-def make_libs_for_product(libs, llndk_mode, product):
-    print('making libs for product:', product)
+
+def make_libs_for_product(libs, llndk_mode, product, variant):
+    print('making libs for', product + '-' + variant)
     if libs:
-        make_libraries(libs, product, llndk_mode)
+        make_libraries(libs, product, variant, llndk_mode)
     else:
-        make_tree(product)
+        make_tree(product, variant)
+
 
 def find_and_remove_path(root_path, file_name=None):
     if file_name is not None:
         root_path = os.path.join(root_path, 'source-based', file_name)
-    remove_cmd_str = 'rm -rf ' + root_path
-    print('removing', root_path)
-    subprocess.check_call(remove_cmd_str, shell=True)
+
+    if os.path.exists(root_path):
+        print('removing', root_path)
+        if os.path.isfile(root_path):
+            os.remove(root_path)
+        else:
+            shutil.rmtree(root_path)
+
 
 def remove_references_for_all_arches_and_variants(args, product, targets,
                                                   chosen_vndk_version):
-    print('Removing reference dumps...')
     libs = args.libs
     for target in targets:
-        if target.arch ==  '' or target.arch_variant == '':
+        if target.arch == '' or target.arch_variant == '':
             continue
+
         dir_to_remove_vndk = os.path.join(
-                get_ref_dump_dir_stem(args, 'vndk', product,
-                                      chosen_vndk_version),
-                get_lib_arch_str(target))
+            get_ref_dump_dir_stem(args, 'vndk', product, chosen_vndk_version),
+            get_lib_arch_str(target))
+
         dir_to_remove_ndk = os.path.join(
-                get_ref_dump_dir_stem(args, 'ndk', product,
-                                      chosen_vndk_version),
-                get_lib_arch_str(target))
+            get_ref_dump_dir_stem(args, 'ndk', product, chosen_vndk_version),
+            get_lib_arch_str(target))
 
         if libs:
             for lib in libs:
                 find_and_remove_path(dir_to_remove_vndk,
+                                     lib + SOURCE_ABI_DUMP_EXT)
+                find_and_remove_path(dir_to_remove_vndk,
                                      lib + COMPRESSED_SOURCE_ABI_DUMP_EXT)
                 find_and_remove_path(dir_to_remove_ndk,
+                                     lib + SOURCE_ABI_DUMP_EXT)
+                find_and_remove_path(dir_to_remove_ndk,
                                      lib + COMPRESSED_SOURCE_ABI_DUMP_EXT)
         else:
             find_and_remove_path(dir_to_remove_vndk)
             find_and_remove_path(dir_to_remove_ndk)
 
-def add_to_path_dict(path, dictionary, libs=[]):
+
+def add_to_path_dict(path, dictionary, libs=tuple()):
     name, lsdump_ext = os.path.splitext(path)
     sofile, so_ext = os.path.splitext(name)
     libname = os.path.basename(sofile)
     if lsdump_ext == SOURCE_ABI_DUMP_EXT_END and so_ext == SO_EXT:
-        if libs and (libname not in libs):
+        if libs and libname not in libs:
             return
-        if libname not in dictionary.keys():
-            dictionary[libname] = [path]
-        else:
-            dictionary[libname].append(path)
+        dictionary[libname].append(path)
+
 
 def search_for_lsdump_paths(soong_dir, libs):
-    lsdump_paths = dict()
-    for root, dirs, files in os.walk(soong_dir):
+    lsdump_paths = collections.defaultdict(list)
+    for root, _, files in os.walk(soong_dir):
         for file in files:
-          add_to_path_dict(os.path.join(root, file), lsdump_paths, libs)
+            add_to_path_dict(os.path.join(root, file), lsdump_paths, libs)
     return lsdump_paths
 
+
 def create_source_abi_reference_dumps(args, product,
                                       chosen_vndk_version, lsdump_paths,
                                       targets):
-    ref_dump_dir_stem_vndk =\
+    ref_dump_dir_stem_vndk = \
         get_ref_dump_dir_stem(args, 'vndk', product, chosen_vndk_version)
-    ref_dump_dir_stem_ndk =\
+    ref_dump_dir_stem_ndk = \
         get_ref_dump_dir_stem(args, 'ndk', product, chosen_vndk_version)
     ref_dump_dir_insertion = 'source-based'
+
     num_libs_copied = 0
+
     for target in targets:
-        if target.arch ==  '' or target.arch_variant == '':
+        if target.arch == '' or target.arch_variant == '':
             continue
+
         print('Creating dumps for target_arch:', target.arch, 'and variant ',
               target.arch_variant)
-        assert(target.primary_arch != '')
+        assert target.primary_arch != ''
+
         num_libs_copied += find_and_copy_lib_lsdumps(
             target, ref_dump_dir_stem_vndk, ref_dump_dir_insertion,
-            '_vendor_shared', args.libs, lsdump_paths)
+            '_vendor_shared', args.libs, lsdump_paths, args.compress)
 
         num_libs_copied += find_and_copy_lib_lsdumps(
             target, ref_dump_dir_stem_ndk, ref_dump_dir_insertion,
-            '_core_shared', args.libs, lsdump_paths)
+            '_core_shared', args.libs, lsdump_paths, args.compress)
 
     return num_libs_copied
 
 
-def main():
-    # Parse command line options.
-    assert 'ANDROID_BUILD_TOP' in os.environ
-    start = time.time()
-    parser = argparse.ArgumentParser()
-    parser.add_argument('--version', help='VNDK version')
-    parser.add_argument('--no-make-lib', help='no m -j lib.vendor while \
-                        creating reference', default=False, action='store_true')
-    parser.add_argument('--llndk', help='The libs specified by -l are llndk',
-                        default=False, action='store_true')
-    parser.add_argument('-libs', help='libs to create references for',
-                        action='append')
-    parser.add_argument('-products', help='products to create references for',
-                        action='append')
-    parser.add_argument('-ref-dump-dir',
-                        help='directory to copy reference abi dumps into',
-                        default=os.path.join(AOSP_DIR,'prebuilts/abi-dumps'))
-    args = parser.parse_args()
+def create_source_abi_reference_dumps_for_all_products(args):
+    """Create reference ABI dumps for all specified products."""
+
+    platform_vndk_version, board_vndk_version = get_build_vars_for_product(
+        ['PLATFORM_VNDK_VERSION', 'BOARD_VNDK_VERSION'])
+    chosen_vndk_version = choose_vndk_version(
+        args.version, platform_vndk_version, board_vndk_version)
+
     num_processed = 0
-    # Remove reference dumps specified by libs / all of them if none specified,
-    # so that we may build those libraries succesfully.
-    vndk_versions = get_build_vars_for_product(['PLATFORM_VNDK_VERSION',
-                                                'BOARD_VNDK_VERSION'])
-    platform_vndk_version = vndk_versions[0]
-    board_vndk_version = vndk_versions[1]
-    chosen_vndk_version = \
-        choose_vndk_version(args.version, platform_vndk_version,
-                           board_vndk_version)
-    if args.products is None:
-      args.products = PRODUCTS
+
     for product in args.products:
         targets = [Target(True, product), Target(False, product)]
-        remove_references_for_all_arches_and_variants(args, product, targets,
-                                                      chosen_vndk_version)
-        # make all the libs specified / the 'vndk' target if none specified
-        if (args.no_make_lib == False):
-            make_libs_for_product(args.libs, args.llndk, product)
+
+        # Remove reference ABI dumps specified in `args.libs` (or remove all of
+        # them if none of them are specified) so that we may build these
+        # libraries successfully.
+        remove_references_for_all_arches_and_variants(
+            args, product, targets, chosen_vndk_version)
+
+        if not args.no_make_lib:
+            # Build all the specified libs (or build the 'vndk' target if none
+            # of them are specified.)
+            make_libs_for_product(args.libs, args.llndk, product,
+                                  args.build_variant)
+
         lsdump_paths = get_lsdump_paths(product, args.libs)
         num_processed += create_source_abi_reference_dumps(
             args, product, chosen_vndk_version, lsdump_paths, targets)
-    print()
+
+    return num_processed
+
+
+def _parse_args():
+    """Parse the command line arguments."""
+
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--version', help='VNDK version')
+    parser.add_argument('--no-make-lib', action='store_true',
+                        help='no m -j lib.vendor while creating reference')
+    parser.add_argument('--llndk', action='store_true',
+                        help='The libs specified by -l are llndk')
+    parser.add_argument('-libs', action='append',
+                        help='libs to create references for')
+    parser.add_argument('-products', action='append',
+                        help='products to create references for')
+    parser.add_argument('--build-variant', default='userdebug',
+                        help='build variant to create references for')
+    parser.add_argument('--compress', action='store_true',
+                        help='compress reference dump with gzip')
+    parser.add_argument('-ref-dump-dir',
+                        help='directory to copy reference abi dumps into',
+                        default=PREBUILTS_ABI_DUMPS_DEFAULT)
+
+    args = parser.parse_args()
+
+    if args.products is None:
+        # If `args.products` is unspecified, generate reference ABI dumps for
+        # all products.
+        args.products = PRODUCTS_DEFAULT
+
+    return args
+
+
+def main():
+    args = _parse_args()
+
+    start = time.time()
+    num_processed = create_source_abi_reference_dumps_for_all_products(args)
     end = time.time()
+
+    print()
     print('msg: Processed', num_processed, 'libraries in ', (end - start) / 60,
           ' minutes')
+
+
 if __name__ == '__main__':
     main()
diff --git a/vndk/tools/header-checker/utils/utils.py b/vndk/tools/header-checker/utils/utils.py
index e37134d..db08558 100644
--- a/vndk/tools/header-checker/utils/utils.py
+++ b/vndk/tools/header-checker/utils/utils.py
@@ -1,19 +1,26 @@
 #!/usr/bin/env python3
 
-import tempfile
+import gzip
 import os
 import subprocess
-import gzip
-import shutil
-import time
+import sys
+import tempfile
+
 
 SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
-AOSP_DIR = os.getenv('ANDROID_BUILD_TOP')
+
+try:
+    AOSP_DIR = os.environ['ANDROID_BUILD_TOP']
+except KeyError:
+    print('error: ANDROID_BUILD_TOP environment variable is not set.',
+          file=sys.stderr)
+    sys.exit(1)
 
 BUILTIN_HEADERS_DIR = (
     os.path.join(AOSP_DIR, 'bionic', 'libc', 'include'),
     os.path.join(AOSP_DIR, 'external', 'libcxx', 'include'),
-    os.path.join(AOSP_DIR, 'prebuilts', 'sdk', 'renderscript', 'clang-include'),
+    os.path.join(AOSP_DIR, 'prebuilts', 'clang-tools', 'linux-x86',
+                 'clang-headers'),
 )
 
 EXPORTED_HEADERS_DIR = (
@@ -29,8 +36,9 @@
 
 DEFAULT_CPPFLAGS = ['-x', 'c++', '-std=c++11']
 DEFAULT_CFLAGS = ['-std=gnu99']
+DEFAULT_HEADER_FLAGS = ["-dump-function-declarations"]
+DEFAULT_FORMAT = 'ProtobufTextFormat'
 
-TARGET_ARCHS = ['arm', 'arm64', 'x86', 'x86_64', 'mips', 'mips64']
 
 def get_reference_dump_dir(reference_dump_dir_stem,
                            reference_dump_dir_insertion, lib_arch):
@@ -41,144 +49,165 @@
 
 
 def copy_reference_dumps(lib_paths, reference_dir_stem,
-                         reference_dump_dir_insertion, lib_arch):
+                         reference_dump_dir_insertion, lib_arch, compress):
     reference_dump_dir = get_reference_dump_dir(reference_dir_stem,
                                                 reference_dump_dir_insertion,
                                                 lib_arch)
     num_created = 0
     for lib_path in lib_paths:
-        copy_reference_dump(lib_path, reference_dump_dir)
+        copy_reference_dump(lib_path, reference_dump_dir, compress)
         num_created += 1
     return num_created
 
-def copy_reference_dump(lib_path, reference_dump_dir):
-    reference_dump_path = os.path.join(reference_dump_dir,
-                                       os.path.basename(lib_path)) + '.gz'
+
+def copy_reference_dump(lib_path, reference_dump_dir, compress):
+    reference_dump_path = os.path.join(
+        reference_dump_dir, os.path.basename(lib_path))
+    if compress:
+        reference_dump_path += '.gz'
     os.makedirs(os.path.dirname(reference_dump_path), exist_ok=True)
     output_content = read_output_content(lib_path, AOSP_DIR)
-    with gzip.open(reference_dump_path, 'wb') as f:
-        f.write(bytes(output_content, 'utf-8'))
-    print('Created abi dump at ', reference_dump_path)
+    if compress:
+        with gzip.open(reference_dump_path, 'wb') as f:
+            f.write(bytes(output_content, 'utf-8'))
+    else:
+        with open(reference_dump_path, 'wb') as f:
+            f.write(bytes(output_content, 'utf-8'))
+    print('Created abi dump at', reference_dump_path)
     return reference_dump_path
 
-def copy_reference_dump_content(lib_name, output_content,
-                                reference_dump_dir_stem,
-                                reference_dump_dir_insertion, lib_arch):
-    reference_dump_dir = get_reference_dump_dir(reference_dump_dir_stem,
-                                                reference_dump_dir_insertion,
-                                                lib_arch)
-    reference_dump_path = os.path.join(reference_dump_dir,
-                                       lib_name + SOURCE_ABI_DUMP_EXT)
-    os.makedirs(os.path.dirname(reference_dump_path), exist_ok=True)
-    with open(reference_dump_path, 'w') as f:
-        f.write(output_content)
-
-    print('Created abi dump at ', reference_dump_path)
-    return reference_dump_path
 
 def read_output_content(output_path, replace_str):
     with open(output_path, 'r') as f:
         return f.read().replace(replace_str, '')
 
-def run_header_abi_dumper(input_path, remove_absolute_paths, cflags=[],
-                          export_include_dirs = EXPORTED_HEADERS_DIR):
+
+def run_header_abi_dumper(input_path, cflags=tuple(),
+                          export_include_dirs=EXPORTED_HEADERS_DIR,
+                          flags=tuple()):
+    """Run header-abi-dumper to dump ABI from `input_path` and return the
+    output."""
     with tempfile.TemporaryDirectory() as tmp:
         output_path = os.path.join(tmp, os.path.basename(input_path)) + '.dump'
         run_header_abi_dumper_on_file(input_path, output_path,
-                                      export_include_dirs, cflags)
-        with open(output_path, 'r') as f:
-            if remove_absolute_paths:
-                return read_output_content(output_path, AOSP_DIR)
-            else:
-                return f.read()
+                                      export_include_dirs, cflags, flags)
+        return read_output_content(output_path, AOSP_DIR)
+
 
 def run_header_abi_dumper_on_file(input_path, output_path,
-                                  export_include_dirs = [], cflags =[]):
-    input_name, input_ext = os.path.splitext(input_path)
-    cmd = ['header-abi-dumper', '-o', output_path, input_path,]
+                                  export_include_dirs=tuple(), cflags=tuple(),
+                                  flags=tuple()):
+    """Run header-abi-dumper to dump ABI from `input_path` and the output is
+    written to `output_path`."""
+    input_ext = os.path.splitext(input_path)[1]
+    cmd = ['header-abi-dumper', '-o', output_path, input_path]
     for dir in export_include_dirs:
         cmd += ['-I', dir]
+    cmd += flags
+    if '-output-format' not in flags:
+        cmd += ['-output-format', DEFAULT_FORMAT]
+    if input_ext == ".h":
+        cmd += DEFAULT_HEADER_FLAGS
     cmd += ['--']
     cmd += cflags
-    if input_ext == '.cpp' or input_ext == '.cc' or input_ext == '.h':
+    if input_ext in ('.cpp', '.cc', '.h'):
         cmd += DEFAULT_CPPFLAGS
     else:
         cmd += DEFAULT_CFLAGS
 
     for dir in BUILTIN_HEADERS_DIR:
         cmd += ['-isystem', dir]
-    # export includes imply local includes
+    # The export include dirs imply local include dirs.
     for dir in export_include_dirs:
         cmd += ['-I', dir]
     subprocess.check_call(cmd)
 
-def run_header_abi_linker(output_path, inputs, version_script, api, arch):
-    """Link inputs, taking version_script into account"""
-    with tempfile.TemporaryDirectory() as tmp:
-        cmd = ['header-abi-linker', '-o', output_path, '-v', version_script,
-               '-api', api, '-arch', arch]
-        cmd += inputs
-        subprocess.check_call(cmd)
-        with open(output_path, 'r') as f:
-            return read_output_content(output_path, AOSP_DIR)
 
-def make_tree(product):
+def run_header_abi_linker(output_path, inputs, version_script, api, arch,
+                          flags=tuple()):
+    """Link inputs, taking version_script into account"""
+    cmd = ['header-abi-linker', '-o', output_path, '-v', version_script,
+           '-api', api, '-arch', arch]
+    cmd += flags
+    if '-input-format' not in flags:
+        cmd += ['-input-format', DEFAULT_FORMAT]
+    if '-output-format' not in flags:
+        cmd += ['-output-format', DEFAULT_FORMAT]
+    cmd += inputs
+    subprocess.check_call(cmd)
+    return read_output_content(output_path, AOSP_DIR)
+
+
+def make_tree(product, variant):
     # To aid creation of reference dumps.
     make_cmd = ['build/soong/soong_ui.bash', '--make-mode', '-j',
-                'vndk', 'findlsdumps', 'TARGET_PRODUCT=' + product]
+                'vndk', 'findlsdumps', 'TARGET_PRODUCT=' + product,
+                'TARGET_BUILD_VARIANT=' + variant]
     subprocess.check_call(make_cmd, cwd=AOSP_DIR)
 
-def make_targets(targets, product):
-    make_cmd = ['build/soong/soong_ui.bash', '--make-mode', '-j']
-    for target in targets:
-        make_cmd.append(target)
-    make_cmd.append('TARGET_PRODUCT=' + product)
+
+def make_targets(targets, product, variant):
+    make_cmd = ['build/soong/soong_ui.bash', '--make-mode', '-j',
+                'TARGET_PRODUCT=' + product, 'TARGET_BUILD_VARIANT=' + variant]
+    make_cmd += targets
     subprocess.check_call(make_cmd, cwd=AOSP_DIR, stdout=subprocess.DEVNULL,
                           stderr=subprocess.STDOUT)
 
-def make_libraries(libs, product, llndk_mode):
+
+def make_libraries(libs, product, variant, llndk_mode):
     # To aid creation of reference dumps. Makes lib.vendor for the current
     # configuration.
     lib_targets = []
     for lib in libs:
         lib = lib if llndk_mode else lib + VENDOR_SUFFIX
         lib_targets.append(lib)
-    make_targets(lib_targets, product)
+    make_targets(lib_targets, product, variant)
 
-def find_lib_lsdumps(target_arch, target_arch_variant,
-                     target_cpu_variant, lsdump_paths,
-                     core_or_vendor_shared_str, libs):
-    """ Find the lsdump corresponding to lib_name for the given arch parameters
-        if it exists"""
-    assert 'ANDROID_PRODUCT_OUT' in os.environ
-    cpu_variant = '_' + target_cpu_variant
-    arch_variant = '_' + target_arch_variant
-    arch_lsdump_paths = []
-    if target_cpu_variant == 'generic' or target_cpu_variant is None or\
-        target_cpu_variant == '':
-        cpu_variant = ''
-    if target_arch_variant == target_arch or target_arch_variant is None or\
-        target_arch_variant == '':
+
+def get_module_variant_dir_name(arch, arch_variant, cpu_variant,
+                                variant_suffix):
+    """Create module variant directory name from the target architecture, the
+    target architecture variant, the target CPU variant, and a variant suffix
+    (e.g. `_core_shared`, `_vendor_shared`, etc)."""
+
+    if not arch_variant or arch_variant == arch:
         arch_variant = ''
+    else:
+        arch_variant = '_' + arch_variant
 
-    target_dir = 'android_' + target_arch + arch_variant +\
-        cpu_variant + core_or_vendor_shared_str
-    for key, value in lsdump_paths.items():
-      if libs and key not in libs:
-          continue
-      for path in lsdump_paths[key]:
-          if target_dir in path:
-              arch_lsdump_paths.append(os.path.join(AOSP_DIR, path.strip()))
-    return arch_lsdump_paths
+    if not cpu_variant or cpu_variant == 'generic':
+        cpu_variant = ''
+    else:
+        cpu_variant = '_' + cpu_variant
+
+    return 'android_' + arch + arch_variant + cpu_variant + variant_suffix
+
+
+def find_lib_lsdumps(module_variant_dir_name, lsdump_paths, libs):
+    """Find the lsdump corresponding to lib_name for the given module variant
+    if it exists."""
+    result = []
+    for lib_name, paths in lsdump_paths.items():
+        if libs and lib_name not in libs:
+            continue
+        for path in paths:
+            if module_variant_dir_name in path.split(os.path.sep):
+                result.append(os.path.join(AOSP_DIR, path.strip()))
+    return result
+
 
 def run_abi_diff(old_test_dump_path, new_test_dump_path, arch, lib_name,
-                 flags=[]):
+                 flags=tuple()):
     abi_diff_cmd = ['header-abi-diff', '-new', new_test_dump_path, '-old',
-                     old_test_dump_path, '-arch', arch, '-lib', lib_name]
+                    old_test_dump_path, '-arch', arch, '-lib', lib_name]
     with tempfile.TemporaryDirectory() as tmp:
         output_name = os.path.join(tmp, lib_name) + '.abidiff'
         abi_diff_cmd += ['-o', output_name]
         abi_diff_cmd += flags
+        if '-input-format-old' not in flags:
+            abi_diff_cmd += ['-input-format-old', DEFAULT_FORMAT]
+        if '-input-format-new' not in flags:
+            abi_diff_cmd += ['-input-format-new', DEFAULT_FORMAT]
         try:
             subprocess.check_call(abi_diff_cmd)
         except subprocess.CalledProcessError as err:
@@ -187,25 +216,34 @@
     return 0
 
 
-def get_build_vars_for_product(names, product=None):
-    build_vars_list = []
+def get_build_vars_for_product(names, product=None, variant=None):
     """ Get build system variable for the launched target."""
+
     if product is None and 'ANDROID_PRODUCT_OUT' not in os.environ:
         return None
-    cmd = ''
-    if product is not None:
-        cmd += 'source build/envsetup.sh>/dev/null && lunch>/dev/null ' + product + '&&'
-    cmd += ' build/soong/soong_ui.bash --dumpvars-mode -vars \"'
-    for name in names:
-        cmd += name + ' '
-    cmd += '\"'
+
+    env = os.environ.copy()
+    if product:
+        env['TARGET_PRODUCT'] = product
+    if variant:
+        env['TARGET_BUILD_VARIANT'] = variant
+    cmd = [
+        os.path.join('build', 'soong', 'soong_ui.bash'),
+        '--dumpvars-mode', '-vars', ' '.join(names),
+    ]
 
     proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
-                            stderr=subprocess.DEVNULL, cwd=AOSP_DIR, shell=True)
+                            stderr=subprocess.PIPE, cwd=AOSP_DIR, env=env)
     out, err = proc.communicate()
 
-    build_vars = out.decode('utf-8').strip().split('\n')
+    if proc.returncode != 0:
+        print("error: %s" % err.decode('utf-8'), file=sys.stderr)
+        return None
+
+    build_vars = out.decode('utf-8').strip().splitlines()
+
+    build_vars_list = []
     for build_var in build_vars:
-      key, _, value = build_var.partition('=')
-      build_vars_list.append(value.replace('\'', ''))
+        value = build_var.partition('=')[2]
+        build_vars_list.append(value.replace('\'', ''))
     return build_vars_list
diff --git a/vndk/tools/sourcedr/Documentation/list-installed-files-from-source-dirs.md b/vndk/tools/sourcedr/Documentation/list-installed-files-from-source-dirs.md
new file mode 100644
index 0000000..5b1d62a
--- /dev/null
+++ b/vndk/tools/sourcedr/Documentation/list-installed-files-from-source-dirs.md
@@ -0,0 +1,100 @@
+List Installed Files from Source Directories
+============================================
+
+`list_installed_file_from_source.py` helps users to list the vendor source
+files or vendor prebuilts that will be installed into the system image.
+
+This tool lists all *possible* file that *may* be installed to the system
+image.  Some listed files are not actually installed because they are not
+specified in `PRODUCT_PACKAGES`.
+
+
+## Usage
+
+First, build an Android target:
+
+```
+lunch aosp_sailfish-userdebug
+make -j8
+```
+
+Then, in `${ANDROID_BUILD_TOP}`, run `list_installed_file_from_source.py`:
+
+```
+./development/vndk/tools/sourcedr/sourcedr/list_installed_file_from_source.py \
+    out/combined-sailfish.ninja \
+    --ninja-deps out/.ninja_deps \
+    | tee files.txt
+```
+
+Be patient.  It may take for 3-5 mintues.
+
+
+## Re-use the Parsed Dependency Graph
+
+`list_installed_file_from_source.py` spends a lot of time parsing ninja
+files.  It is desirable to keep the parsed dependency graph for further
+investigation.  You can create a parsed dependency graph with:
+
+```
+./development/vndk/tools/sourcedr/sourcedr/ninja.py pickle \
+    out/combined-sailfish.ninja \
+    --ninja-deps out/.ninja_deps \
+    -o sailfish.pickle
+```
+
+And then, load dependency graph with:
+
+```
+./development/vndk/tools/sourcedr/sourcedr/list_installed_file_from_source.py \
+    sailfish.pickle
+```
+
+
+## Filters
+
+By default, `list_installed_file_from_source.py` lists the files that are from
+`device` or `vendor` directories and installed to the system partition.  This
+can be tweaked with `--installed-filter` and `--source-filter`:
+
+* `--installed-filter` filters the paths of the files that may be installed to
+  the device.  The specified path must be relative to the file system root of
+  the device.  The default value is `system`.
+
+* `--source-filter` filters the paths of the source files.  The paths must be
+  relative to Android source tree root (i.e. `${ANDROID_BUILD_TOP}`).  Multiple
+  paths may be specified and separated by semicolons.  The default value is
+  `device:vendor`.
+
+
+### Examples
+
+List the files from `device/google` and installed to `/system`:
+
+```
+./development/vndk/tools/sourcedr/sourcedr/list_installed_file_from_source.py \
+    sailfish.pickle \
+    --source-filter device/google \
+    --installed-filter system
+```
+
+
+List the files from `device/google` and installed into `/system/lib64` with:
+
+```
+./development/vndk/tools/sourcedr/sourcedr/list_installed_file_from_source.py \
+    sailfish.pickle \
+    --source-filter device/google \
+    --installed-filter system/lib64
+```
+
+
+List the files from `frameworks/base` or `frameworks/native` and installed
+into `/system/lib` or `/system/lib64` with:
+
+```
+./development/vndk/tools/sourcedr/sourcedr/list_installed_file_from_source.py \
+    sailfish.pickle \
+    --source-filter frameworks/base:frameworks/native \
+    --installed-filter system/lib:system/lib64
+```
diff --git a/vndk/tools/sourcedr/OWNERS b/vndk/tools/sourcedr/OWNERS
new file mode 100644
index 0000000..402c928
--- /dev/null
+++ b/vndk/tools/sourcedr/OWNERS
@@ -0,0 +1,2 @@
+andrewhsieh@google.com
+loganchien@google.com
diff --git a/vndk/tools/sourcedr/README.md b/vndk/tools/sourcedr/README.md
index da9ed79..cdf8b1f 100644
--- a/vndk/tools/sourcedr/README.md
+++ b/vndk/tools/sourcedr/README.md
@@ -1,64 +1,10 @@
-# Source Deps Reviewer
+# Source Dr.
 
-## Synopsis
+This is a collection of source tree analysis tools.
 
-This is a tool for labeling dependencies with a web interface.
-
-Basically, it greps the specified directory for the given pattern,
-and let human reviewers label their dependencies, even code dependencies,
-which are code segments that are highly related to the specific pattern.
-
-## Installation and Dependencies
-
-This tool depends on [codesearch](https://github.com/google/codesearch)
-to generate regular expression index, please install them with:
-
-```
-$ go get github.com/google/codesearch/cmd/cindex
-$ go get github.com/google/codesearch/cmd/csearch
-```
-
-This tool depends on several Python packages,
-
-```
-$ pip install -e .
-```
-
-To run functional test, please do
-
-```
-$ pip install -e .[dev]
-```
-
-Prism, a code syntax highlighter is used.
-It can be found at https://github.com/PrismJS/prism
-
-## Usage
-
-Initialize a project:
-
-```
-sourcedr init --source-dir [android-src] [project-dir]
-```
-
-Scan the codebase:
-
-```
-sourcedr scan
-```
-
-If there are occurrences that are not reviewed, then review the occurrences
-with:
-
-```
-sourcedr review
-```
-
-Open browser and visit [http://localhost:5000](http://localhost:5000).
-
-
-## Testing
-
-```
-$ python3 sourcedr/functional_tests.py
-```
+- [blueprint](blueprint) analyzes Android.bp and the dependencies between the
+  modules.
+- [ninja](ninja) analyzes `$(OUT)/combined-${target}.ninja`, which contains all
+  file dependencies.
+- [files/list_app_shared_uid.py](files/list_app_shared_uid.py) lists all
+  pre-installed apps with `sharedUserId`.
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/.gitignore b/vndk/tools/sourcedr/blueprint/.gitignore
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/blueprint/.gitignore
rename to vndk/tools/sourcedr/blueprint/.gitignore
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/.pylintrc b/vndk/tools/sourcedr/blueprint/.pylintrc
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/blueprint/.pylintrc
rename to vndk/tools/sourcedr/blueprint/.pylintrc
diff --git a/vndk/tools/sourcedr/blueprint/analyze_manifest_split.py b/vndk/tools/sourcedr/blueprint/analyze_manifest_split.py
new file mode 100755
index 0000000..2160fc8
--- /dev/null
+++ b/vndk/tools/sourcedr/blueprint/analyze_manifest_split.py
@@ -0,0 +1,201 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from __future__ import print_function
+
+import argparse
+import collections
+import os
+import re
+import sys
+import xml.dom.minidom
+
+from blueprint import RecursiveParser, evaluate_defaults, fill_module_namespaces
+
+
+_GROUPS = ['system_only', 'vendor_only', 'both']
+
+
+def parse_manifest_xml(manifest_path):
+    """Build a dictionary that maps directories into projects."""
+    dir_project_dict = {}
+    parsed_xml = xml.dom.minidom.parse(manifest_path)
+    projects = parsed_xml.getElementsByTagName('project')
+    for project in projects:
+        name = project.getAttribute('name')
+        path = project.getAttribute('path')
+        if path:
+            dir_project_dict[path] = name
+        else:
+            dir_project_dict[name] = name
+    return dir_project_dict
+
+
+class DirProjectMatcher(object):
+    def __init__(self, dir_project_dict):
+        self._projects = sorted(dir_project_dict.items(), reverse=True)
+        self._matcher = re.compile(
+            '|'.join('(' + re.escape(path) + '(?:/|$))'
+                     for path, project in self._projects))
+
+    def find(self, path):
+        match = self._matcher.match(path)
+        if match:
+            return self._projects[match.lastindex - 1][1]
+        return None
+
+
+def parse_blueprint(root_bp_path):
+    """Parse Android.bp files."""
+    parser = RecursiveParser()
+    parser.parse_file(root_bp_path)
+    parsed_items = evaluate_defaults(parser.modules)
+    return fill_module_namespaces(root_bp_path, parsed_items)
+
+
+def _get_property(attrs, *names, **kwargs):
+    try:
+        result = attrs
+        for name in names:
+            result = result[name]
+        return result
+    except KeyError:
+        return kwargs.get('default', None)
+
+
+class GitProject(object):
+    def __init__(self):
+        self.system_only = set()
+        self.vendor_only = set()
+        self.both = set()
+
+    def add_module(self, path, rule, attrs):
+        name = _get_property(attrs, 'name')
+        ent = (rule, path, name)
+
+        if rule in {'llndk_library', 'hidl_interface'}:
+            self.both.add(ent)
+        elif rule.endswith('_binary') or \
+             rule.endswith('_library') or \
+             rule.endswith('_library_shared') or \
+             rule.endswith('_library_static') or \
+             rule.endswith('_headers'):
+            if _get_property(attrs, 'vendor') or \
+               _get_property(attrs, 'proprietary') or \
+               _get_property(attrs, 'soc_specific') or \
+               _get_property(attrs, 'device_specific'):
+                self.vendor_only.add(ent)
+            elif _get_property(attrs, 'vendor_available') or \
+                 _get_property(attrs, 'vndk', 'enabled'):
+                self.both.add(ent)
+            else:
+                self.system_only.add(ent)
+
+    def __repr__(self):
+        return ('GitProject(' +
+                'system_only=' + repr(self.system_only) + ', '
+                'vendor_only=' + repr(self.vendor_only) + ', '
+                'both=' + repr(self.both) + ')')
+
+
+def _parse_args():
+    parser = argparse.ArgumentParser()
+    parser.add_argument('-b', '--blueprint', required=True,
+                        help='Path to root Android.bp')
+    parser.add_argument('-m', '--manifest', required=True,
+                        help='Path to repo manifest xml file')
+    group = parser.add_mutually_exclusive_group()
+    group.add_argument('--skip-no-overlaps', action='store_true',
+                       help='Skip projects without overlaps')
+    group.add_argument('--has-group', choices=_GROUPS,
+                       help='List projects that some modules are in the group')
+    group.add_argument('--only-has-group', choices=_GROUPS,
+                       help='List projects that all modules are in the group')
+    group.add_argument('--without-group', choices=_GROUPS,
+                       help='List projects that no modules are in the group')
+    return parser.parse_args()
+
+
+def _dump_module_set(name, modules):
+    if not modules:
+        return
+    print('\t' + name)
+    for rule, path, name in sorted(modules):
+        print('\t\t' + rule, path, name)
+
+
+def main():
+    args = _parse_args()
+
+    # Load repo manifest xml file
+    dir_matcher = DirProjectMatcher(parse_manifest_xml(args.manifest))
+
+    # Classify Android.bp modules
+    git_projects = collections.defaultdict(GitProject)
+
+    root_dir = os.path.dirname(os.path.abspath(args.blueprint))
+    root_prefix_len = len(root_dir) + 1
+
+    has_error = False
+
+    for rule, attrs in parse_blueprint(args.blueprint):
+        path = _get_property(attrs, '_path')[root_prefix_len:]
+        project = dir_matcher.find(path)
+        if project is None:
+            print('error: Path {!r} does not belong to any git projects.'
+                  .format(path), file=sys.stderr)
+            has_error = True
+            continue
+        git_projects[project].add_module(path, rule, attrs)
+
+    # Print output
+    total_projects = 0
+    for project, modules in sorted(git_projects.items()):
+        if args.skip_no_overlaps:
+            if (int(len(modules.system_only) > 0) +
+                int(len(modules.vendor_only) > 0) +
+                int(len(modules.both) > 0)) <= 1:
+                continue
+        elif args.has_group:
+            if not getattr(modules, args.has_group):
+                continue
+        elif args.only_has_group:
+            if any(getattr(modules, group)
+                   for group in _GROUPS if group != args.only_has_group):
+                continue
+            if not getattr(modules, args.only_has_group):
+                continue
+        elif args.without_group:
+            if getattr(modules, args.without_group):
+                continue
+
+        print(project, len(modules.system_only), len(modules.vendor_only),
+              len(modules.both))
+        _dump_module_set('system_only', modules.system_only)
+        _dump_module_set('vendor_only', modules.vendor_only)
+        _dump_module_set('both', modules.both)
+
+        total_projects += 1
+
+    print('Total:', total_projects)
+
+    if has_error:
+        sys.exit(2)
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/blueprint.py b/vndk/tools/sourcedr/blueprint/blueprint.py
similarity index 94%
rename from vndk/tools/sourcedr/sourcedr/blueprint/blueprint.py
rename to vndk/tools/sourcedr/blueprint/blueprint.py
index 77f463d..e418270 100755
--- a/vndk/tools/sourcedr/sourcedr/blueprint/blueprint.py
+++ b/vndk/tools/sourcedr/blueprint/blueprint.py
@@ -133,7 +133,7 @@
 class Lexer(object):
     """Lexer to tokenize the input string."""
 
-    def __init__(self, buf, offset=0):
+    def __init__(self, buf, offset=0, path=None):
         """Tokenize the source code in buf starting from offset.
 
         Args:
@@ -147,6 +147,7 @@
         self.end = offset
         self.token = None
         self.literal = None
+        self.path = path
 
         self._next()
 
@@ -623,6 +624,7 @@
     def parse_module_definition(self, module_ident):
         """Parse a module definition."""
         properties = self.parse_dict()
+        properties['_path'] = String(self.lexer.path)
         self.modules.append((module_ident, properties))
 
 
@@ -750,7 +752,13 @@
     """This is a recursive parser which will parse blueprint files
     recursively."""
 
+
+    # Default Blueprint file name
+    _DEFAULT_SUB_NAME = 'Android.bp'
+
+
     def __init__(self):
+        """Initialize a recursive parser."""
         self.visited = set()
         self.modules = []
 
@@ -772,7 +780,7 @@
 
     @classmethod
     def find_sub_files_from_env(cls, rootdir, env, use_subdirs,
-                                default_sub_name='Android.bp'):
+                                default_sub_name=_DEFAULT_SUB_NAME):
         """Find the sub files from the names specified in build, subdirs, and
         optional_subdirs."""
 
@@ -800,7 +808,7 @@
         """Read a blueprint file and return modules and the environment."""
         with open(path, 'r') as bp_file:
             content = bp_file.read()
-        parser = Parser(Lexer(content), env)
+        parser = Parser(Lexer(content, path=path), env)
         parser.parse()
         return (parser.modules, parser.vars)
 
@@ -817,7 +825,7 @@
     def _parse_file_recursive(self, path, env, evaluate, use_subdirs):
         """Parse a blueprint file and recursively."""
 
-        self.visited.add(os.path.abspath(path))
+        self.visited.add(path)
 
         sub_env = self._parse_file(path, env, evaluate)
 
@@ -831,7 +839,7 @@
         sub_env.pop('optional_subdirs', None)
 
         for sub_file_path in sub_file_paths:
-            if os.path.abspath(sub_file_path) not in self.visited:
+            if sub_file_path not in self.visited:
                 self._parse_file_recursive(sub_file_path, sub_env, evaluate,
                                            use_subdirs)
         return sub_env
@@ -841,6 +849,8 @@
         """Scan all files with the specified name and parse them."""
 
         rootdir = os.path.dirname(path)
+        assert rootdir, 'rootdir is empty but must be non-empty'
+
         envs = [(rootdir, env)]
         assert env is not None
 
@@ -873,19 +883,22 @@
                     pass
 
 
-    def parse_file(self, path, env=None, evaluate=True):
+    def parse_file(self, path, env=None, evaluate=True,
+                   default_sub_name=_DEFAULT_SUB_NAME):
         """Parse blueprint files recursively."""
 
         if env is None:
             env = {}
 
+        path = os.path.abspath(path)
+
         sub_env = self._read_file(path, env)[1]
 
         if 'subdirs' in sub_env or 'optional_subdirs' in sub_env:
             self._parse_file_recursive(path, env, evaluate, True)
         else:
-            self._scan_and_parse_all_file_recursive('Android.bp', path, env,
-                                                    evaluate)
+            self._scan_and_parse_all_file_recursive(
+                default_sub_name, path, env, evaluate)
 
 
 #------------------------------------------------------------------------------
@@ -952,3 +965,31 @@
             attrs = evaluate_default(attrs, named_modules[default][1])
         modules[i] = (ident, attrs)
     return modules
+
+
+def fill_module_namespaces(root_bp, modules):
+    """Collect soong_namespace definition and set a `_namespace` property to
+    each module definitions."""
+
+    # Collect all namespaces
+    rootdir = os.path.dirname(os.path.abspath(root_bp))
+    namespaces = {rootdir}
+    for ident, attrs in modules:
+        if ident == 'soong_namespace':
+            namespaces.add(os.path.dirname(attrs['_path']))
+
+    # Build a path matcher for module namespaces
+    namespaces = sorted(namespaces, reverse=True)
+    path_matcher = re.compile(
+        '|'.join('(' + re.escape(x) + '/.*)' for x in namespaces))
+
+    # Trim the root directory prefix
+    rootdir_prefix_len = len(rootdir) + 1
+    namespaces = [path[rootdir_prefix_len:] for path in namespaces]
+
+    # Fill in module namespaces
+    for ident, attrs in modules:
+        match = path_matcher.match(attrs['_path'])
+        attrs['_namespace'] = namespaces[match.lastindex - 1]
+
+    return modules
diff --git a/vndk/tools/sourcedr/blueprint/check_vndk_dep.py b/vndk/tools/sourcedr/blueprint/check_vndk_dep.py
new file mode 100755
index 0000000..a67c3a3
--- /dev/null
+++ b/vndk/tools/sourcedr/blueprint/check_vndk_dep.py
@@ -0,0 +1,122 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""This script scans all Android.bp in an android source tree and check the
+correctness of dependencies."""
+
+from __future__ import print_function
+
+import argparse
+import itertools
+import sys
+
+import vndk
+
+
+def _check_module_deps(all_libs, llndk_libs, module):
+    """Check the dependencies of a module."""
+
+    bad_deps = set()
+    shared_deps, static_deps, header_deps = module.get_dependencies()
+
+    # Check vendor module dependencies requirements.
+    for dep_name in itertools.chain(shared_deps, static_deps, header_deps):
+        if dep_name in llndk_libs:
+            continue
+        dep_module = all_libs[dep_name]
+        if dep_module.is_vendor():
+            continue
+        if dep_module.is_vendor_available():
+            continue
+        if dep_module.is_vndk():
+            # dep_module is a VNDK-Private module.
+            if not module.is_vendor():
+                # VNDK-Core may link to VNDK-Private.
+                continue
+        bad_deps.add(dep_name)
+
+    # Check VNDK dependencies requirements.
+    if module.is_vndk() and not module.is_vendor():
+        is_vndk_sp = module.is_vndk_sp()
+        for dep_name in shared_deps:
+            if dep_name in llndk_libs:
+                continue
+            dep_module = all_libs[dep_name]
+            if not dep_module.is_vndk():
+                # VNDK must be self-contained.
+                bad_deps.add(dep_name)
+                break
+            if is_vndk_sp and not dep_module.is_vndk_sp():
+                # VNDK-SP must be self-contained.
+                bad_deps.add(dep_name)
+                break
+
+    return bad_deps
+
+
+def _check_modules_deps(module_dicts):
+    """Check the dependencies of modules."""
+
+    all_libs = module_dicts.all_libs
+    llndk_libs = module_dicts.llndk_libs
+
+    # Check the dependencies of modules
+    all_bad_deps = []
+    for name, module in all_libs.items():
+        if not module.has_vendor_variant() and not module.is_vendor():
+            continue
+
+        bad_deps = _check_module_deps(all_libs, llndk_libs, module)
+
+        if bad_deps:
+            all_bad_deps.append((name, sorted(bad_deps)))
+
+    return sorted(all_bad_deps)
+
+
+def _parse_args():
+    """Parse command line options."""
+    parser = argparse.ArgumentParser()
+    parser.add_argument('root_bp',
+                        help='path to Android.bp in ANDROID_BUILD_TOP')
+    parser.add_argument('--namespace', action='append', default=[''],
+                        help='extra module namespaces')
+    return parser.parse_args()
+
+
+def main():
+    """Main function."""
+
+    args = _parse_args()
+
+    module_dicts = vndk.ModuleClassifier.create_from_root_bp(
+        args.root_bp, args.namespace)
+
+    all_bad_deps = _check_modules_deps(module_dicts)
+    for name, bad_deps in all_bad_deps:
+        print('ERROR: {!r} must not depend on {}'.format(name, bad_deps),
+              file=sys.stderr)
+
+    if all_bad_deps:
+        # Note: Exit with 2 so that it is easier to distinguish bad
+        # dependencies from unexpected Python exceptions.
+        sys.exit(2)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/blueprint/list_vndk_module.py b/vndk/tools/sourcedr/blueprint/list_vndk_module.py
new file mode 100755
index 0000000..18fe613
--- /dev/null
+++ b/vndk/tools/sourcedr/blueprint/list_vndk_module.py
@@ -0,0 +1,102 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from __future__ import print_function
+
+import argparse
+import csv
+import itertools
+import os
+import re
+import sys
+
+import vndk
+
+
+def _parse_args():
+    """Parse command line options."""
+    parser = argparse.ArgumentParser()
+    parser.add_argument('root_bp',
+                        help='path to Android.bp in ANDROID_BUILD_TOP')
+    parser.add_argument('-o', '--output', help='path to output file')
+    parser.add_argument('--exclude',
+                        help='regular expression for the excluded directories')
+    parser.add_argument('--select',
+                        help='regular expression for the selected directories')
+    parser.add_argument('--namespace', action='append', default=[''],
+                        help='extra module namespaces')
+    return parser.parse_args()
+
+
+def print_vndk_module_csv(output_file, module_dicts, root_dir, exclude, select):
+    """Print vndk module list to output file."""
+
+    all_libs = module_dicts.all_libs
+    vndk_libs = module_dicts.vndk_libs
+    vndk_sp_libs = module_dicts.vndk_sp_libs
+    vendor_available_libs = module_dicts.vendor_available_libs
+
+    module_names = sorted(set(
+        itertools.chain(vndk_libs, vndk_sp_libs, vendor_available_libs)))
+
+    root_dir_prefix_len = len(root_dir) + 1
+
+    writer = csv.writer(output_file, lineterminator='\n')
+    writer.writerow(('name', 'vndk', 'vndk_sp', 'vendor_available', 'rule'))
+    for name in module_names:
+        rule = all_libs[name].rule
+        path = all_libs[name].get_property('_path')[root_dir_prefix_len:]
+        if select and not select.match(path):
+            continue
+        if exclude and exclude.match(path):
+            continue
+        if '_header' not in rule and '_static' not in rule and \
+                rule != 'toolchain_library':
+            writer.writerow((name,
+                             name in vndk_libs,
+                             name in vndk_sp_libs,
+                             name in vendor_available_libs,
+                             rule))
+
+
+def main():
+    """Main function."""
+
+    args = _parse_args()
+
+    # Convert select/exclude regular expressions
+    select = re.compile(args.select) if args.select else None
+    exclude = re.compile(args.exclude) if args.exclude else None
+
+    # Parse Blueprint files and get VNDK libs
+    module_dicts = vndk.ModuleClassifier.create_from_root_bp(
+        args.root_bp, args.namespace)
+
+    root_dir = os.path.dirname(args.root_bp)
+
+    if args.output:
+        with open(args.output, 'w') as output_file:
+            print_vndk_module_csv(
+                output_file, module_dicts, root_dir, exclude, select)
+    else:
+        print_vndk_module_csv(
+            sys.stdout, module_dicts, root_dir, exclude, select)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/tests/__init__.py b/vndk/tools/sourcedr/blueprint/tests/__init__.py
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/blueprint/tests/__init__.py
rename to vndk/tools/sourcedr/blueprint/tests/__init__.py
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh b/vndk/tools/sourcedr/blueprint/tests/run_tests.sh
similarity index 96%
rename from vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
rename to vndk/tools/sourcedr/blueprint/tests/run_tests.sh
index bc94afc..3a31145 100755
--- a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
+++ b/vndk/tools/sourcedr/blueprint/tests/run_tests.sh
@@ -16,5 +16,7 @@
 # limitations under the License.
 #
 
+cd "$(dirname "$0")/.."
+
 python3 -m unittest discover "$@"
 python -m unittest discover "$@"
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/tests/test_ast.py b/vndk/tools/sourcedr/blueprint/tests/test_ast.py
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/blueprint/tests/test_ast.py
rename to vndk/tools/sourcedr/blueprint/tests/test_ast.py
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/tests/test_evaluate_default.py b/vndk/tools/sourcedr/blueprint/tests/test_evaluate_default.py
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/blueprint/tests/test_evaluate_default.py
rename to vndk/tools/sourcedr/blueprint/tests/test_evaluate_default.py
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/tests/test_lexer.py b/vndk/tools/sourcedr/blueprint/tests/test_lexer.py
similarity index 98%
rename from vndk/tools/sourcedr/sourcedr/blueprint/tests/test_lexer.py
rename to vndk/tools/sourcedr/blueprint/tests/test_lexer.py
index b0f096d..c329f5b 100755
--- a/vndk/tools/sourcedr/sourcedr/blueprint/tests/test_lexer.py
+++ b/vndk/tools/sourcedr/blueprint/tests/test_lexer.py
@@ -596,5 +596,11 @@
         lexer.consume(Token.EOF)
 
 
+    def test_lexer_path(self):
+        """Test the path attribute of the Lexer object."""
+        lexer = Lexer('content', path='test_path')
+        self.assertEqual(lexer.path, 'test_path')
+
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/vndk/tools/sourcedr/blueprint/tests/test_module_path.py b/vndk/tools/sourcedr/blueprint/tests/test_module_path.py
new file mode 100644
index 0000000..7ccdb8a
--- /dev/null
+++ b/vndk/tools/sourcedr/blueprint/tests/test_module_path.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""This module contains the unit tests to whether module paths are kept
+properly."""
+
+import os
+import unittest
+
+from blueprint import Lexer, Parser, RecursiveParser
+
+
+#------------------------------------------------------------------------------
+# Module Path
+#------------------------------------------------------------------------------
+
+class ModulePathTest(unittest.TestCase):
+    """Test cases for module path attribute."""
+
+    def test_module_path_from_lexer(self):
+        """Test whether the path are passed from Lexer to parsed modules."""
+        content = '''
+            cc_library {
+                name: "libfoo",
+            }
+            '''
+
+        parser = Parser(Lexer(content, path='test_path'))
+        parser.parse()
+
+        self.assertEqual('test_path', parser.modules[0][1]['_path'])
+
+
+    def test_module_path_functional(self):
+        SUBNAME = 'MockBuild.txt'
+
+        test_dir = os.path.join(
+                os.path.dirname(__file__), 'testdata', 'example')
+        test_root_file = os.path.join(test_dir, SUBNAME)
+
+        parser = RecursiveParser()
+        parser.parse_file(test_root_file, default_sub_name=SUBNAME)
+
+        named_mods = {module[1]['name']: module for module in parser.modules}
+
+        self.assertEqual(os.path.join(test_dir, 'foo', SUBNAME),
+                         named_mods['libfoo'][1]['_path'])
+        self.assertEqual(os.path.join(test_dir, 'bar', SUBNAME),
+                         named_mods['libbar'][1]['_path'])
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/tests/test_parser.py b/vndk/tools/sourcedr/blueprint/tests/test_parser.py
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/blueprint/tests/test_parser.py
rename to vndk/tools/sourcedr/blueprint/tests/test_parser.py
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/.pylintrc b/vndk/tools/sourcedr/blueprint/tests/testdata/example/MockBuild.txt
similarity index 100%
copy from vndk/tools/sourcedr/sourcedr/blueprint/.pylintrc
copy to vndk/tools/sourcedr/blueprint/tests/testdata/example/MockBuild.txt
diff --git a/vndk/tools/sourcedr/blueprint/tests/testdata/example/bar/MockBuild.txt b/vndk/tools/sourcedr/blueprint/tests/testdata/example/bar/MockBuild.txt
new file mode 100644
index 0000000..eb82332
--- /dev/null
+++ b/vndk/tools/sourcedr/blueprint/tests/testdata/example/bar/MockBuild.txt
@@ -0,0 +1,3 @@
+cc_library {
+    name: "libbar",
+}
diff --git a/vndk/tools/sourcedr/blueprint/tests/testdata/example/foo/MockBuild.txt b/vndk/tools/sourcedr/blueprint/tests/testdata/example/foo/MockBuild.txt
new file mode 100644
index 0000000..6f90d25
--- /dev/null
+++ b/vndk/tools/sourcedr/blueprint/tests/testdata/example/foo/MockBuild.txt
@@ -0,0 +1,3 @@
+cc_library {
+    name: "libfoo",
+}
diff --git a/vndk/tools/sourcedr/blueprint/vndk.py b/vndk/tools/sourcedr/blueprint/vndk.py
new file mode 100755
index 0000000..008407f
--- /dev/null
+++ b/vndk/tools/sourcedr/blueprint/vndk.py
@@ -0,0 +1,194 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""This script scans all Android.bp in an android source tree and check the
+correctness of dependencies."""
+
+import copy
+
+from blueprint import RecursiveParser, evaluate_defaults, fill_module_namespaces
+
+
+class Module(object):
+    """The class for Blueprint module definition."""
+
+    def __init__(self, rule, attrs):
+        """Initialize from a module definition."""
+        self.rule = rule
+        self._attrs = attrs
+
+
+    def get_property(self, *names, **kwargs):
+        """Get a property in the module definition."""
+        try:
+            result = self._attrs
+            for name in names:
+                result = result[name]
+            return result
+        except KeyError:
+            return kwargs.get('default', None)
+
+
+    def is_vndk(self):
+        """Check whether this module is a VNDK shared library."""
+        return bool(self.get_property('vndk', 'enabled'))
+
+
+    def is_vndk_sp(self):
+        """Check whether this module is a VNDK-SP shared library."""
+        return bool(self.get_property('vndk', 'support_system_process'))
+
+
+    def is_vendor(self):
+        """Check whether this module is a vendor module."""
+        return bool(self.get_property('vendor') or
+                    self.get_property('proprietary'))
+
+
+    def is_vendor_available(self):
+        """Check whether this module is vendor available."""
+        return bool(self.get_property('vendor_available'))
+
+
+    def has_vendor_variant(self):
+        """Check whether the module is VNDK or vendor available."""
+        return self.is_vndk() or self.is_vendor_available()
+
+
+    def get_name(self):
+        """Get the module name."""
+        return self.get_property('name')
+
+
+    def get_dependencies(self):
+        """Get module dependencies."""
+
+        shared_libs = set(self.get_property('shared_libs', default=[]))
+        static_libs = set(self.get_property('static_libs', default=[]))
+        header_libs = set(self.get_property('header_libs', default=[]))
+
+        target_vendor = self.get_property('target', 'vendor')
+        if target_vendor:
+            shared_libs -= set(target_vendor.get('exclude_shared_libs', []))
+            static_libs -= set(target_vendor.get('exclude_static_libs', []))
+            header_libs -= set(target_vendor.get('exclude_header_libs', []))
+
+        return (sorted(shared_libs), sorted(static_libs), sorted(header_libs))
+
+
+class ModuleClassifier(object):
+    """Dictionaries (all_libs, vndk_libs, vndk_sp_libs,
+    vendor_available_libs, and llndk_libs) for modules."""
+
+
+    def __init__(self):
+        self.all_libs = {}
+        self.vndk_libs = {}
+        self.vndk_sp_libs = {}
+        self.vendor_available_libs = {}
+        self.llndk_libs = {}
+
+
+    def add_module(self, name, module):
+        """Add a module to one or more dictionaries."""
+
+        # If this is an llndk_library, add the module to llndk_libs and return.
+        if module.rule == 'llndk_library':
+            if name in self.llndk_libs:
+                raise ValueError('lldnk name {!r} conflicts'.format(name))
+            self.llndk_libs[name] = module
+            return
+
+        # Check the module name uniqueness.
+        prev_module = self.all_libs.get(name)
+        if prev_module:
+            # If there are two modules with the same module name, pick the one
+            # without _prebuilt_library_shared.
+            if module.rule.endswith('_prebuilt_library_shared'):
+                return
+            if not prev_module.rule.endswith('_prebuilt_library_shared'):
+                raise ValueError('module name {!r} conflicts'.format(name))
+
+        # Add the module to dictionaries.
+        self.all_libs[name] = module
+
+        if module.is_vndk():
+            self.vndk_libs[name] = module
+
+        if module.is_vndk_sp():
+            self.vndk_sp_libs[name] = module
+
+        if module.is_vendor_available():
+            self.vendor_available_libs[name] = module
+
+
+    def _add_modules_from_parsed_pairs(self, parsed_items, namespaces):
+        """Add modules from the parsed (rule, attrs) pairs."""
+
+        for rule, attrs in parsed_items:
+            name = attrs.get('name')
+            if name is None:
+                continue
+
+            namespace = attrs.get('_namespace')
+            if namespace not in namespaces:
+                continue
+
+            if rule == 'llndk_library':
+                self.add_module(name, Module(rule, attrs))
+            if rule in {'llndk_library', 'ndk_library'}:
+                continue
+
+            if rule.endswith('_library') or \
+               rule.endswith('_library_shared') or \
+               rule.endswith('_library_static') or \
+               rule.endswith('_headers'):
+                self.add_module(name, Module(rule, attrs))
+                continue
+
+            if rule == 'hidl_interface':
+                attrs['vendor_available'] = True
+                self.add_module(name, Module(rule, attrs))
+
+                adapter_module_name = name + '-adapter-helper'
+                adapter_module_dict = copy.deepcopy(attrs)
+                adapter_module_dict['name'] = adapter_module_name
+                self.add_module(adapter_module_name,
+                                Module(rule, adapter_module_dict))
+                continue
+
+
+    def parse_root_bp(self, root_bp_path, namespaces=None):
+        """Parse blueprint files and add module definitions."""
+
+        namespaces = {''} if namespaces is None else set(namespaces)
+
+        parser = RecursiveParser()
+        parser.parse_file(root_bp_path)
+        parsed_items = evaluate_defaults(parser.modules)
+        parsed_items = fill_module_namespaces(root_bp_path, parsed_items)
+
+        self._add_modules_from_parsed_pairs(parsed_items, namespaces)
+
+
+    @classmethod
+    def create_from_root_bp(cls, root_bp_path, namespaces=None):
+        """Create a ModuleClassifier from a root blueprint file."""
+        result = cls()
+        result.parse_root_bp(root_bp_path, namespaces)
+        return result
diff --git a/vndk/tools/sourcedr/files/list_app_shared_uid.py b/vndk/tools/sourcedr/files/list_app_shared_uid.py
new file mode 100755
index 0000000..2616e6d
--- /dev/null
+++ b/vndk/tools/sourcedr/files/list_app_shared_uid.py
@@ -0,0 +1,146 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""List all pre-installed Android Apps with `sharedUserId` in their
+`AndroidManifest.xml`."""
+
+import argparse
+import collections
+import csv
+import json
+import os
+import re
+import subprocess
+import sys
+
+
+_SHARED_UID_PATTERN = re.compile('sharedUserId="([^"\\r\\n]*)"')
+
+
+def load_module_paths(module_json):
+    """Load module source paths."""
+    result = {}
+    with open(module_json, 'r') as json_file:
+        modules = json.load(json_file)
+    for name, module in modules.items():
+        try:
+            result[name] = module['path'][0]
+        except IndexError:
+            continue
+    return result
+
+
+def find_shared_uid(manifest_path):
+    """Extract shared UID from AndroidManifest.xml."""
+    try:
+        with open(manifest_path, 'r') as manifest_file:
+            content = manifest_file.read()
+    except UnicodeDecodeError:
+        return []
+    return sorted(_SHARED_UID_PATTERN.findall(content))
+
+
+def find_file(product_out, app_name):
+    """Find the APK file for the app."""
+    product_out = os.path.abspath(product_out)
+    prefix_len = len(product_out) + 1
+    partitions = (
+        'data', 'odm', 'oem', 'product', 'product_services', 'system',
+        'system_other', 'vendor',)
+    for partition in partitions:
+        partition_dir = os.path.join(product_out, partition)
+        for base, _, filenames in os.walk(partition_dir):
+            for filename in filenames:
+                name, ext = os.path.splitext(filename)
+                if name == app_name and ext in {'.apk', '.jar'}:
+                    return os.path.join(base, filename)[prefix_len:]
+    return ''
+
+
+AppInfo = collections.namedtuple(
+    'AppInfo', 'name shared_uid installed_path source_path')
+
+
+def collect_apps_with_shared_uid(product_out, module_paths):
+    """Collect apps with shared UID."""
+    apps_dir = os.path.join(product_out, 'obj', 'APPS')
+    result = []
+    for app_dir_name in os.listdir(apps_dir):
+        app_name = re.sub('_intermediates$', '', app_dir_name)
+        app_dir = os.path.join(apps_dir, app_dir_name)
+
+        apk_file = os.path.join(app_dir, 'package.apk')
+        if not os.path.exists(apk_file):
+            print('error: Failed to find:', apk_file, file=sys.stderr)
+            continue
+
+        apk_unpacked = os.path.join(app_dir, 'package')
+        if not os.path.exists(apk_unpacked):
+            ret = subprocess.call(['apktool', 'd', 'package.apk'], cwd=app_dir)
+            if ret != 0:
+                print('error: Failed to unpack:', apk_file, file=sys.stderr)
+                continue
+
+        manifest_file = os.path.join(apk_unpacked, 'AndroidManifest.xml')
+        if not os.path.exists(manifest_file):
+            print('error: Failed to find:', manifest_file, file=sys.stderr)
+            continue
+
+        shared_uid = find_shared_uid(manifest_file)
+        if not shared_uid:
+            continue
+
+        result.append(AppInfo(
+            app_name, shared_uid, find_file(product_out, app_name),
+            module_paths.get(app_name, '')))
+    return result
+
+
+def _parse_args():
+    """Parse command line options."""
+    parser = argparse.ArgumentParser()
+    parser.add_argument('product_out')
+    parser.add_argument('-o', '--output', required=True)
+    return parser.parse_args()
+
+
+def main():
+    """Main function."""
+    args = _parse_args()
+
+    module_paths = load_module_paths(
+        os.path.join(args.product_out, 'module-info.json'))
+
+    result = collect_apps_with_shared_uid(args.product_out, module_paths)
+
+    def _generate_sort_key(app):
+        has_android_uid = any(
+            uid.startswith('android.uid') for uid in app.shared_uid)
+        return (not has_android_uid, app.installed_path.startswith('system'),
+                app.installed_path)
+
+    result.sort(key=_generate_sort_key)
+
+    with open(args.output, 'w') as output_file:
+        writer = csv.writer(output_file)
+        writer.writerow(('App Name', 'UID', 'Installation Path', 'Source Path'))
+        for app in result:
+            writer.writerow((app.name, ' '.join(app.shared_uid),
+                             app.installed_path, app.source_path))
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/ninja/list_installed_file_from_source.py b/vndk/tools/sourcedr/ninja/list_installed_file_from_source.py
new file mode 100755
index 0000000..930ff89
--- /dev/null
+++ b/vndk/tools/sourcedr/ninja/list_installed_file_from_source.py
@@ -0,0 +1,113 @@
+#!/usr/bin/env python3
+
+import argparse
+import itertools
+import os
+import posixpath
+import re
+
+try:
+    import cPickle as pickle  # Python 2
+except ImportError:
+    import pickle  # Python 3
+
+import ninja
+
+
+def _parse_args():
+    parser = argparse.ArgumentParser()
+
+    # Ninja input file options
+    parser.add_argument('input_file', help='input ninja file')
+    parser.add_argument('--ninja-deps', help='.ninja_deps file')
+    parser.add_argument('--cwd', help='working directory for ninja')
+    parser.add_argument('--encoding', default='utf-8',
+                        help='ninja file encoding')
+
+    # Options
+    parser.add_argument(
+            '--out-dir', default='out', help='path to output directory')
+    parser.add_argument(
+            '--installed-filter', default='system',
+            help='path filter for installed files (w.r.t. device root)')
+    parser.add_argument(
+            '--source-filter', default='vendor:device',
+            help='path filter for source files (w.r.t. source root)')
+
+    return parser.parse_args()
+
+
+def main():
+    args = _parse_args()
+
+    out_dir = posixpath.normpath(args.out_dir)
+
+    out_pattern = re.compile(re.escape(out_dir) + '/')
+
+    installed_dirs = '|'.join('(?:' + re.escape(posixpath.normpath(path)) + ')'
+                              for path in args.installed_filter.split(':'))
+
+    installed_filter = re.compile(
+        re.escape(out_dir) + '/target/product/[^/]+/' +
+        '(?:' + installed_dirs + ')')
+
+    source_filter = re.compile(
+        '|'.join('(?:' + re.escape(posixpath.normpath(path)) + ')'
+                 for path in args.source_filter.split(':')))
+
+    manifest = ninja.load_manifest_from_args(args)
+
+    # Build lookup map
+    outs = {}
+    for build in manifest.builds:
+        for path in build.explicit_outs:
+            outs[path] = build
+        for path in build.implicit_outs:
+            outs[path] = build
+
+    # Compute transitive input files
+    outs_from_vendor_cache = {}
+
+    def _are_inputs_from_vendor(build):
+        # Check whether the input files are matched by source_filter first.
+        gen_paths = []
+        paths = itertools.chain(
+            build.explicit_ins, build.implicit_ins, build.depfile_implicit_ins)
+        for path in paths:
+            if source_filter.match(path):
+                return True
+            if out_pattern.match(path):
+                gen_paths.append(path)
+
+        # Check whether the input files transitively depend on source_filter.
+        for path in gen_paths:
+            if is_from_vendor(path):
+                return True
+
+        return False
+
+    def is_from_vendor(out_path):
+        matched = outs_from_vendor_cache.get(out_path, None)
+        if matched is not None:
+            return matched
+
+        build = outs.get(out_path)
+        if build:
+            matched = _are_inputs_from_vendor(build)
+        else:
+            matched = bool(source_filter.match(path))
+        outs_from_vendor_cache[out_path] = matched
+        return matched
+
+    matched_paths = [
+        path for path in outs
+        if installed_filter.match(path) and is_from_vendor(path)]
+
+    matched_paths.sort()
+
+    for path in matched_paths:
+        print(path)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/ninja/list_installed_module_under_source.py b/vndk/tools/sourcedr/ninja/list_installed_module_under_source.py
new file mode 100755
index 0000000..3643e9d
--- /dev/null
+++ b/vndk/tools/sourcedr/ninja/list_installed_module_under_source.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+
+import argparse
+import itertools
+import json
+import posixpath
+import re
+
+
+def match_any(regex, iterable):
+    """Check whether any element in iterable matches regex."""
+    return any(regex.match(elem) for elem in iterable)
+
+
+class ModuleInfo(object):
+    def __init__(self, module_info_path):
+        with open(module_info_path, 'r') as module_info_file:
+            self._json = json.load(module_info_file)
+
+
+    def list(self, installed_filter=None, module_definition_filter=None):
+        for name, info in self._json.items():
+            installs = info['installed']
+            paths = info['path']
+
+            if installed_filter and not match_any(installed_filter, installs):
+                    continue
+            if module_definition_filter and \
+               not match_any(module_definition_filter, paths):
+                    continue
+
+            for install, path in itertools.product(installs, paths):
+                yield (install, path)
+
+
+def _parse_args():
+    """Parse command line arguments"""
+
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('module_info', help='Path to module-info.json')
+
+    parser.add_argument('--out-dir', default='out',
+                        help='Android build output directory')
+
+    parser.add_argument('--installed-filter',
+                        help='Installation filter (regular expression)')
+
+    parser.add_argument('--module-definition-filter',
+                        help='Module definition filter (regular expression)')
+
+    return parser.parse_args()
+
+
+def main():
+    """Main function"""
+
+    args = _parse_args()
+
+    installed_filter = None
+    if args.installed_filter:
+        installed_filter = re.compile(
+            re.escape(posixpath.normpath(args.out_dir)) + '/' +
+            '(?:' + args.installed_filter + ')')
+
+    module_definition_filter = None
+    if args.module_definition_filter:
+        module_definition_filter = re.compile(args.module_definition_filter)
+
+    module_info = ModuleInfo(args.module_info)
+
+    for installed_file, module_path in \
+            module_info.list(installed_filter, module_definition_filter):
+        print(installed_file, module_path)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/ninja/list_ninja_build_dep.py b/vndk/tools/sourcedr/ninja/list_ninja_build_dep.py
new file mode 100755
index 0000000..ac110ac
--- /dev/null
+++ b/vndk/tools/sourcedr/ninja/list_ninja_build_dep.py
@@ -0,0 +1,100 @@
+#!/usr/bin/env python3
+
+"""List all transitive build rules of a target."""
+
+import argparse
+import itertools
+import posixpath
+import re
+
+try:
+    import cPickle as pickle  # Python 2
+except ImportError:
+    import pickle  # Python 3
+
+import ninja
+
+
+def _parse_args():
+    """Parse the command line arguments."""
+
+    parser = argparse.ArgumentParser()
+
+    # Ninja input file options
+    parser.add_argument('input_file', help='input ninja file')
+    parser.add_argument('--ninja-deps', help='.ninja_deps file')
+    parser.add_argument('--cwd', help='working directory for ninja')
+    parser.add_argument('--encoding', default='utf-8',
+                        help='ninja file encoding')
+
+    # Options
+    parser.add_argument('target', help='build target')
+
+    return parser.parse_args()
+
+
+def collect_build_targets(graph, target):
+    """Collect the transitive build targets."""
+
+    # Search for the first target
+    build = graph[target]
+
+    # Collect all source files
+    dfs = [build]
+
+    visited = {build}
+    stack = [build]
+    while stack:
+        build = stack.pop()
+        for dep in itertools.chain(build.explicit_ins, build.implicit_ins,
+                                   build.depfile_implicit_ins):
+            dep = graph.get(dep)
+            if not dep:
+                continue
+            if dep not in visited:
+                visited.add(dep)
+                dfs.append(dep)
+                stack.append(dep)
+
+    return dfs
+
+
+def main():
+    args = _parse_args()
+
+    # Build lookup map
+    manifest = ninja.load_manifest_from_args(args)
+    graph = {}
+    for build in manifest.builds:
+        for path in build.explicit_outs:
+            graph[path] = build
+        for path in build.implicit_outs:
+            graph[path] = build
+
+    # List all transitive targets
+    try:
+        builds = collect_build_targets(graph, args.target)
+    except KeyError:
+        print('error: Failed to find the target {}'.format(arg.target),
+              file=sys.stderr)
+        sys.exit(1)
+
+    # Print all targets
+    for build in builds:
+        print('build')
+        for path in build.explicit_outs:
+            print('  explicit_out:', path)
+        for path in build.implicit_outs:
+            print('  implicit_out:', path)
+        for path in build.explicit_ins:
+            print('  explicit_in:', path)
+        for path in build.implicit_ins:
+            print('  implicit_in:', path)
+        for path in build.prerequisites:
+            print('  prerequisites:', path)
+        for path in build.depfile_implicit_ins:
+            print('  depfile_implicit_in:', path)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/ninja/list_source_file.py b/vndk/tools/sourcedr/ninja/list_source_file.py
new file mode 100755
index 0000000..9d34993
--- /dev/null
+++ b/vndk/tools/sourcedr/ninja/list_source_file.py
@@ -0,0 +1,124 @@
+#!/usr/bin/env python3
+
+"""List all source file of a installed module."""
+
+import argparse
+import itertools
+import posixpath
+import re
+
+try:
+    import cPickle as pickle  # Python 2
+except ImportError:
+    import pickle  # Python 3
+
+import ninja
+
+
+def _parse_args():
+    """Parse the command line arguments."""
+
+    parser = argparse.ArgumentParser()
+
+    # Ninja input file options
+    parser.add_argument('input_file', help='input ninja file')
+    parser.add_argument('--ninja-deps', help='.ninja_deps file')
+    parser.add_argument('--cwd', help='working directory for ninja')
+    parser.add_argument('--encoding', default='utf-8',
+                        help='ninja file encoding')
+
+    # Options
+    parser.add_argument(
+            'installed_filter', nargs='+',
+            help='path filter for installed files (w.r.t. device root)')
+    parser.add_argument(
+            '--out-dir', default='out', help='path to output directory')
+
+    return parser.parse_args()
+
+
+def collect_source_files(graph, start, out_dir_pattern, out_host_dir_pattern):
+    """Collect the transitive dependencies of a target."""
+
+    source_files = []
+
+    # Extract the file name of the target file.  We need this file name to
+    # allow the strip/copy build rules while leaving other shared libraries
+    # alone.
+    start_basename = posixpath.basename(start)
+
+    # Collect all source files
+    visited = {start}
+    stack = [start]
+    while stack:
+        cur = stack.pop()
+
+        if not out_dir_pattern.match(cur):
+            source_files.append(cur)
+
+        build = graph.get(cur)
+        if build:
+            for dep in itertools.chain(build.explicit_ins, build.implicit_ins,
+                                       build.depfile_implicit_ins):
+                # Skip the binaries for build process
+                if dep.startswith('prebuilts/'):
+                    continue
+                if out_host_dir_pattern.match(dep):
+                    continue
+
+                # Skip the shared libraries
+                if dep.endswith('.toc'):
+                    continue
+                if dep.endswith('.so'):
+                    if posixpath.basename(dep) != start_basename:
+                        continue
+
+                if dep not in visited:
+                    visited.add(dep)
+                    stack.append(dep)
+
+    return sorted(source_files)
+
+
+def main():
+    args = _parse_args()
+
+    out_dir = posixpath.normpath(args.out_dir)
+    out_dir_pattern = re.compile(re.escape(out_dir) + '/')
+    out_host_dir_pattern = re.compile(re.escape(out_dir) + '/host/')
+    out_product_dir = out_dir + '/target/product/[^/]+'
+
+    def _normalize_path(path):
+        if path.startswith(out_dir + '/target'):
+            return path
+        return posixpath.join(out_product_dir, path)
+
+    installed_filter = [_normalize_path(path) for path in args.installed_filter]
+    installed_filter = re.compile(
+        '|'.join('(?:' + p + ')' for p in installed_filter))
+
+    manifest = ninja.load_manifest_from_args(args)
+
+    # Build lookup map
+    graph = {}
+    for build in manifest.builds:
+        for path in build.explicit_outs:
+            graph[path] = build
+        for path in build.implicit_outs:
+            graph[path] = build
+
+    # Collect all matching outputs
+    matched_files = [path for path in graph if installed_filter.match(path)]
+    matched_files.sort()
+
+    for path in matched_files:
+        source_files = collect_source_files(
+            graph, path, out_dir_pattern, out_host_dir_pattern)
+        print(path)
+        for dep in source_files:
+            print('\t' + dep)
+        print()
+
+
+if __name__ == '__main__':
+    main()
diff --git a/vndk/tools/sourcedr/sourcedr/ninja.py b/vndk/tools/sourcedr/ninja/ninja.py
old mode 100644
new mode 100755
similarity index 89%
rename from vndk/tools/sourcedr/sourcedr/ninja.py
rename to vndk/tools/sourcedr/ninja/ninja.py
index 977d8d8..17291ec
--- a/vndk/tools/sourcedr/sourcedr/ninja.py
+++ b/vndk/tools/sourcedr/ninja/ninja.py
@@ -12,13 +12,10 @@
 import struct
 import sys
 
-DEBUG_ALLOC = False
-
-if DEBUG_ALLOC:
-    try:
-        import tracemalloc
-    except ImportError:
-        DEBUG_ALLOC = False
+try:
+    import cPickle as pickle  # Python 2
+except ImportError:
+    import pickle  # Python 3
 
 try:
     from cStringIO import StringIO  # Python 2
@@ -985,60 +982,111 @@
         return self._path_deps
 
 
-def main():
-    # Parse command line options
+def _parse_args():
+    """Parse command line options."""
+
     parser = argparse.ArgumentParser()
-    parser.add_argument('input_file', help='input ninja file')
-    parser.add_argument('--encoding', default='utf-8',
-                        help='ninja file encoding')
-    parser.add_argument('--ninja-deps', help='.ninja_deps file')
+    subparsers = parser.add_subparsers(dest='command')
+
+    def _register_input_file_args(parser):
+        parser.add_argument('input_file', help='input ninja file')
+        parser.add_argument('--ninja-deps', help='.ninja_deps file')
+        parser.add_argument('--cwd', help='working directory for ninja')
+        parser.add_argument('--encoding', default='utf-8',
+                            help='ninja file encoding')
+
+    # dump sub-command
+    parser_dump = subparsers.add_parser('dump', help='dump dependency graph')
+    _register_input_file_args(parser_dump)
+    parser_dump.add_argument('-o', '--output', help='output file')
+
+    # pickle sub-command
+    parser_pickle = subparsers.add_parser(
+            'pickle', help='serialize dependency graph with pickle')
+    _register_input_file_args(parser_pickle)
+    parser_pickle.add_argument('-o', '--output', required=True,
+                               help='output file')
+
+    # Parse arguments and check sub-command
     args = parser.parse_args()
+    if args.command is None:
+        parser.print_help()
+        sys.exit(1)
 
-    if DEBUG_ALLOC:
-        tracemalloc.start(25)
-        tc_start = tracemalloc.take_snapshot()
+    return args
 
-    # Parse ninja file
-    manifest = Parser().parse(args.input_file, args.encoding, args.ninja_deps)
 
-    if DEBUG_ALLOC:
-        tc_end = tracemalloc.take_snapshot()
+def load_manifest_from_args(args):
+    """Load the input manifest specified by command line options."""
+
+    input_file = args.input_file
+
+    # If the input file name ends with `.pickle`, load it with pickle.load().
+    if input_file.endswith('.pickle'):
+        with open(input_file, 'rb') as pickle_file:
+            return pickle.load(pickle_file)
+
+    # Parse the ninja file
+    return Parser(args.cwd).parse(args.input_file, args.encoding,
+                                  args.ninja_deps)
+
+
+def dump_manifest(manifest, file):
+    """Dump a manifest to a text file."""
 
     for rule in manifest.rules:
-        print('rule', rule.name)
+        print('rule', rule.name, file=file)
 
     for build in manifest.builds:
-        print('build')
+        print('build', file=file)
         for path in build.explicit_outs:
-            print('  explicit_out:', path)
+            print('  explicit_out:', path, file=file)
         for path in build.implicit_outs:
-            print('  implicit_out:', path)
+            print('  implicit_out:', path, file=file)
         for path in build.explicit_ins:
-            print('  explicit_in:', path)
+            print('  explicit_in:', path, file=file)
         for path in build.implicit_ins:
-            print('  implicit_in:', path)
+            print('  implicit_in:', path, file=file)
         for path in build.prerequisites:
-            print('  prerequisites:', path)
+            print('  prerequisites:', path, file=file)
         for path in build.depfile_implicit_ins:
-            print('  depfile_implicit_in:', path)
+            print('  depfile_implicit_in:', path, file=file)
 
     for pool in manifest.pools:
-        print('pool', pool.name)
+        print('pool', pool.name, file=file)
 
     for default in manifest.defaults:
-        print('default')
+        print('default', file=file)
         for path in default.outs:
-            print('  out:', path)
+            print('  out:', path, file=file)
 
-    if DEBUG_ALLOC:
-        top_stats = tc_end.compare_to(tc_start, 'traceback')
-        with open('tracemalloc.log', 'w') as fp:
-            for s in top_stats:
-                print('', file=fp)
-                print('========================================', file=fp)
-                print(s, file=fp)
-                for line in s.traceback.format():
-                    print(line, file=fp)
+
+def command_dump_main(args):
+    """Main function for the dump sub-command"""
+    if args.output is None:
+        dump_manifest(load_manifest_from_args(args), sys.stdout)
+    else:
+        with open(args.output, 'w') as output_file:
+            dump_manifest(load_manifest_from_args(args), output_file)
+
+
+def command_pickle_main(args):
+    """Main function for the pickle sub-command"""
+    with open(args.output, 'wb') as output_file:
+        pickle.dump(load_manifest_from_args(args), output_file)
+
+
+def main():
+    """Main function for the executable"""
+    args = _parse_args()
+    if args.command == 'dump':
+        command_dump_main(args)
+    elif args.command == 'pickle':
+        command_pickle_main(args)
+    else:
+        raise KeyError('unknown command ' + args.command)
+
 
 if __name__ == '__main__':
-    main()
+    import ninja
+    ninja.main()
diff --git a/vndk/tools/sourcedr/sourcedr/tests/__init__.py b/vndk/tools/sourcedr/ninja/tests/__init__.py
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/__init__.py
rename to vndk/tools/sourcedr/ninja/tests/__init__.py
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh b/vndk/tools/sourcedr/ninja/tests/run_tests.sh
similarity index 96%
copy from vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
copy to vndk/tools/sourcedr/ninja/tests/run_tests.sh
index bc94afc..3a31145 100755
--- a/vndk/tools/sourcedr/sourcedr/blueprint/run_tests.sh
+++ b/vndk/tools/sourcedr/ninja/tests/run_tests.sh
@@ -16,5 +16,7 @@
 # limitations under the License.
 #
 
+cd "$(dirname "$0")/.."
+
 python3 -m unittest discover "$@"
 python -m unittest discover "$@"
diff --git a/vndk/tools/sourcedr/sourcedr/tests/test_ninja.py b/vndk/tools/sourcedr/ninja/tests/test_ninja.py
similarity index 99%
rename from vndk/tools/sourcedr/sourcedr/tests/test_ninja.py
rename to vndk/tools/sourcedr/ninja/tests/test_ninja.py
index 54452c4..0c0560c 100755
--- a/vndk/tools/sourcedr/sourcedr/tests/test_ninja.py
+++ b/vndk/tools/sourcedr/ninja/tests/test_ninja.py
@@ -1,13 +1,13 @@
 #!/usr/bin/env python3
 
-from sourcedr import ninja
+import ninja
 
 import os
 import unittest
 
 
 TEST_DIR = os.path.abspath(os.path.dirname(__file__))
-TEST_DATA_DIR = os.path.join(TEST_DIR, 'testdata', 'ninja')
+TEST_DATA_DIR = os.path.join(TEST_DIR, 'testdata')
 
 ENCODING = 'utf-8'
 
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_after_good.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/bad_after_good.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_after_good.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/bad_after_good.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_non_trivial.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/bad_non_trivial.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_non_trivial.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/bad_non_trivial.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_path.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/bad_path.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_path.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/bad_path.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_trivial.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/bad_trivial.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/bad_trivial.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/bad_trivial.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/build.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/build.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/build.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/build.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/default.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/default.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/default.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/default.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/global_binding.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/global_binding.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/global_binding.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/global_binding.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/include.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/include.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/include.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/include.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/pool.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/pool.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/pool.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/pool.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/rule.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/rule.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/rule.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/rule.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/sub.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/sub.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/sub.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/sub.ninja
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/subninja.ninja b/vndk/tools/sourcedr/ninja/tests/testdata/subninja.ninja
similarity index 100%
rename from vndk/tools/sourcedr/sourcedr/tests/testdata/ninja/subninja.ninja
rename to vndk/tools/sourcedr/ninja/tests/testdata/subninja.ninja
diff --git a/vndk/tools/sourcedr/requirements.txt b/vndk/tools/sourcedr/requirements.txt
deleted file mode 100644
index 9ef2006..0000000
--- a/vndk/tools/sourcedr/requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-flask
-Flask-testing
diff --git a/vndk/tools/sourcedr/runtest.py b/vndk/tools/sourcedr/runtest.py
deleted file mode 100755
index 7a3e440..0000000
--- a/vndk/tools/sourcedr/runtest.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python3
-
-"""Unit tests and functional tests runner."""
-
-import argparse
-import os
-import unittest
-
-
-TESTS_DIR = os.path.join(os.path.dirname(__file__), 'sourcedr', 'tests')
-
-
-def main():
-    """ Find and run unit tests and functional tests."""
-
-    parser = argparse.ArgumentParser()
-    parser.add_argument('--verbose', '-v', action='store_true')
-    args = parser.parse_args()
-
-    verbosity = 2 if args.verbose else 1
-
-    loader = unittest.TestLoader()
-    tests = loader.discover(TESTS_DIR, 'test_*.py')
-    runner = unittest.runner.TextTestRunner(verbosity=verbosity)
-    runner.run(tests)
-
-if __name__ == '__main__':
-    main()
diff --git a/vndk/tools/sourcedr/setup.py b/vndk/tools/sourcedr/setup.py
deleted file mode 100755
index 7e37600..0000000
--- a/vndk/tools/sourcedr/setup.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python3
-
-from setuptools import setup
-
-setup(
-    name='sourcedr',
-    version='1.0',
-    description='Shared Libs Deps Review Tool',
-    url='https://android.googlesource.com/platform/development/+'
-        '/master/vndk/tools/source-deps-reviewer/',
-    packages=['sourcedr'],
-    package_data={
-        'sourcedr': [
-            'defaults/pattern_db.csv',
-            'defaults/sourcedr.json',
-            'static/css/main.css',
-            'static/js/main.js',
-            'static/prism/css/prism.css',
-            'static/prism/js/prism.js',
-        ],
-    },
-    install_requires=['flask'],
-    extras_require={
-        'dev': [
-            'flask_testing'
-        ],
-    },
-    entry_points={
-        'console_scripts': [
-            'sourcedr = sourcedr.commands:main',
-        ],
-    }
-)
diff --git a/vndk/tools/sourcedr/sourcedr/__init__.py b/vndk/tools/sourcedr/sourcedr/__init__.py
deleted file mode 100644
index e5a0d9b..0000000
--- a/vndk/tools/sourcedr/sourcedr/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-#!/usr/bin/env python3
diff --git a/vndk/tools/sourcedr/sourcedr/blueprint/check_vndk_dep.py b/vndk/tools/sourcedr/sourcedr/blueprint/check_vndk_dep.py
deleted file mode 100755
index 0a9e22f..0000000
--- a/vndk/tools/sourcedr/sourcedr/blueprint/check_vndk_dep.py
+++ /dev/null
@@ -1,197 +0,0 @@
-#!/usr/bin/env python3
-
-#
-# Copyright (C) 2018 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-"""This script scans all Android.bp in an android source tree and check the
-correctness of dependencies."""
-
-from __future__ import print_function
-
-import argparse
-import itertools
-import sys
-
-from blueprint import RecursiveParser, evaluate_defaults
-
-
-def _is_vndk(module):
-    """Get the `vndk.enabled` module property."""
-    try:
-        return bool(module['vndk']['enabled'])
-    except KeyError:
-        return False
-
-
-def _is_vndk_sp(module):
-    """Get the `vndk.support_system_process` module property."""
-    try:
-        return bool(module['vndk']['support_system_process'])
-    except KeyError:
-        return False
-
-
-def _is_vendor(module):
-    """Get the `vendor` module property."""
-    try:
-        return module.get('vendor', False) or module.get('proprietary', False)
-    except KeyError:
-        return False
-
-
-def _is_vendor_available(module):
-    """Get the `vendor_available` module property."""
-    try:
-        return bool(module['vendor_available'])
-    except KeyError:
-        return False
-
-
-def _has_vendor_variant(module):
-    """Check whether the module is VNDK or vendor available."""
-    return _is_vndk(module) or _is_vendor_available(module)
-
-
-def _get_dependencies(module):
-    """Get module dependencies."""
-
-    shared_libs = set(module.get('shared_libs', []))
-    static_libs = set(module.get('static_libs', []))
-    header_libs = set(module.get('header_libs', []))
-
-    try:
-        target_vendor = module['target']['vendor']
-        shared_libs -= set(target_vendor.get('exclude_shared_libs', []))
-        static_libs -= set(target_vendor.get('exclude_static_libs', []))
-        header_libs -= set(target_vendor.get('exclude_header_libs', []))
-    except KeyError:
-        pass
-
-    return (sorted(shared_libs), sorted(static_libs), sorted(header_libs))
-
-
-def _build_module_dict(modules):
-    """Build module dictionaries that map module names to modules."""
-    all_libs = {}
-    llndk_libs = {}
-
-    for rule, module in modules:
-        name = module.get('name')
-        if name is None:
-            continue
-
-        if rule == 'llndk_library':
-            llndk_libs[name] = (rule, module)
-        if rule in {'llndk_library', 'ndk_library'}:
-            continue
-
-        if rule.endswith('_library') or \
-           rule.endswith('_library_shared') or \
-           rule.endswith('_library_static') or \
-           rule.endswith('_headers'):
-            all_libs[name] = (rule, module)
-
-        if rule == 'hidl_interface':
-            all_libs[name] = (rule, module)
-            all_libs[name + '-adapter-helper'] = (rule, module)
-            module['vendor_available'] = True
-
-    return (all_libs, llndk_libs)
-
-
-def _check_module_deps(all_libs, llndk_libs, module):
-    """Check the dependencies of a module."""
-
-    bad_deps = set()
-    shared_deps, static_deps, header_deps = _get_dependencies(module)
-
-    # Check vendor module dependencies requirements.
-    for dep_name in itertools.chain(shared_deps, static_deps, header_deps):
-        if dep_name in llndk_libs:
-            continue
-        dep_module = all_libs[dep_name][1]
-        if _is_vendor(dep_module):
-            continue
-        if _is_vendor_available(dep_module):
-            continue
-        if _is_vndk(dep_module) and not _is_vendor(module):
-            continue
-        bad_deps.add(dep_name)
-
-    # Check VNDK dependencies requirements.
-    if _is_vndk(module) and not _is_vendor(module):
-        is_vndk_sp = _is_vndk_sp(module)
-        for dep_name in shared_deps:
-            if dep_name in llndk_libs:
-                continue
-            dep_module = all_libs[dep_name][1]
-            if not _is_vndk(dep_module):
-                # VNDK must be self-contained.
-                bad_deps.add(dep_name)
-                break
-            if is_vndk_sp and not _is_vndk_sp(dep_module):
-                # VNDK-SP must be self-contained.
-                bad_deps.add(dep_name)
-                break
-
-    return bad_deps
-
-
-def _check_modules_deps(modules):
-    """Check the dependencies of modules."""
-
-    all_libs, llndk_libs = _build_module_dict(modules)
-
-    # Check the dependencies of modules
-    all_bad_deps = []
-    for name, (_, module) in all_libs.items():
-        if not _has_vendor_variant(module) and not _is_vendor(module):
-            continue
-
-        bad_deps = _check_module_deps(all_libs, llndk_libs, module)
-
-        if bad_deps:
-            all_bad_deps.append((name, sorted(bad_deps)))
-
-    return sorted(all_bad_deps)
-
-
-def _parse_args():
-    """Parse command line options."""
-    parser = argparse.ArgumentParser()
-    parser.add_argument('root_bp', help='android source tree root')
-    return parser.parse_args()
-
-
-def main():
-    """Main function."""
-
-    args = _parse_args()
-
-    parser = RecursiveParser()
-    parser.parse_file(args.root_bp)
-
-    all_bad_deps = _check_modules_deps(evaluate_defaults(parser.modules))
-    for name, bad_deps in all_bad_deps:
-        print('ERROR: {!r} must not depend on {}'.format(name, bad_deps),
-              file=sys.stderr)
-
-    if all_bad_deps:
-        sys.exit(1)
-
-
-if __name__ == '__main__':
-    main()
diff --git a/vndk/tools/sourcedr/sourcedr/codesearch.py b/vndk/tools/sourcedr/sourcedr/codesearch.py
deleted file mode 100644
index b3c9703..0000000
--- a/vndk/tools/sourcedr/sourcedr/codesearch.py
+++ /dev/null
@@ -1,324 +0,0 @@
-#!/usr/bin/env python3
-
-"""Code indexing and searching utilities.
-
-This module will build n-gram file index with codesearch_ and use the index as
-a bloom filter to find the regular expression pattern.
-
-In addition, language-specific filters are provided to ignore matchings in
-string literals or comments in the source code.
-
-.. _codesearch: https://github.com/google/codesearch
-"""
-
-import collections
-import os
-import re
-import subprocess
-
-
-class ClikeFilter(object):
-    def __init__(self, skip_literals=True, skip_comments=True):
-        self.file_exts = (b'.c', b'.cpp', b'.cc', b'.cxx', b'.h', b'.hpp',
-                          b'.hxx', b'.java')
-        self.skip_literals = skip_literals
-        self.skip_comments = skip_comments
-
-    def process(self, code):
-        if self.skip_comments:
-            # Remove // comments.
-            code = re.sub(b'//[^\\r\\n]*[\\r\\n]', b'', code)
-            # Remove matched /* */ comments.
-            code = re.sub(b'/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/', b'', code)
-        if self.skip_literals:
-            # Remove matching quotes.
-            code = re.sub(b'"(?:\\\\?.)*?"', b'', code)
-            code = re.sub(b'\'(?:\\\\?.)*?\'', b'', code)
-        return code
-
-    def get_span(self, code):
-        span = []
-        if self.skip_comments:
-            # Remove // comments.
-            p = re.compile(b'//[^\\r\\n]*[\\r\\n]')
-            for m in p.finditer(code):
-                span.append(m.span())
-            # Remove matched /* */ comments.
-            p = re.compile(b'/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/')
-            for m in p.finditer(code):
-                span.append(m.span())
-        if self.skip_literals:
-            # Remove matching quotes.
-            p = re.compile(b'"(?:\\\\?.)*?"')
-            for m in p.finditer(code):
-                span.append(m.span())
-            p = re.compile(b'\'(?:\\\\?.)*?\'')
-            for m in p.finditer(code):
-                span.append(m.span())
-        return span
-
-class PyFilter(object):
-    def __init__(self, skip_literals=True, skip_comments=True):
-        self.file_exts = (b'.py',)
-        self.skip_literals = skip_literals
-        self.skip_comments = skip_comments
-
-    def process(self, code):
-        if self.skip_comments:
-            # Remove # comments
-            code = re.sub(b'#[^\\r\\n]*[\\r\\n]', b'', code)
-        if self.skip_literals:
-            # Remove matching quotes.
-            code = re.sub(b'"(?:\\\\?.)*?"', b'', code)
-            code = re.sub(b'\'(?:\\\\?.)*?\'', b'', code)
-        return code
-
-    def get_span(self, code):
-        span = []
-        if self.skip_comments:
-            # Remove # comments.
-            p = re.compile(b'#[^\\r\\n]*[\\r\\n]')
-            for m in p.finditer(code):
-                span.append(m.span())
-        if self.skip_literals:
-            # Remove matching quotes.
-            p = re.compile(b'"(?:\\\\?.)*?"')
-            for m in p.finditer(code):
-                span.append(m.span())
-            p = re.compile(b'\'(?:\\\\?.)*?\'')
-            for m in p.finditer(code):
-                span.append(m.span())
-        return span
-
-class AssemblyFilter(object):
-    def __init__(self, skip_literals=True, skip_comments=True):
-        self.file_exts = (b'.s', b'.S')
-        self.skip_literals = skip_literals
-        self.skip_comments = skip_comments
-
-    def process(self, code):
-        if self.skip_comments:
-            # Remove @ comments
-            code = re.sub(b'@[^\\r\\n]*[\\r\\n]', b'', code)
-            # Remove // comments.
-            code = re.sub(b'//[^\\r\\n]*[\\r\\n]', b'', code)
-            # Remove matched /* */ comments.
-            code = re.sub(b'/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/', b'', code)
-        return code
-
-    def get_span(self, code):
-        span = []
-        if self.skip_comments:
-            # Remove # comments.
-            p = re.compile(b'@[^\\r\\n]*[\\r\\n]')
-            for m in p.finditer(code):
-                span.append(m.span())
-            # Remove // comments
-            p = re.compile(b'//[^\\r\\n]*[\\r\\n]')
-            for m in p.finditer(code):
-                span.append(m.span())
-            # Remove matched /* */ comments
-            p = re.compile(b'/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/')
-            for m in p.finditer(code):
-                span.append(m.span())
-        return span
-
-class MkFilter(object):
-    def __init__(self, skip_literals=True, skip_comments=True):
-        self.file_exts = (b'.mk',)
-        self.skip_literals = skip_literals
-        self.skip_comments = skip_comments
-
-    def process(self, code):
-        if self.skip_comments:
-            # Remove # comments
-            code = re.sub(b'#[^\\r\\n]*[\\r\\n]', b'', code)
-        return code
-
-    def get_span(self, code):
-        span = []
-        if self.skip_comments:
-            # Remove # comments.
-            p = re.compile(b'#[^\\r\\n]*[\\r\\n]')
-            for m in p.finditer(code):
-                span.append(m.span())
-        return span
-
-class BpFilter(object):
-    def __init__(self, skip_literals=True, skip_comments=True):
-        self.file_exts = (b'.bp',)
-        self.skip_literals = skip_literals
-        self.skip_comments = skip_comments
-
-    def process(self, code):
-        if self.skip_comments:
-            # Remove // comments
-            code = re.sub(b'//[^\\r\\n]*[\\r\\n]', b'', code)
-        return code
-
-    def get_span(self, code):
-        span = []
-        if self.skip_comments:
-            # Remove // comments.
-            p = re.compile(b'//[^\\r\\n]*[\\r\\n]')
-            for m in p.finditer(code):
-                span.append(m.span())
-        return span
-
-class PathFilter(object):
-    def __init__(self, file_ext_black_list=tuple(),
-                 file_name_black_list=tuple(),
-                 path_component_black_list=tuple()):
-        self.file_ext_black_list = set(
-                x.encode('utf-8') for x in file_ext_black_list)
-        self.file_name_black_list = set(
-                x.encode('utf-8') for x in file_name_black_list)
-        self.path_component_black_list = set(
-                x.encode('utf-8') for x in path_component_black_list)
-
-    def should_skip(self, path):
-        file_name = os.path.basename(path)
-        file_ext = os.path.splitext(file_name)[1]
-
-        if file_ext.lower() in self.file_ext_black_list:
-            return True
-        if file_name in self.file_name_black_list:
-            return True
-        return any(patt in path for patt in self.path_component_black_list)
-
-class CodeSearch(object):
-    DEFAULT_NAME = 'csearchindex'
-
-    @classmethod
-    def get_default_path(cls, project_dir):
-        return os.path.join(project_dir, 'tmp', cls.DEFAULT_NAME)
-
-    def __init__(self, root_dir, index_file_path, path_filter=None):
-        self.path = os.path.abspath(index_file_path)
-        self._root_dir = os.path.abspath(root_dir)
-        self._env = dict(os.environ)
-        self._env['CSEARCHINDEX'] = self.path
-        self._filters = {}
-        self._path_filter = PathFilter() if path_filter is None else path_filter
-
-    def _run_cindex(self, options):
-        subprocess.check_call(['cindex'] + options, env=self._env,
-                              cwd=self._root_dir, stdout=subprocess.DEVNULL,
-                              stderr=subprocess.DEVNULL)
-
-    def _run_csearch(self, options):
-        if not os.path.exists(self.path):
-            raise ValueError('Failed to find ' + self.path)
-        return subprocess.check_output(['csearch'] + options, env=self._env,
-                                       cwd=self._root_dir,
-                                       stderr=subprocess.DEVNULL)
-
-    def add_filter(self, lang_filter):
-        for ext in lang_filter.file_exts:
-            self._filters[ext] = lang_filter
-
-    def add_default_filters(self, skip_literals=True, skip_comments=True):
-        self.add_filter(ClikeFilter(skip_literals, skip_comments))
-        self.add_filter(AssemblyFilter(skip_literals, skip_comments))
-        self.add_filter(PyFilter(skip_literals, skip_comments))
-        self.add_filter(MkFilter(skip_literals, skip_comments))
-        self.add_filter(BpFilter(skip_literals, skip_comments))
-
-    def build_index(self, remove_existing_index=True):
-        if remove_existing_index and os.path.exists(self.path):
-            with contextlib.suppress(FileNotFoundError):
-                os.remove(self.path)
-        os.makedirs(os.path.dirname(self.path), exist_ok=True)
-        self._run_cindex([self._root_dir])
-
-    def _sanitize_code(self, file_path):
-        with open(file_path, 'rb') as f:
-            code = f.read()
-        file_name = os.path.basename(file_path)
-        f, ext = os.path.splitext(file_name)
-        try:
-            code = self._filters[ext].process(code)
-        except KeyError:
-            pass
-        return code
-
-    def _remove_prefix(self, raw_grep):
-        ret = b''
-        patt = re.compile(b'([^:]+):(\\d+):(.*)$')
-        for line in raw_grep.split(b'\n'):
-            match = patt.match(line)
-            if not match:
-                continue
-            file_path = os.path.relpath(match.group(1),
-                                        self._root_dir.encode('utf-8'))
-            line_no = match.group(2)
-            code = match.group(3)
-            ret += file_path + b':' + line_no + b':' + code + b'\n'
-        return ret
-
-    def process_grep(self, raw_grep, pattern, is_regex):
-        pattern = pattern.encode('utf-8')
-        if not is_regex:
-            pattern = re.escape(pattern)
-        # Limit pattern not to match exceed a line
-        # Since grep may get multiple patterns in a single entry
-        pattern = re.compile(pattern + b'[^\\n\\r]*(?:\\n|\\r|$)')
-
-        patt = re.compile(b'([^:]+):(\\d+):(.*)$')
-        suspect = collections.defaultdict(list)
-        for line in raw_grep.split(b'\n'):
-            match = patt.match(line)
-            if not match:
-                continue
-
-            file_path = match.group(1)
-            line_no = match.group(2)
-            code = match.group(3)
-
-            if self._path_filter.should_skip(file_path):
-                continue
-
-            abs_file_path = os.path.join(self._root_dir.encode('utf-8'),
-                                         file_path)
-            # Check if any pattern can be found after sanitize_code
-            if not pattern.search(self._sanitize_code(abs_file_path)):
-                continue
-            suspect[abs_file_path].append((file_path, line_no, code))
-
-        suspect = sorted(suspect.items())
-
-        processed = b''
-        for file_path, entries in suspect:
-            with open(file_path, 'rb') as f:
-                code = f.read()
-            # deep filter
-            file_name = os.path.basename(file_path)
-            f, ext = os.path.splitext(file_name)
-            try:
-                span = self._filters[ext].get_span(code)
-            except KeyError:
-                span = []
-
-            matchers = [m for m in pattern.finditer(code)]
-            for i, matcher in enumerate(matchers):
-                if not span or all(span_ent[0] > matcher.start() or
-                                   span_ent[1] <= matcher.start()
-                                   for span_ent in span):
-                    processed += (entries[i][0] + b':' +
-                                  entries[i][1] + b':' +
-                                  entries[i][2] + b'\n')
-
-        return processed
-
-    def raw_grep(self, pattern):
-        try:
-            return self._remove_prefix(self._run_csearch(['-n', pattern]))
-        except subprocess.CalledProcessError as e:
-            if e.output == b'':
-                return b''
-            raise
-
-    def raw_search(self, pattern, is_regex):
-        if not is_regex:
-            pattern = re.escape(pattern)
-        return self.raw_grep(pattern)
diff --git a/vndk/tools/sourcedr/sourcedr/commands/__init__.py b/vndk/tools/sourcedr/sourcedr/commands/__init__.py
deleted file mode 100644
index 3a77a6b..0000000
--- a/vndk/tools/sourcedr/sourcedr/commands/__init__.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python3
-
-"""Parser for command line options."""
-
-import argparse
-import sys
-
-from sourcedr.commands import collect, init, scan, review
-
-
-def main():
-    """Register sub-commands, parse command line options, and delegate."""
-
-    parser = argparse.ArgumentParser()
-    subparsers = parser.add_subparsers(dest='subcmd')
-    commands = {}
-
-    def _register_subcmd(name, init_argparse):
-        commands[name] = init_argparse(subparsers)
-
-    _register_subcmd('init', init.init_argparse)
-    _register_subcmd('scan', scan.init_argparse)
-    _register_subcmd('review', review.init_argparse)
-    _register_subcmd('collect', collect.init_argparse)
-
-    args = parser.parse_args()
-
-    try:
-        func = commands[args.subcmd]
-    except KeyError:
-        parser.print_help()
-        sys.exit(1)
-
-    sys.exit(func(args))
-
-
-if __name__ == '__main__':
-    main()
diff --git a/vndk/tools/sourcedr/sourcedr/commands/collect.py b/vndk/tools/sourcedr/sourcedr/commands/collect.py
deleted file mode 100644
index a3b5922..0000000
--- a/vndk/tools/sourcedr/sourcedr/commands/collect.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python3
-
-"""`sourcedr collect` command."""
-
-import json
-import os
-
-from sourcedr.project import Project
-from sourcedr.map import (
-    link_build_dep_and_review_data, load_build_dep_ninja, load_review_data)
-
-
-def init_argparse(parsers):
-    """Initialize argument parser for `sourcedr collect`."""
-    parser = parsers.add_parser('collect', help='Open web-based review UI')
-    parser.add_argument('input', help='Ninja file')
-    parser.add_argument('--ninja-deps')
-    parser.add_argument('--project-dir', default='.')
-    parser.add_argument('-o', '--output', required=True)
-    return run
-
-
-def run(args):
-    project_dir = os.path.expanduser(args.project_dir)
-    project = Project(project_dir)
-
-    # Load build dependency file
-    try:
-        dep = load_build_dep_ninja(args.input, project.source_dir,
-                                   args.ninja_deps)
-    except IOError:
-        print('error: Failed to open build dependency file:', args.input,
-              file=sys.stderr)
-        sys.exit(1)
-
-    # Load review data
-    table = load_review_data(project.review_db.path)
-
-    # Link build dependency file and review data
-    res = link_build_dep_and_review_data(dep, table)
-
-    # Write the output file
-    with open(args.output, 'w') as f:
-        json.dump(res, f, sort_keys=True, indent=4)
-
-if __name__ == '__main__':
-    main()
diff --git a/vndk/tools/sourcedr/sourcedr/commands/init.py b/vndk/tools/sourcedr/sourcedr/commands/init.py
deleted file mode 100644
index e44812d..0000000
--- a/vndk/tools/sourcedr/sourcedr/commands/init.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python3
-
-"""`sourcedr init` command."""
-
-import os
-import sys
-
-from sourcedr.project import Project
-
-
-def _is_dir_empty(path):
-    """Determine whether the given path is an empty directory."""
-    return len(os.listdir(path)) == 0
-
-
-def init_argparse(parsers):
-    """Initialize argument parser for `sourcedr init`."""
-    parser = parsers.add_parser('init', help='Start a new review project')
-    parser.add_argument('--project-dir', default='.')
-    parser.add_argument('--android-root', required=True,
-                        help='Android source tree root directory')
-    return run
-
-
-def run(args):
-    """Main function for `sourcedr init`."""
-
-    if args.project_dir == '.' and not _is_dir_empty(args.project_dir):
-        print('error: Current working directory is not an empty directory.',
-              file=sys.stderr)
-
-    project_dir = os.path.expanduser(args.project_dir)
-    source_dir = os.path.expanduser(args.android_root)
-
-    Project.get_or_create_project_dir(project_dir, source_dir)
diff --git a/vndk/tools/sourcedr/sourcedr/commands/review.py b/vndk/tools/sourcedr/sourcedr/commands/review.py
deleted file mode 100644
index 190183a..0000000
--- a/vndk/tools/sourcedr/sourcedr/commands/review.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python3
-
-"""`sourcedr review` command."""
-
-import os
-
-from sourcedr.project import Project
-from sourcedr.server import create_app
-
-
-def init_argparse(parsers):
-    """Initialize argument parser for `sourcedr init`."""
-    parser = parsers.add_parser('review', help='Open web-based review UI')
-    parser.add_argument('--project-dir', default='.')
-    parser.add_argument('--rebuild-csearch-index', action='store_true',
-                        help='Re-build the existing csearch index file')
-    return run
-
-
-def run(args):
-    """Main function for `sourcedr init`."""
-    project_dir = os.path.expanduser(args.project_dir)
-
-    project = Project(project_dir)
-    project.update_csearch_index(args.rebuild_csearch_index)
-    project.update_review_db()
-
-    app = create_app(project)
-    app.run()
diff --git a/vndk/tools/sourcedr/sourcedr/commands/scan.py b/vndk/tools/sourcedr/sourcedr/commands/scan.py
deleted file mode 100644
index 6bc5e81..0000000
--- a/vndk/tools/sourcedr/sourcedr/commands/scan.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python3
-
-"""`sourcedr scan` command."""
-
-
-def init_argparse(parsers):
-    """Initialize argument parser for `sourcedr scan`."""
-    parsers.add_parser('scan', help='Scan all pattern occurrences')
-    return run
-
-
-def run(_):
-    """Main function for `sourcedr scan`."""
-    print('error: Need human review.  Run: `sourcedr review`')
diff --git a/vndk/tools/sourcedr/sourcedr/defaults/pattern_db.csv b/vndk/tools/sourcedr/sourcedr/defaults/pattern_db.csv
deleted file mode 100644
index e5cfc12..0000000
--- a/vndk/tools/sourcedr/sourcedr/defaults/pattern_db.csv
+++ /dev/null
@@ -1 +0,0 @@
-1,\bdlopen\b
diff --git a/vndk/tools/sourcedr/sourcedr/defaults/sourcedr.json b/vndk/tools/sourcedr/sourcedr/defaults/sourcedr.json
deleted file mode 100644
index e2fe014..0000000
--- a/vndk/tools/sourcedr/sourcedr/defaults/sourcedr.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
-  "source_dir": "",
-  "file_ext_blacklist": [
-    ".1",
-    ".ac",
-    ".cmake",
-    ".html",
-    ".info",
-    ".la",
-    ".m4",
-    ".map",
-    ".md",
-    ".py",
-    ".rst",
-    ".sh",
-    ".sym",
-    ".txt",
-    ".xml"
-  ],
-  "file_name_blacklist": [
-    "CHANGES.0",
-    "ChangeLog",
-    "config.h.in",
-    "configure",
-    "configure.in",
-    "configure.linaro",
-    "libtool"
-  ],
-  "path_component_blacklist": [
-    ".git",
-    ".repo",
-    "autom4te.cache",
-    "binutils",
-    "dejagnu",
-    "llvm/Config/Config"
-  ]
-}
diff --git a/vndk/tools/sourcedr/sourcedr/map.py b/vndk/tools/sourcedr/sourcedr/map.py
deleted file mode 100644
index b9d8af9..0000000
--- a/vndk/tools/sourcedr/sourcedr/map.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/env python3
-
-"""This command maps source file review results to compiled binaries.
-"""
-
-import argparse
-import collections
-import itertools
-import json
-import os
-import sys
-
-from sourcedr import ninja
-from sourcedr.review_db import ReviewDB
-
-
-def load_build_dep_graph(graph):
-    # Collect all shared libraries
-    shared_libs = set()
-    for key, value in graph.items():
-        if key.split('.')[-1] == 'so':
-            shared_libs.add(key)
-        for v in value:
-            if v.split('.')[-1] == 'so':
-                shared_libs.add(v)
-
-    # Collect transitive closures
-    dep = {}
-    for s in shared_libs:
-        visited = set()
-        stack = [s]
-        while stack:
-            v = stack.pop()
-            if v not in visited:
-                visited.add(v)
-                try:
-                    stack.extend(x for x in graph[v]
-                                 if x not in visited and not x.endswith('.so')
-                                 and not x.endswith('.toc'))
-                except KeyError:
-                    pass
-        visited.remove(s)
-        dep[s] = visited
-
-    return dep
-
-
-def load_build_dep_ninja(ninja_path, work_dir, ninja_deps=None):
-    manifest = ninja.Parser().parse(ninja_path, 'utf-8', ninja_deps)
-    graph = collections.defaultdict(set)
-    for build in manifest.builds:
-        for path in itertools.chain(build.explicit_outs, build.implicit_outs):
-            ins = graph[path]
-            ins.update(build.explicit_ins)
-            ins.update(build.implicit_ins)
-            ins.update(build.depfile_implicit_ins)
-    return load_build_dep_graph(graph)
-
-
-def load_build_dep_file(fp):
-    return load_build_dep_graph(json.load(fp))
-
-
-def load_build_dep_file_from_path(path):
-    with open(path, 'r') as fp:
-        return load_build_dep_file(fp)
-
-
-def load_review_data(path):
-    table = collections.defaultdict(list)
-    review_db = ReviewDB(path, None)
-    for key, item in review_db.data.items():
-        table[key.split(':')[0]] += item[0]
-    return table
-
-
-def link_build_dep_and_review_data(dep, table):
-    res = collections.defaultdict(list)
-    for out, ins in dep.items():
-        try:
-            res[out] += table[out]
-        except KeyError:
-            pass
-
-        for in_file in ins:
-            try:
-                res[out] += table[in_file]
-            except KeyError:
-                pass
-    return res
diff --git a/vndk/tools/sourcedr/sourcedr/pattern_db.py b/vndk/tools/sourcedr/sourcedr/pattern_db.py
deleted file mode 100644
index b86ae94..0000000
--- a/vndk/tools/sourcedr/sourcedr/pattern_db.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python3
-
-
-import os
-
-
-class PatternDB(object):
-    """Pattern database for patterns to be searched in the source tree.
-    """
-
-    DEFAULT_NAME = 'pattern_db.csv'
-
-
-    @classmethod
-    def get_default_path(cls, project_dir):
-        return os.path.join(project_dir, cls.DEFAULT_NAME)
-
-
-    def __init__(self, path):
-        self.path = path
-        self.data = self._load()
-
-
-    def _load(self):
-        with open(self.path, 'r') as f:
-            patterns = []
-            is_regexs = []
-            for line in f:
-                line = line.rstrip('\n')
-                sp = line.split(',')
-                is_regexs.append(sp[0])
-                patterns.append(','.join(sp[1:]))
-        return (patterns, is_regexs)
-
-
-    def load(self):
-        self.data = self._load()
-        return self.data
-
-
-    def save_new_pattern(self, patt, is_regex):
-        """Add a pattern to the database."""
-        with open(self.path, 'a') as f:
-            f.write(str(int(is_regex)) + ',' + patt + '\n')
diff --git a/vndk/tools/sourcedr/sourcedr/project.py b/vndk/tools/sourcedr/sourcedr/project.py
deleted file mode 100644
index f6115bd..0000000
--- a/vndk/tools/sourcedr/sourcedr/project.py
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env python3
-
-"""SourceDR project configurations and databases.
-
-`Project` class holds configuration files, review databases, pattern databases,
-and `codesearch` index files.
-"""
-
-import collections
-import json
-import os
-import shutil
-
-from sourcedr.codesearch import CodeSearch, PathFilter
-from sourcedr.pattern_db import PatternDB
-from sourcedr.review_db import ReviewDB
-from sourcedr.utils import LockedFile
-
-
-class Config(object):
-    """SourceDR project configuration file."""
-
-    DEFAULT_NAME = 'sourcedr.json'
-
-    _PATH_TRAVERSAL_ATTRS = (
-            'file_ext_blacklist', 'file_name_blacklist',
-            'path_component_blacklist')
-
-
-    @classmethod
-    def get_default_path(cls, project_dir):
-        """Get the default path of the configuration file under a project
-        directory."""
-        return os.path.join(project_dir, cls.DEFAULT_NAME)
-
-
-    def __init__(self, path):
-        self.path = path
-
-        self.source_dir = None
-        self.file_ext_blacklist = set()
-        self.file_name_blacklist = set()
-        self.path_component_blacklist = set()
-
-
-    def load(self):
-        """Load the project configuration from the JSON file."""
-        with open(self.path, 'r') as config_fp:
-            config_json = json.load(config_fp)
-            for key, value in config_json.items():
-                if key == 'source_dir':
-                    self.source_dir = value
-                elif key in self._PATH_TRAVERSAL_ATTRS:
-                    setattr(self, key, set(value))
-                else:
-                    raise ValueError('unknown config name: ' + key)
-
-
-    def save(self):
-        """Save the project configuration to the JSON file."""
-        with LockedFile(self.path, 'x') as config_fp:
-            config = collections.OrderedDict()
-            config['source_dir'] = self.source_dir
-            for key in self._PATH_TRAVERSAL_ATTRS:
-                config[key] = sorted(getattr(self, key))
-            json.dump(config, config_fp, indent=2)
-
-
-class Project(object):
-    """SourceDR project configuration files and databases."""
-
-    def __init__(self, project_dir):
-        """Load a project from a given project directory."""
-
-        project_dir = os.path.abspath(project_dir)
-        self.project_dir = project_dir
-
-        if not os.path.isdir(project_dir):
-            raise ValueError('project directory not found: ' + project_dir)
-
-        # Load configuration files
-        config_path = Config.get_default_path(project_dir)
-        self.config = Config(config_path)
-        self.config.load()
-
-        # Recalculate source directory
-        self.source_dir = os.path.abspath(
-                os.path.join(project_dir, self.config.source_dir))
-
-        # csearchindex file
-        path_filter = PathFilter(self.config.file_ext_blacklist,
-                                 self.config.file_name_blacklist,
-                                 self.config.path_component_blacklist)
-        csearch_index_path = CodeSearch.get_default_path(project_dir)
-        self.codesearch = CodeSearch(self.source_dir, csearch_index_path,
-                                     path_filter)
-        self.codesearch.add_default_filters()
-
-        # Review database file
-        review_db_path = ReviewDB.get_default_path(project_dir)
-        self.review_db = ReviewDB(review_db_path, self.codesearch)
-
-        # Pattern database file
-        pattern_db_path = PatternDB.get_default_path(project_dir)
-        self.pattern_db = PatternDB(pattern_db_path)
-
-        # Sanity checks
-        self._check_source_dir()
-        self._check_lock_files()
-
-
-    def update_csearch_index(self, remove_existing_index):
-        """Create or update codesearch index."""
-        self.codesearch.build_index(remove_existing_index)
-
-
-    def update_review_db(self):
-        """Update the entries in the review database."""
-        patterns, is_regexs = self.pattern_db.load()
-        self.review_db.find(patterns, is_regexs)
-
-
-    def _check_source_dir(self):
-        """Check the availability of the source directory."""
-        if not os.path.isdir(self.source_dir):
-            raise ValueError('source directory not found: ' + self.source_dir)
-
-
-    def _check_lock_files(self):
-        """Check whether there are some lock files."""
-        for path in (self.config.path, self.review_db.path,
-                     self.pattern_db.path):
-            if LockedFile.is_locked(path):
-                raise ValueError('file locked: ' + path)
-
-
-    @classmethod
-    def create_project_dir(cls, project_dir, source_dir):
-        """Create a directory for a new project and setup default
-        configurations."""
-
-        if not os.path.isdir(source_dir):
-            raise ValueError('source directory not found: ' + source_dir)
-
-        os.makedirs(project_dir, exist_ok=True)
-
-        # Compute the relative path between project_dir and source_dir
-        project_dir = os.path.abspath(project_dir)
-        source_dir = os.path.relpath(os.path.abspath(source_dir), project_dir)
-
-        # Copy default files
-        defaults_dir = os.path.join(os.path.dirname(__file__), 'defaults')
-        for name in (Config.DEFAULT_NAME, PatternDB.DEFAULT_NAME):
-            shutil.copyfile(os.path.join(defaults_dir, name),
-                            os.path.join(project_dir, name))
-
-        # Update the source directory in the configuration file
-        config_path = Config.get_default_path(project_dir)
-        config = Config(config_path)
-        config.load()
-        config.source_dir = source_dir
-        config.save()
-
-        return Project(project_dir)
-
-
-    @classmethod
-    def get_or_create_project_dir(cls, project_dir, source_dir):
-        config_file_path = Config.get_default_path(project_dir)
-        if os.path.exists(config_file_path):
-            return Project(project_dir)
-        else:
-            return cls.create_project_dir(project_dir, source_dir)
diff --git a/vndk/tools/sourcedr/sourcedr/review_db.py b/vndk/tools/sourcedr/sourcedr/review_db.py
deleted file mode 100644
index d72965f..0000000
--- a/vndk/tools/sourcedr/sourcedr/review_db.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env python3
-
-import json
-import os
-import re
-
-
-class ReviewDB(object):
-    DEFAULT_NAME = 'review_db.json'
-
-
-    @classmethod
-    def get_default_path(cls, project_dir):
-        return os.path.join(project_dir, cls.DEFAULT_NAME)
-
-
-    def __init__(self, path, codesearch):
-        self.path = path
-        self._cs = codesearch
-        try:
-            self.data = self._load_data()
-        except FileNotFoundError:
-            self.data = {}
-
-
-    # patterns and is_regexs are lists
-    def find(self, patterns, is_regexs):
-        # they shouldn't be empty
-        assert patterns and is_regexs
-        processed = b''
-        for pattern, is_regex in zip(patterns, is_regexs):
-            if not is_regex:
-                pattern = re.escape(pattern)
-            raw_grep = self._cs.raw_grep(pattern)
-            if raw_grep == b'':
-                continue
-            processed += self._cs.process_grep(raw_grep, pattern, is_regex)
-        self.to_json(processed)
-
-
-    def add_pattern(self, pattern, is_regex):
-        if not is_regex:
-            pattern = re.escape(pattern)
-        raw_grep = self._cs.raw_grep(pattern)
-        if raw_grep == b'':
-            return
-        processed = self._cs.process_grep(raw_grep, pattern, is_regex)
-        self.add_to_json(processed)
-
-
-    def to_json(self, processed):
-        data = {}
-        patt = re.compile('([^:]+):(\\d+):(.*)$')
-        for line in processed.decode('utf-8').split('\n'):
-            match = patt.match(line)
-            if not match:
-                continue
-            data[line] = ([], [])
-
-        # if old data exists, perform merge
-        if os.path.exists(self.path):
-            data.update(self._load_data())
-
-        self._save_data(data)
-        self.data = self._load_data()
-
-
-    def add_to_json(self, processed):
-        # Load all matched grep.
-        data = self._load_data()
-        patt = re.compile('([^:]+):(\\d+):(.*)$')
-        for line in processed.decode('utf-8').split('\n'):
-            match = patt.match(line)
-            if not match:
-                continue
-            data[line] = ([], [])
-
-        self._save_data(data)
-        self.data = self._load_data()
-
-
-    def add_label(self, label, deps, codes):
-        self.data[label] = (deps, codes)
-        self._save_data(self.data)
-
-
-    def _save_data(self, data):
-        with open(self.path, 'w') as data_fp:
-            json.dump(data, data_fp, sort_keys=True, indent=4)
-
-
-    def _load_data(self):
-        with open(self.path, 'r') as data_fp:
-            return json.load(data_fp)
diff --git a/vndk/tools/sourcedr/sourcedr/server.py b/vndk/tools/sourcedr/sourcedr/server.py
deleted file mode 100644
index 5469efe..0000000
--- a/vndk/tools/sourcedr/sourcedr/server.py
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/env python3
-
-import collections
-import functools
-import json
-import os
-import re
-
-from flask import (
-    Blueprint, Flask, current_app, jsonify, render_template, request)
-
-
-codereview = Blueprint('codereview', '__name__', 'templates')
-
-
-# whether the code segment is exactly in file
-def same(fl, code, source_dir):
-    fl = os.path.join(source_dir, fl)
-    with open(fl, 'r') as f:
-        fc = f.read()
-        return code in fc
-
-
-# check if the file needes to be reiewed again
-def check(codes, source_dir):
-    ret = []
-    for item in codes:
-        fl = item.split(':')[0]
-        code = item[len(fl) + 1:]
-        ret.append(same(fl, code, source_dir))
-    return ret
-
-
-@codereview.route('/get_started')
-def _get_started():
-    project = current_app.config.project
-    source_dir = project.source_dir
-    review_db = project.review_db
-
-    lst, done= [], []
-    for key, item in sorted(review_db.data.items()):
-        lst.append(key)
-        if item[0]:
-            done.append(all(check(item[1], source_dir)))
-        else:
-            done.append(False)
-
-    pattern_lst = project.pattern_db.load()[0]
-    abs_path = os.path.abspath(source_dir)
-
-    return jsonify(lst=json.dumps(lst),
-                   done=json.dumps(done),
-                   pattern_lst=json.dumps(pattern_lst),
-                   path_prefix=os.path.join(abs_path, ''))
-
-
-@codereview.route('/load_file')
-def _load_file():
-    project = current_app.config.project
-    source_dir = project.source_dir
-    review_db = project.review_db
-
-    path = request.args.get('path')
-
-    if path not in review_db.data.keys():
-        print('No such entry', path)
-        return jsonify(result='')
-    deps, codes = review_db.data[path]
-
-    return jsonify(deps=json.dumps(deps), codes=json.dumps(codes),
-                   okays=json.dumps(check(codes, source_dir)))
-
-
-@codereview.route('/get_file')
-def _get_file():
-    path = request.args.get('path')
-    path = os.path.join(current_app.config.project.source_dir, path)
-
-    if not os.path.exists(path):
-        return jsonify(result='No such file')
-    with open(path, 'r') as f:
-        code = f.read()
-
-    return jsonify(result=code)
-
-
-@codereview.route('/save_all')
-def _save_all():
-    label = request.args.get('label')
-    deps = json.loads(request.args.get('deps'))
-    codes = json.loads(request.args.get('codes'))
-
-    project = current_app.config.project
-    review_db = project.review_db
-    review_db.add_label(label, deps, codes)
-
-    return jsonify(result='done')
-
-
-# This function add pattern to grep
-@codereview.route('/add_pattern')
-def _add_pattern():
-    patt = request.args.get('pattern')
-    is_regex = request.args.get('is_regex')
-    engine = current_app.config.project.review_db
-    engine.add_pattern(patt, is_regex)
-
-    project = current_app.config.project
-    project.pattern_db.save_new_pattern(patt, is_regex)
-    return jsonify(result='done')
-
-
-# This function does a temporary grep to the directory
-# Not adding the result to database
-@codereview.route('/temporary_search')
-def _temporary_search():
-    path = request.args.get('path')
-    patt = request.args.get('pattern')
-    is_regex = request.args.get('is_regex')
-    codesearch = current_app.config.project.codesearch
-    result = codesearch.raw_search(patt, is_regex).decode('utf-8')
-    dic = collections.defaultdict(list)
-    patt = re.compile('([^:]+):(\\d+):(.*)$')
-    for line in result.split('\n'):
-        match = patt.match(line)
-        if not match:
-            continue
-
-        file_path = match.group(1)
-        line_no = match.group(2)
-        code = match.group(3)
-        dic[file_path].append((line_no, code))
-
-    def compare(item1, item2):
-        key1, value1 = item1
-        key2, value2 = item2
-        cnt1 = os.path.commonprefix([path, key1]).count('/')
-        cnt2 = os.path.commonprefix([path, key2]).count('/')
-        e1 = os.path.relpath(key1, path).count('/')
-        e2 = os.path.relpath(key2, path).count('/')
-        # prefer smaller edit distance
-        if e1 < e2: return -1
-        if e2 < e1: return 1
-        # prefer deeper common ancestor
-        if cnt1 > cnt2: return -1
-        if cnt2 > cnt1: return 1
-        # lexicographical order
-        if key1 < key2: return -1
-        if key2 < key1: return 1
-        return 0
-
-    result = sorted(dic.items(), key=functools.cmp_to_key(compare))
-    return jsonify(result=json.dumps(result))
-
-
-@codereview.route('/')
-def render():
-    return render_template('index.html')
-
-
-def create_app(project):
-    app = Flask(__name__)
-    app.register_blueprint(codereview)
-    app.config.project = project
-    return app
diff --git a/vndk/tools/sourcedr/sourcedr/static/css/main.css b/vndk/tools/sourcedr/sourcedr/static/css/main.css
deleted file mode 100644
index 11bb7bc..0000000
--- a/vndk/tools/sourcedr/sourcedr/static/css/main.css
+++ /dev/null
@@ -1,26 +0,0 @@
-h3, h4 {
-    display: inline-block;
-}
-
-pre {
-    white-space: pre-wrap;       /* Since CSS 2.1 */
-    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
-    white-space: -pre-wrap;      /* Opera 4-6 */
-    white-space: -o-pre-wrap;    /* Opera 7 */
-    word-wrap: break-word;       /* Internet Explorer 5.5+ */
-    background-color: #ffffff;
-    margin: 0;
-}
-
-@media (min-width: 768px) {
-    .modal-xl {
-        width: 90%;
-        max-width:1200px;
-    }
-}
-
-.affix {
-  top:50px;
-  right:0;
-  position:fixed;
-}
diff --git a/vndk/tools/sourcedr/sourcedr/static/js/main.js b/vndk/tools/sourcedr/sourcedr/static/js/main.js
deleted file mode 100644
index e805705..0000000
--- a/vndk/tools/sourcedr/sourcedr/static/js/main.js
+++ /dev/null
@@ -1,333 +0,0 @@
-(function () {
-  'use strict';
-
-  var ccounter = 0;
-  var counter = 0;
-  var current_item = null;
-
-  // make item list sortable
-  $( function() {
-    $("#item_list").sortable();
-    $("#item_list").disableSelection();
-  });
-
-  function moveToTop(index) {
-    if (index == 0) {
-        return;
-    }
-    let target = $('#item_list').children().eq(index);
-    let tp = $('#item_list').children().eq(0);
-    let old_offset = target.position();
-    tp.before(target);
-    let new_offset = target.position();
-    let tmp = target.clone().appendTo('#item_list')
-                    .css('position', 'absolute')
-                    .css('left', old_offset.left)
-                    .css('top', old_offset.top);
-    target.hide();
-    let new_pos = {'top': new_offset.top, 'left': new_offset.left};
-    tmp.animate(new_pos, 'slow', function() {
-      target.show();
-      tmp.remove();
-    });
-  }
-
-  function getSelText() {
-    let txt = window.getSelection();
-    $('#selected_text').val(txt);
-    $('#code_file_path').val($('#browsing_file_path').text());
-    return txt;
-  }
-
-  function taskHtml(text, cnt) {
-    return '<li><span class="display" id="dep' + cnt + '">' + text +
-      '</span>' + '<input type="text" class="edit" style="display:none"/>' +
-      '<input type="submit" class="delete" value="X">' +'</li>';
-  }
-
-  function codeHtml(text, cnt, okay) {
-    return (okay? '<li>' : '<li style="color:red;">') +
-      '<span id="code' + cnt + '">' + text +
-      '</span><input type="submit" class="delete" value="X">' + '</li>';
-  }
-
-  function itemHtml(done, text) {
-    let atag = document.createElement('a');
-    atag.innerText = text;
-    if (done) {
-      atag.className = 'list-group-item list-group-item-success';
-    } else {
-      atag.className = 'list-group-item list-group-item-danger';
-    }
-    let pretag = document.createElement('pre');
-    pretag.appendChild(atag);
-    pretag.onclick = setItem;
-    return pretag;
-  }
-
-  function grepResultHtml(items) {
-    let ret = document.createElement('p');
-    for (let i = 0; i < items.length; i++) {
-      let path = document.createElement('span');
-      path.style.color = 'purple';
-      path.style.fontSize = '20px';
-      path.innerHTML = items[i][0];
-      ret.appendChild(path);
-      ret.appendChild(document.createElement('br'));
-      for (let j = 0; j < items[0][1].length; j++) {
-        let line_no = items[i][1][j][0];
-        let content = items[i][1][j][1];
-        let line_html = document.createElement('font');
-        line_html.style.color = 'green';
-        line_html.style.fontSize = '18px';
-        line_html.innerHTML = line_no + ':';
-        ret.appendChild(line_html);
-        let content_html = document.createElement('span');
-        content_html.style.fontSize = '18px';
-        content_html.appendChild(document.createTextNode(content));
-        ret.appendChild(content_html);
-        ret.appendChild(document.createElement('br'));
-      }
-    }
-    return ret;
-  }
-
-  function enterTask() {
-    let text = $('#enter_deps').val();
-    $('#deps_list').append(taskHtml(text, counter));
-    $('.delete').click(function () {
-      $(this).parent().remove();
-    });
-    counter++;
-    return false;
-  }
-
-  function setTask(deps) {
-    $('#deps_list').empty();
-    counter = 0;
-    let len = deps.length;
-    for (let i = 0; i < len; i++) {
-      let text = deps[i];
-      $('#deps_list').append(taskHtml(text, counter));
-      $('.delete').click(function () {
-        $(this).parent().remove();
-      });
-      counter++;
-    }
-  }
-
-  function enterCode() {
-    let text = $('#code_file_path').val() + ':' + $('#selected_text').val();
-    $('#code_list').append(codeHtml(text, ccounter, true));
-    $('.delete').click(function () {
-      $(this).parent().remove();
-    });
-    ccounter++;
-    return false;
-  }
-
-  function setCode(codes, okays) {
-    $('#code_list').empty();
-    ccounter = 0;
-    let len = codes.length;
-    for (let i = 0; i < len; i++) {
-      let text = codes[i];
-      $('#code_list').append(codeHtml(text, ccounter, okays[i]));
-      $('.delete').click(function () {
-        $(this).parent().remove();
-      });
-      ccounter++;
-    }
-  }
-
-  $(document).ready(onLoad);
-
-  function onLoad() {
-    $.getJSON('/get_started', {
-    }, function (data) {
-      $('#item_list').empty();
-      $('#pattern_list').empty();
-
-      const lst = JSON.parse(data.lst);
-      const done = JSON.parse(data.done);
-      const pattern_lst = JSON.parse(data.pattern_lst);
-      let len = done.length;
-      for (let i = 0; i < len; i++) {
-        $('#item_list').append(itemHtml(done[i], lst[i]));
-      }
-      len = pattern_lst.length;
-      for (let i = 0; i < len; i++) {
-        $('#pattern_list').append('<li>' + pattern_lst[i] + '</li>');
-      }
-      $('#path_prefix').text(data.path_prefix);
-    });
-  }
-
-  function saveAll() {
-    let path = $('#file_path').text();
-    let line_no = $('#line_no').text();
-
-    let deps = new Array();
-    for (let i = 0; i < counter; i++) {
-      if ($('#dep' + i).length) {
-        deps.push($('#dep' + i).text());
-      }
-    }
-    let codes = new Array();
-    for (let i = 0; i < ccounter; i++) {
-      if ($('#code' + i).length) {
-        codes.push($('#code' + i).text());
-      }
-    }
-
-    if (path == '' || line_no == '') {
-      return false;
-    }
-    if (deps.length > 0) {
-        current_item.className = 'list-group-item list-group-item-success';
-    } else {
-        current_item.className = 'list-group-item list-group-item-danger';
-    }
-    $.getJSON('/save_all', {
-      label: $(current_item).text(),
-      deps: JSON.stringify(deps),
-      codes: JSON.stringify(codes)
-    });
-    let target = $(current_item).text().split(':')[2];
-    let children = $('#item_list')[0].children;
-    let len = children.length;
-    for (let i = 0; i < len; i++) {
-        let tt = children[i].getElementsByTagName('a')[0].innerHTML;
-        if (tt == $(current_item).text()) {
-            continue;
-        }
-        if (children[i].getElementsByTagName('a')[0].className ==
-            'list-group-item list-group-item-success' ) {
-            continue;
-        }
-        let content = tt.split(':')[2];
-        if (content == target) {
-            moveToTop(i);
-        }
-    }
-    return false;
-  }
-
-  function setBrowsingFile(path) {
-    $('#browsing_file_path').text(path);
-    $.getJSON('/get_file', {
-      path: path
-    }, function (data) {
-      $('#browsing_file').children().first().text(data.result);
-      let obj = $('#browsing_file').children().first();
-      Prism.highlightElement($('#code')[0]);
-    });
-  }
-
-  function setHighlightLine(line_no) {
-    $('#browsing_file').attr('data-line', line_no);
-  }
-
-  function setGotoPatternLine(line_no) {
-    $('#goto_pattern_line').attr('href', '#browsing_file.' + line_no);
-  }
-
-  function unsetHighlightLine() {
-    $('#browsing_file').removeAttr('data-line');
-    // Add this line to ensure that all highlight divs are removed
-    $('.line-highlight').remove();
-  }
-
-  function removeAnchor() {
-    // Remove the # from the hash,
-    // as different browsers may or may not include it
-    var hash = location.hash.replace('#','');
-    if (hash != '') {
-      // Clear the hash in the URL
-      location.hash = '';
-    }
-  };
-
-  function setItem(evt) {
-    removeAnchor();
-    let item = evt.target;
-    current_item = item;
-    let name = $(item).text().split(':');
-    let file = name[0];
-    let line_no = name[1];
-    $('#file_path').text(file);
-    $('#line_no').text(line_no);
-
-    $.getJSON('/load_file', {
-      path: $(item).text()
-    }, function (data) {
-      let deps = JSON.parse(data.deps);
-      let codes = JSON.parse(data.codes);
-      let okays = JSON.parse(data.okays);
-      setTask(deps);
-      setCode(codes, okays);
-    });
-
-    setBrowsingFile(file);
-    setHighlightLine(line_no);
-    setGotoPatternLine(line_no);
-    $('#selected_text').val('');
-    $('#code_file_path').val('');
-    $('#enter_deps').val('');
-    $('html,body').scrollTop(0);
-    return false;
-  }
-
-  $('#go_form').submit(function () {
-    // get all the inputs into an array.
-    const $inputs = $('#go_form :input');
-    let values = {};
-    $inputs.each(function () {
-      values[this.name] = $(this).val();
-    });
-    let path = $('input[name="browsing_path"]').val();
-    setBrowsingFile(path);
-    unsetHighlightLine();
-    return false;
-  });
-
-  $('#add_pattern').submit(function () {
-    const $inputs = $('#add_pattern :input');
-    let values = {};
-    $inputs.each(function () {
-      values[this.name] = $(this).val();
-    });
-    $.getJSON('/add_pattern', {
-      pattern: values['pattern'],
-      is_regex: $('#is_regex').is(':checked') ? 1 : 0
-    });
-    return true;
-  });
-
-  $('#temporary_search').submit(function() {
-    const $inputs = $('#temporary_search :input');
-    let values = {};
-    $inputs.each(function () {
-      values[this.name] = $(this).val();
-    });
-    $('#modal_title').text(values['pattern']);
-    $.getJSON('/temporary_search', {
-      path: $('#file_path').text(),
-      pattern: values['pattern'],
-      is_regex: $('#is_regex2').is(':checked') ? 1 : 0
-    }, function (data) {
-        $('#modal_body').append(grepResultHtml(JSON.parse(data.result)));
-        $('#myModal').modal('show');
-    });
-    return false;
-  });
-  // clear previous html code in modal on hide
-  $('#myModal').on('hidden.bs.modal', function () {
-    $('#modal_body').empty();
-  })
-
-  $('#add_deps').submit(enterTask);
-  $('#add_code').submit(enterCode);
-  $('#save_all').submit(saveAll);
-  $('#get_selection').click(getSelText);
-})();
diff --git a/vndk/tools/sourcedr/sourcedr/static/prism/MODULE_LICENSE_MIT b/vndk/tools/sourcedr/sourcedr/static/prism/MODULE_LICENSE_MIT
deleted file mode 100644
index e69de29..0000000
--- a/vndk/tools/sourcedr/sourcedr/static/prism/MODULE_LICENSE_MIT
+++ /dev/null
diff --git a/vndk/tools/sourcedr/sourcedr/static/prism/css/prism.css b/vndk/tools/sourcedr/sourcedr/static/prism/css/prism.css
deleted file mode 100644
index c4af645..0000000
--- a/vndk/tools/sourcedr/sourcedr/static/prism/css/prism.css
+++ /dev/null
@@ -1,308 +0,0 @@
-/* http://prismjs.com/download.html?themes=prism-coy&languages=clike+c&plugins=line-highlight+line-numbers */
-/**
- * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
- * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
- * @author Tim  Shedor
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
-	color: black;
-	background: none;
-	font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
-	text-align: left;
-	white-space: pre;
-	word-spacing: normal;
-	word-break: normal;
-	word-wrap: normal;
-	line-height: 1.5;
-
-	-moz-tab-size: 4;
-	-o-tab-size: 4;
-	tab-size: 4;
-
-	-webkit-hyphens: none;
-	-moz-hyphens: none;
-	-ms-hyphens: none;
-	hyphens: none;
-}
-
-/* Code blocks */
-pre[class*="language-"] {
-	position: relative;
-	margin: .5em 0;
-	box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
-	border-left: 10px solid #358ccb;
-	background-color: #fdfdfd;
-	background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
-	background-size: 3em 3em;
-	background-origin: content-box;
-	overflow: visible;
-	padding: 0;
-}
-
-code[class*="language"] {
-	max-height: inherit;
-	height: 100%;
-	padding: 0 1em;
-	display: block;
-	overflow: auto;
-}
-
-/* Margin bottom to accomodate shadow */
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
-	background-color: #fdfdfd;
-	-webkit-box-sizing: border-box;
-	-moz-box-sizing: border-box;
-	box-sizing: border-box;
-	margin-bottom: 1em;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
-	position: relative;
-	padding: .2em;
-	border-radius: 0.3em;
-	color: #c92c2c;
-	border: 1px solid rgba(0, 0, 0, 0.1);
-	display: inline;
-	white-space: normal;
-}
-
-pre[class*="language-"]:before,
-pre[class*="language-"]:after {
-	content: '';
-	z-index: -2;
-	display: block;
-	position: absolute;
-	bottom: 0.75em;
-	left: 0.18em;
-	width: 40%;
-	height: 20%;
-	max-height: 13em;
-	box-shadow: 0px 13px 8px #979797;
-	-webkit-transform: rotate(-2deg);
-	-moz-transform: rotate(-2deg);
-	-ms-transform: rotate(-2deg);
-	-o-transform: rotate(-2deg);
-	transform: rotate(-2deg);
-}
-
-:not(pre) > code[class*="language-"]:after,
-pre[class*="language-"]:after {
-	right: 0.75em;
-	left: auto;
-	-webkit-transform: rotate(2deg);
-	-moz-transform: rotate(2deg);
-	-ms-transform: rotate(2deg);
-	-o-transform: rotate(2deg);
-	transform: rotate(2deg);
-}
-
-.token.comment,
-.token.block-comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
-	color: #7D8B99;
-}
-
-.token.punctuation {
-	color: #5F6364;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number,
-.token.function-name,
-.token.constant,
-.token.symbol,
-.token.deleted {
-	color: #c92c2c;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.function,
-.token.builtin,
-.token.inserted {
-	color: #2f9c0a;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.token.variable {
-	color: #a67f59;
-	background: rgba(255, 255, 255, 0.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword,
-.token.class-name {
-	color: #1990b8;
-}
-
-.token.regex,
-.token.important {
-	color: #e90;
-}
-
-.language-css .token.string,
-.style .token.string {
-	color: #a67f59;
-	background: rgba(255, 255, 255, 0.5);
-}
-
-.token.important {
-	font-weight: normal;
-}
-
-.token.bold {
-	font-weight: bold;
-}
-.token.italic {
-	font-style: italic;
-}
-
-.token.entity {
-	cursor: help;
-}
-
-.namespace {
-	opacity: .7;
-}
-
-@media screen and (max-width: 767px) {
-	pre[class*="language-"]:before,
-	pre[class*="language-"]:after {
-		bottom: 14px;
-		box-shadow: none;
-	}
-
-}
-
-/* Plugin styles */
-.token.tab:not(:empty):before,
-.token.cr:before,
-.token.lf:before {
-	color: #e0d7d1;
-}
-
-/* Plugin styles: Line Numbers */
-pre[class*="language-"].line-numbers {
-	padding-left: 0;
-}
-
-pre[class*="language-"].line-numbers code {
-	padding-left: 3.8em;
-}
-
-pre[class*="language-"].line-numbers .line-numbers-rows {
-	left: 0;
-}
-
-/* Plugin styles: Line Highlight */
-pre[class*="language-"][data-line] {
-	padding-top: 0;
-	padding-bottom: 0;
-	padding-left: 0;
-}
-pre[data-line] code {
-	position: relative;
-	padding-left: 4em;
-}
-pre .line-highlight {
-	margin-top: 0;
-}
-
-pre[data-line] {
-	position: relative;
-	padding: 1em 0 1em 3em;
-}
-
-.line-highlight {
-	position: absolute;
-	left: 0;
-	right: 0;
-	padding: inherit 0;
-	margin-top: 1em; /* Same as .prism’s padding-top */
-
-	background: hsla(24, 20%, 50%,.08);
-	background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
-
-	pointer-events: none;
-
-	line-height: inherit;
-	white-space: pre;
-}
-
-	.line-highlight:before,
-	.line-highlight[data-end]:after {
-		content: attr(data-start);
-		position: absolute;
-		top: .4em;
-		left: .6em;
-		min-width: 1em;
-		padding: 0 .5em;
-		background-color: hsla(24, 20%, 50%,.4);
-		color: hsl(24, 20%, 95%);
-		font: bold 65%/1.5 sans-serif;
-		text-align: center;
-		vertical-align: .3em;
-		border-radius: 999px;
-		text-shadow: none;
-		box-shadow: 0 1px white;
-	}
-
-	.line-highlight[data-end]:after {
-		content: attr(data-end);
-		top: auto;
-		bottom: .4em;
-	}
-
-pre.line-numbers {
-	position: relative;
-	padding-left: 3.8em;
-	counter-reset: linenumber;
-}
-
-pre.line-numbers > code {
-	position: relative;
-}
-
-.line-numbers .line-numbers-rows {
-	position: absolute;
-	pointer-events: none;
-	top: 0;
-	font-size: 100%;
-	left: -3.8em;
-	width: 3em; /* works for line-numbers below 1000 lines */
-	letter-spacing: -1px;
-	border-right: 1px solid #999;
-
-	-webkit-user-select: none;
-	-moz-user-select: none;
-	-ms-user-select: none;
-	user-select: none;
-
-}
-
-	.line-numbers-rows > span {
-		pointer-events: none;
-		display: block;
-		counter-increment: linenumber;
-	}
-
-		.line-numbers-rows > span:before {
-			content: counter(linenumber);
-			color: #999;
-			display: block;
-			padding-right: 0.8em;
-			text-align: right;
-		}
diff --git a/vndk/tools/sourcedr/sourcedr/static/prism/js/prism.js b/vndk/tools/sourcedr/sourcedr/static/prism/js/prism.js
deleted file mode 100644
index 743a225..0000000
--- a/vndk/tools/sourcedr/sourcedr/static/prism/js/prism.js
+++ /dev/null
@@ -1,824 +0,0 @@
-/* http://prismjs.com/download.html?themes=prism-coy&languages=clike+c&plugins=line-highlight+line-numbers */
-var _self = (typeof window !== 'undefined')
-	? window   // if in browser
-	: (
-		(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
-		? self // if in worker
-		: {}   // if in node js
-	);
-
-/**
- * Prism: Lightweight, robust, elegant syntax highlighting
- * MIT license http://www.opensource.org/licenses/mit-license.php/
- * @author Lea Verou http://lea.verou.me
- */
-
-var Prism = (function(){
-
-// Private helper vars
-var lang = /\blang(?:uage)?-(\w+)\b/i;
-var uniqueId = 0;
-
-var _ = _self.Prism = {
-	manual: _self.Prism && _self.Prism.manual,
-	util: {
-		encode: function (tokens) {
-			if (tokens instanceof Token) {
-				return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
-			} else if (_.util.type(tokens) === 'Array') {
-				return tokens.map(_.util.encode);
-			} else {
-				return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
-			}
-		},
-
-		type: function (o) {
-			return Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1];
-		},
-
-		objId: function (obj) {
-			if (!obj['__id']) {
-				Object.defineProperty(obj, '__id', { value: ++uniqueId });
-			}
-			return obj['__id'];
-		},
-
-		// Deep clone a language definition (e.g. to extend it)
-		clone: function (o) {
-			var type = _.util.type(o);
-
-			switch (type) {
-				case 'Object':
-					var clone = {};
-
-					for (var key in o) {
-						if (o.hasOwnProperty(key)) {
-							clone[key] = _.util.clone(o[key]);
-						}
-					}
-
-					return clone;
-
-				case 'Array':
-					// Check for existence for IE8
-					return o.map && o.map(function(v) { return _.util.clone(v); });
-			}
-
-			return o;
-		}
-	},
-
-	languages: {
-		extend: function (id, redef) {
-			var lang = _.util.clone(_.languages[id]);
-
-			for (var key in redef) {
-				lang[key] = redef[key];
-			}
-
-			return lang;
-		},
-
-		/**
-		 * Insert a token before another token in a language literal
-		 * As this needs to recreate the object (we cannot actually insert before keys in object literals),
-		 * we cannot just provide an object, we need anobject and a key.
-		 * @param inside The key (or language id) of the parent
-		 * @param before The key to insert before. If not provided, the function appends instead.
-		 * @param insert Object with the key/value pairs to insert
-		 * @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
-		 */
-		insertBefore: function (inside, before, insert, root) {
-			root = root || _.languages;
-			var grammar = root[inside];
-
-			if (arguments.length == 2) {
-				insert = arguments[1];
-
-				for (var newToken in insert) {
-					if (insert.hasOwnProperty(newToken)) {
-						grammar[newToken] = insert[newToken];
-					}
-				}
-
-				return grammar;
-			}
-
-			var ret = {};
-
-			for (var token in grammar) {
-
-				if (grammar.hasOwnProperty(token)) {
-
-					if (token == before) {
-
-						for (var newToken in insert) {
-
-							if (insert.hasOwnProperty(newToken)) {
-								ret[newToken] = insert[newToken];
-							}
-						}
-					}
-
-					ret[token] = grammar[token];
-				}
-			}
-
-			// Update references in other language definitions
-			_.languages.DFS(_.languages, function(key, value) {
-				if (value === root[inside] && key != inside) {
-					this[key] = ret;
-				}
-			});
-
-			return root[inside] = ret;
-		},
-
-		// Traverse a language definition with Depth First Search
-		DFS: function(o, callback, type, visited) {
-			visited = visited || {};
-			for (var i in o) {
-				if (o.hasOwnProperty(i)) {
-					callback.call(o, i, o[i], type || i);
-
-					if (_.util.type(o[i]) === 'Object' && !visited[_.util.objId(o[i])]) {
-						visited[_.util.objId(o[i])] = true;
-						_.languages.DFS(o[i], callback, null, visited);
-					}
-					else if (_.util.type(o[i]) === 'Array' && !visited[_.util.objId(o[i])]) {
-						visited[_.util.objId(o[i])] = true;
-						_.languages.DFS(o[i], callback, i, visited);
-					}
-				}
-			}
-		}
-	},
-	plugins: {},
-
-	highlightAll: function(async, callback) {
-		var env = {
-			callback: callback,
-			selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
-		};
-
-		_.hooks.run("before-highlightall", env);
-
-		var elements = env.elements || document.querySelectorAll(env.selector);
-
-		for (var i=0, element; element = elements[i++];) {
-			_.highlightElement(element, async === true, env.callback);
-		}
-	},
-
-	highlightElement: function(element, async, callback) {
-		// Find language
-		var language, grammar, parent = element;
-
-		while (parent && !lang.test(parent.className)) {
-			parent = parent.parentNode;
-		}
-
-		if (parent) {
-			language = (parent.className.match(lang) || [,''])[1].toLowerCase();
-			grammar = _.languages[language];
-		}
-
-		// Set language on the element, if not present
-		element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
-
-		// Set language on the parent, for styling
-		parent = element.parentNode;
-
-		if (/pre/i.test(parent.nodeName)) {
-			parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
-		}
-
-		var code = element.textContent;
-
-		var env = {
-			element: element,
-			language: language,
-			grammar: grammar,
-			code: code
-		};
-
-		_.hooks.run('before-sanity-check', env);
-
-		if (!env.code || !env.grammar) {
-			if (env.code) {
-				_.hooks.run('before-highlight', env);
-				env.element.textContent = env.code;
-				_.hooks.run('after-highlight', env);
-			}
-			_.hooks.run('complete', env);
-			return;
-		}
-
-		_.hooks.run('before-highlight', env);
-
-		if (async && _self.Worker) {
-			var worker = new Worker(_.filename);
-
-			worker.onmessage = function(evt) {
-				env.highlightedCode = evt.data;
-
-				_.hooks.run('before-insert', env);
-
-				env.element.innerHTML = env.highlightedCode;
-
-				callback && callback.call(env.element);
-				_.hooks.run('after-highlight', env);
-				_.hooks.run('complete', env);
-			};
-
-			worker.postMessage(JSON.stringify({
-				language: env.language,
-				code: env.code,
-				immediateClose: true
-			}));
-		}
-		else {
-			env.highlightedCode = _.highlight(env.code, env.grammar, env.language);
-
-			_.hooks.run('before-insert', env);
-
-			env.element.innerHTML = env.highlightedCode;
-
-			callback && callback.call(element);
-
-			_.hooks.run('after-highlight', env);
-			_.hooks.run('complete', env);
-		}
-	},
-
-	highlight: function (text, grammar, language) {
-		var tokens = _.tokenize(text, grammar);
-		return Token.stringify(_.util.encode(tokens), language);
-	},
-
-	matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) {
-		var Token = _.Token;
-
-		for (var token in grammar) {
-			if(!grammar.hasOwnProperty(token) || !grammar[token]) {
-				continue;
-			}
-
-			if (token == target) {
-				return;
-			}
-
-			var patterns = grammar[token];
-			patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns];
-
-			for (var j = 0; j < patterns.length; ++j) {
-				var pattern = patterns[j],
-					inside = pattern.inside,
-					lookbehind = !!pattern.lookbehind,
-					greedy = !!pattern.greedy,
-					lookbehindLength = 0,
-					alias = pattern.alias;
-
-				if (greedy && !pattern.pattern.global) {
-					// Without the global flag, lastIndex won't work
-					var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
-					pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
-				}
-
-				pattern = pattern.pattern || pattern;
-
-				// Don’t cache length as it changes during the loop
-				for (var i = index, pos = startPos; i < strarr.length; pos += strarr[i].length, ++i) {
-
-					var str = strarr[i];
-
-					if (strarr.length > text.length) {
-						// Something went terribly wrong, ABORT, ABORT!
-						return;
-					}
-
-					if (str instanceof Token) {
-						continue;
-					}
-
-					pattern.lastIndex = 0;
-
-					var match = pattern.exec(str),
-					    delNum = 1;
-
-					// Greedy patterns can override/remove up to two previously matched tokens
-					if (!match && greedy && i != strarr.length - 1) {
-						pattern.lastIndex = pos;
-						match = pattern.exec(text);
-						if (!match) {
-							break;
-						}
-
-						var from = match.index + (lookbehind ? match[1].length : 0),
-						    to = match.index + match[0].length,
-						    k = i,
-						    p = pos;
-
-						for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {
-							p += strarr[k].length;
-							// Move the index i to the element in strarr that is closest to from
-							if (from >= p) {
-								++i;
-								pos = p;
-							}
-						}
-
-						/*
-						 * If strarr[i] is a Token, then the match starts inside another Token, which is invalid
-						 * If strarr[k - 1] is greedy we are in conflict with another greedy pattern
-						 */
-						if (strarr[i] instanceof Token || strarr[k - 1].greedy) {
-							continue;
-						}
-
-						// Number of tokens to delete and replace with the new match
-						delNum = k - i;
-						str = text.slice(pos, p);
-						match.index -= pos;
-					}
-
-					if (!match) {
-						if (oneshot) {
-							break;
-						}
-
-						continue;
-					}
-
-					if(lookbehind) {
-						lookbehindLength = match[1].length;
-					}
-
-					var from = match.index + lookbehindLength,
-					    match = match[0].slice(lookbehindLength),
-					    to = from + match.length,
-					    before = str.slice(0, from),
-					    after = str.slice(to);
-
-					var args = [i, delNum];
-
-					if (before) {
-						++i;
-						pos += before.length;
-						args.push(before);
-					}
-
-					var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
-
-					args.push(wrapped);
-
-					if (after) {
-						args.push(after);
-					}
-
-					Array.prototype.splice.apply(strarr, args);
-
-					if (delNum != 1)
-						_.matchGrammar(text, strarr, grammar, i, pos, true, token);
-
-					if (oneshot)
-						break;
-				}
-			}
-		}
-	},
-
-	tokenize: function(text, grammar, language) {
-		var strarr = [text];
-
-		var rest = grammar.rest;
-
-		if (rest) {
-			for (var token in rest) {
-				grammar[token] = rest[token];
-			}
-
-			delete grammar.rest;
-		}
-
-		_.matchGrammar(text, strarr, grammar, 0, 0, false);
-
-		return strarr;
-	},
-
-	hooks: {
-		all: {},
-
-		add: function (name, callback) {
-			var hooks = _.hooks.all;
-
-			hooks[name] = hooks[name] || [];
-
-			hooks[name].push(callback);
-		},
-
-		run: function (name, env) {
-			var callbacks = _.hooks.all[name];
-
-			if (!callbacks || !callbacks.length) {
-				return;
-			}
-
-			for (var i=0, callback; callback = callbacks[i++];) {
-				callback(env);
-			}
-		}
-	}
-};
-
-var Token = _.Token = function(type, content, alias, matchedStr, greedy) {
-	this.type = type;
-	this.content = content;
-	this.alias = alias;
-	// Copy of the full string this token was created from
-	this.length = (matchedStr || "").length|0;
-	this.greedy = !!greedy;
-};
-
-Token.stringify = function(o, language, parent) {
-	if (typeof o == 'string') {
-		return o;
-	}
-
-	if (_.util.type(o) === 'Array') {
-		return o.map(function(element) {
-			return Token.stringify(element, language, o);
-		}).join('');
-	}
-
-	var env = {
-		type: o.type,
-		content: Token.stringify(o.content, language, parent),
-		tag: 'span',
-		classes: ['token', o.type],
-		attributes: {},
-		language: language,
-		parent: parent
-	};
-
-	if (env.type == 'comment') {
-		env.attributes['spellcheck'] = 'true';
-	}
-
-	if (o.alias) {
-		var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias];
-		Array.prototype.push.apply(env.classes, aliases);
-	}
-
-	_.hooks.run('wrap', env);
-
-	var attributes = Object.keys(env.attributes).map(function(name) {
-		return name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
-	}).join(' ');
-
-	return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';
-
-};
-
-if (!_self.document) {
-	if (!_self.addEventListener) {
-		// in Node.js
-		return _self.Prism;
-	}
- 	// In worker
-	_self.addEventListener('message', function(evt) {
-		var message = JSON.parse(evt.data),
-		    lang = message.language,
-		    code = message.code,
-		    immediateClose = message.immediateClose;
-
-		_self.postMessage(_.highlight(code, _.languages[lang], lang));
-		if (immediateClose) {
-			_self.close();
-		}
-	}, false);
-
-	return _self.Prism;
-}
-
-//Get current script and highlight
-var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();
-
-if (script) {
-	_.filename = script.src;
-
-	if (document.addEventListener && !_.manual && !script.hasAttribute('data-manual')) {
-		if(document.readyState !== "loading") {
-			if (window.requestAnimationFrame) {
-				window.requestAnimationFrame(_.highlightAll);
-			} else {
-				window.setTimeout(_.highlightAll, 16);
-			}
-		}
-		else {
-			document.addEventListener('DOMContentLoaded', _.highlightAll);
-		}
-	}
-}
-
-return _self.Prism;
-
-})();
-
-if (typeof module !== 'undefined' && module.exports) {
-	module.exports = Prism;
-}
-
-// hack for components to work correctly in node.js
-if (typeof global !== 'undefined') {
-	global.Prism = Prism;
-}
-;
-Prism.languages.clike = {
-	'comment': [
-		{
-			pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
-			lookbehind: true
-		},
-		{
-			pattern: /(^|[^\\:])\/\/.*/,
-			lookbehind: true
-		}
-	],
-	'string': {
-		pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
-		greedy: true
-	},
-	'class-name': {
-		pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,
-		lookbehind: true,
-		inside: {
-			punctuation: /(\.|\\)/
-		}
-	},
-	'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
-	'boolean': /\b(true|false)\b/,
-	'function': /[a-z0-9_]+(?=\()/i,
-	'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
-	'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
-	'punctuation': /[{}[\];(),.:]/
-};
-
-Prism.languages.c = Prism.languages.extend('clike', {
-	'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
-	'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
-	'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
-});
-
-Prism.languages.insertBefore('c', 'string', {
-	'macro': {
-		// allow for multiline macro definitions
-		// spaces after the # character compile fine with gcc
-		pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
-		lookbehind: true,
-		alias: 'property',
-		inside: {
-			// highlight the path of the include statement as a string
-			'string': {
-				pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
-				lookbehind: true
-			},
-			// highlight macro directives as keywords
-			'directive': {
-				pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,
-				lookbehind: true,
-				alias: 'keyword'
-			}
-		}
-	},
-	// highlight predefined macros as constants
-	'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/
-});
-
-delete Prism.languages.c['class-name'];
-delete Prism.languages.c['boolean'];
-
-(function(){
-
-if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) {
-	return;
-}
-
-function $$(expr, con) {
-	return Array.prototype.slice.call((con || document).querySelectorAll(expr));
-}
-
-function hasClass(element, className) {
-  className = " " + className + " ";
-  return (" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf(className) > -1
-}
-
-// Some browsers round the line-height, others don't.
-// We need to test for it to position the elements properly.
-var isLineHeightRounded = (function() {
-	var res;
-	return function() {
-		if(typeof res === 'undefined') {
-			var d = document.createElement('div');
-			d.style.fontSize = '13px';
-			d.style.lineHeight = '1.5';
-			d.style.padding = 0;
-			d.style.border = 0;
-			d.innerHTML = '&nbsp;<br />&nbsp;';
-			document.body.appendChild(d);
-			// Browsers that round the line-height should have offsetHeight === 38
-			// The others should have 39.
-			res = d.offsetHeight === 38;
-			document.body.removeChild(d);
-		}
-		return res;
-	}
-}());
-
-function getOffsetById(id) {
-	var element = document.getElementById(id);
-	var bodyRect = document.body.getBoundingClientRect();
-	var elemRect = element.getBoundingClientRect();
-	var elementOffset = elemRect.top - bodyRect.top;
-	return elementOffset;
-}
-
-function highlightLines(pre, lines, classes) {
-	var ranges = lines.replace(/\s+/g, '').split(',');
-	var offset = getOffsetById('browsing_file');
-
-	var parseMethod = isLineHeightRounded() ? parseInt : parseFloat;
-	var lineHeight = parseMethod(getComputedStyle(pre).lineHeight);
-
-	for (var i=0, range; range = ranges[i++];) {
-		range = range.split('-');
-
-		var start = +range[0],
-		    end = +range[1] || start;
-
-		var line = document.createElement('div');
-
-		line.textContent = Array(end - start + 2).join(' \n');
-		line.setAttribute('aria-hidden', 'true');
-		line.className = (classes || '') + ' line-highlight';
-
-		//if the line-numbers plugin is enabled, then there is no reason for this plugin to display the line numbers
-		if(!hasClass(pre, 'line-numbers')) {
-			line.setAttribute('data-start', start);
-
-			if(end > start) {
-				line.setAttribute('data-end', end);
-			}
-		}
-
-		line.style.top = (getOffsetById('line_no' + start) - offset) + 'px';
-
-		//allow this to play nicely with the line-numbers plugin
-		if(hasClass(pre, 'line-numbers')) {
-			//need to attack to pre as when line-numbers is enabled, the code tag is relatively which screws up the positioning
-			pre.appendChild(line);
-		} else {
-			(pre.querySelector('code') || pre).appendChild(line);
-		}
-	}
-}
-
-function applyHash() {
-	var hash = location.hash.slice(1);
-
-	// Remove pre-existing temporary lines
-	$$('.temporary.line-highlight').forEach(function (line) {
-		line.parentNode.removeChild(line);
-	});
-
-	var range = (hash.match(/\.([\d,-]+)$/) || [,''])[1];
-
-	if (!range || document.getElementById(hash)) {
-		return;
-	}
-
-	var id = hash.slice(0, hash.lastIndexOf('.')),
-	    pre = document.getElementById(id);
-
-	if (!pre) {
-		return;
-	}
-
-	if (!pre.hasAttribute('data-line')) {
-		pre.setAttribute('data-line', '');
-	}
-
-	highlightLines(pre, range, 'temporary ');
-
-	document.querySelector('.temporary.line-highlight').scrollIntoView();
-}
-
-var fakeTimer = 0; // Hack to limit the number of times applyHash() runs
-
-Prism.hooks.add('before-sanity-check', function(env) {
-	var pre = env.element.parentNode;
-	var lines = pre && pre.getAttribute('data-line');
-
-	if (!pre || !lines || !/pre/i.test(pre.nodeName)) {
-		return;
-	}
-
-	/*
-	 * Cleanup for other plugins (e.g. autoloader).
-	 *
-	 * Sometimes <code> blocks are highlighted multiple times. It is necessary
-	 * to cleanup any left-over tags, because the whitespace inside of the <div>
-	 * tags change the content of the <code> tag.
-	 */
-	var num = 0;
-	$$('.line-highlight', pre).forEach(function (line) {
-		num += line.textContent.length;
-		line.parentNode.removeChild(line);
-	});
-
-	// Remove extra whitespace
-	if (num && /^( \n)+$/.test(env.code.slice(-num))) {
-		env.code = env.code.slice(0, -num);
-	}
-});
-
-Prism.hooks.add('complete', function (env) {
-	if (!env.code) {
-		return;
-	}
-
-	// works only for <code> wrapped inside <pre> (not inline)
-	var pre = env.element.parentNode;
-	var clsReg = /\s*\bline-numbers\b\s*/;
-	if (
-		!pre || !/pre/i.test(pre.nodeName) ||
-			// Abort only if nor the <pre> nor the <code> have the class
-		(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
-	) {
-		return;
-	}
-
-	if (env.element.querySelector(".line-numbers-rows")) {
-		// Abort if line numbers already exists
-		return;
-	}
-
-	if (clsReg.test(env.element.className)) {
-		// Remove the class "line-numbers" from the <code>
-		env.element.className = env.element.className.replace(clsReg, '');
-	}
-	if (!clsReg.test(pre.className)) {
-		// Add the class "line-numbers" to the <pre>
-		pre.className += ' line-numbers';
-	}
-
-	var match = env.code.match(/\n(?!$)/g);
-	var linesNum = match ? match.length + 1 : 1;
-	var lineNumbersWrapper;
-
-	var lines = '';
-	for (let i = 1; i < linesNum + 1; i++) {
-		lines += '<span id="line_no' + i + '"></span>';
-	}
-
-	lineNumbersWrapper = document.createElement('span');
-	lineNumbersWrapper.setAttribute('aria-hidden', 'true');
-	lineNumbersWrapper.className = 'line-numbers-rows';
-	lineNumbersWrapper.innerHTML = lines;
-
-	if (pre.hasAttribute('data-start')) {
-		pre.style.counterReset = 'linenumber ' + (parseInt(pre.getAttribute('data-start'), 10) - 1);
-	}
-
-	env.element.appendChild(lineNumbersWrapper);
-
-});
-
-Prism.hooks.add('complete', function(env) {
-	var pre = env.element.parentNode;
-	var lines = pre && pre.getAttribute('data-line');
-
-	if (!pre || !lines || !/pre/i.test(pre.nodeName)) {
-		return;
-	}
-
-	clearTimeout(fakeTimer);
-
-	highlightLines(pre, lines);
-
-	fakeTimer = setTimeout(applyHash, 1);
-});
-
-if(window.addEventListener) {
-	window.addEventListener('hashchange', applyHash);
-}
-
-})();
-
-(function() {
-
-if (typeof self === 'undefined' || !self.Prism || !self.document) {
-	return;
-}
-
-}());
diff --git a/vndk/tools/sourcedr/sourcedr/templates/index.html b/vndk/tools/sourcedr/sourcedr/templates/index.html
deleted file mode 100644
index f03ced3..0000000
--- a/vndk/tools/sourcedr/sourcedr/templates/index.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <title>Source Deps Reviewer</title>
-  <meta charset="utf-8"/>
-  <meta name="viewport" content="width=device-width, initial-scale=1"/>
-  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
-  <link rel="stylesheet" href="static/prism/css/prism.css"/>
-  <link rel="stylesheet" href="static/css/main.css"/>
-  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
-  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
-  <!-- Added for sortable list -->
-  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
-</head>
-<body>
-
-<div class="container-fluid">
-  <div class="row content">
-    <h2 style="padding-left:20px;">Code review tool</h2>
-    <ol id="item_list" class="col-sm-3"></ol>
-
-    <div class="col-sm-5">
-      <h3>Browsing:</h3>
-      <pre><h4 id="browsing_file_path"></h4></pre><br>
-      <form id="go_form">
-        <div class="input-group" style="margin-bottom:10px;">
-          <span class="input-group-addon" id="path_prefix"></span>
-          <input type="text" class="form-control" name="browsing_path" placeholder="Enter file path here" aria-describedby="path_prefix">
-        </div>
-        <input class="btn btn-primary" type="submit" name="go" value="GO"/>
-        <a class="btn btn-link" id="goto_pattern_line">goto pattern line</a>
-        <pre id="browsing_file" class="line-numbers"><code id="code" class="language-C" style="display:inline-block;"></code></pre>
-      </form>
-    </div>
-    <br>
-
-    <div class="col-sm-4" data-spy="affix">
-
-      <div class="well">
-        <h3>Temporary search</h3>
-        <form id="temporary_search" class="input-group" style="padding-left:20px;">
-          <span class="input-group-addon">is regex</span>
-          <span class="input-group-addon">
-            <input type="checkbox" name="is_regex2" id="is_regex2">
-          </span>
-          <input type="text" name="pattern" class="form-control">
-        </form>
-        <h3>Add patterns to grep</h3>
-        <form id="add_pattern" class="input-group" style="padding-left:20px;">
-          <span class="input-group-addon">is regex</span>
-          <span class="input-group-addon">
-            <input type="checkbox" name="is_regex" id="is_regex">
-          </span>
-          <input type="text" name="pattern" class="form-control">
-        </form>
-        <ul id="pattern_list"></ul>
-      </div>
-      <div class="well">
-        <h3>File labeling:</h3>
-        <pre style="padding-left:20px;"><h4 id="file_path"></h4></pre>
-        <h3>Pattern line number:</h3>
-        <h3 id="line_no"></h3><br>
-        <h3>Library Dependencies</h3>
-        <form id="add_deps" class="input-group">
-          <input type="text" class="form-control" id="enter_deps" placeholder="Fill in * if undetermined"/>
-          <span class="input-group-btn">
-            <input class="btn btn-secondary" type="submit" value="Add"/>
-          </span>
-        </form>
-        <ul id="deps_list"></ul>
-        <h3>Code Dependencies</h3>
-        <form id="add_code">
-          <input class="btn btn-secondary" type="button" id="get_selection" value="Get selection"/>
-          <input class="btn btn-secondary" type="submit" id="add_code" value="Add"/><br>
-          <input type="text" id="code_file_path" style="margin: 0px; width: 100%;"/>
-          <textarea id="selected_text" name="selectedtext" rows="5" style="margin: 0px; width: 100%; height: 106px;"></textarea>
-        </form>
-        <ul id="code_list"></ul>
-        <form id="save_all">
-          <input class="btn btn-secondary" type="submit" value="Save All"/>
-        </form>
-      </div>
-    </div>
-  </div>
-</div>
-
-<!-- Modal -->
-<div class="modal fade" id="myModal" role="dialog">
-  <div class="modal-dialog modal-xl">
-    <!-- Modal content-->
-    <div class="modal-content">
-      <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal">&times;</button>
-        <h4 id="modal_title" class="modal-title"></h4>
-      </div>
-      <div id="modal_body" class="modal-body">
-      </div>
-      <div class="modal-footer">
-        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-      </div>
-    </div>
-  </div>
-</div>
-
-<script type="text/javascript" src="static/js/main.js"></script>
-<!-- for code prettyify -->
-<script src="static/prism/js/prism.js"></script>
-
-</body>
-</html>
-
diff --git a/vndk/tools/sourcedr/sourcedr/tests/test_map.py b/vndk/tools/sourcedr/sourcedr/tests/test_map.py
deleted file mode 100644
index c30a898..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/test_map.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import unittest
-
-from sourcedr.map import (
-    link_build_dep_and_review_data, load_build_dep_file_from_path,
-    load_build_dep_ninja, load_review_data)
-
-
-TESTDATA_DIR = os.path.join(os.path.dirname(__file__), 'testdata')
-
-
-class MapTest(unittest.TestCase):
-    MAP_TESTDATA_DIR = os.path.join(TESTDATA_DIR, 'map')
-    DEP_PATH = os.path.join(MAP_TESTDATA_DIR, 'build_dep.json')
-    REVIEW_DB_PATH = os.path.join(MAP_TESTDATA_DIR, 'data.json')
-    NINJA_PATH = os.path.join(MAP_TESTDATA_DIR, 'build.ninja')
-    NINJA_DEP_PATH = os.path.join(MAP_TESTDATA_DIR, 'ninja_deps')
-
-
-    def test_load_build_dep_file(self):
-        dep = load_build_dep_file_from_path(self.DEP_PATH)
-
-        self.assertIn('liba.so', dep)
-        self.assertIn('libb.so', dep)
-        self.assertIn('libc.so', dep)
-
-        self.assertSetEqual({'a.h', 'a1.c', 'a1.o', 'a2.c', 'a2.o'},
-                            dep['liba.so'])
-        self.assertSetEqual({'a.h', 'b.c', 'b.o'}, dep['libb.so'])
-        self.assertSetEqual({'c.c', 'c.o'}, dep['libc.so'])
-
-
-    def test_load_build_dep_ninja(self):
-        dep = load_build_dep_ninja(self.NINJA_PATH, self.MAP_TESTDATA_DIR,
-                                   self.NINJA_DEP_PATH)
-
-        self.assertIn('liba.so', dep)
-        self.assertIn('libb.so', dep)
-        self.assertIn('libc.so', dep)
-
-        self.assertSetEqual({'a.h', 'a1.c', 'a1.o', 'a2.c', 'a2.o'},
-                            dep['liba.so'])
-        self.assertSetEqual({'a.h', 'b.c', 'b.o'}, dep['libb.so'])
-        self.assertSetEqual({'c.c', 'c.o'}, dep['libc.so'])
-
-
-    def test_load_review_data(self):
-        data = load_review_data(self.REVIEW_DB_PATH)
-        self.assertIn('a.h', data)
-        self.assertEqual(['libx.so'], data['a.h'])
-
-
-    def test_link_build_dep_and_review_data(self):
-        dep = load_build_dep_file_from_path(self.DEP_PATH)
-        data = load_review_data(self.REVIEW_DB_PATH)
-        result = link_build_dep_and_review_data(dep, data)
-
-        self.assertIn('liba.so', result)
-        self.assertIn('libb.so', result)
-        self.assertIn('libc.so', result)
-
-        self.assertEqual(['libx.so'], result['liba.so'])
-        self.assertEqual(['libx.so'], result['libb.so'])
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/sourcedr/sourcedr/tests/test_project.py b/vndk/tools/sourcedr/sourcedr/tests/test_project.py
deleted file mode 100644
index 10afc5a..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/test_project.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import tempfile
-import unittest
-
-from sourcedr.project import Config
-
-
-TESTDATA_DIR = os.path.join(os.path.dirname(__file__), 'testdata')
-
-
-class ConfigTest(unittest.TestCase):
-    PROJECT_DIR = os.path.join(TESTDATA_DIR, 'project')
-    CONFIG_PATH = os.path.join(PROJECT_DIR, Config.DEFAULT_NAME)
-
-
-    def test_load(self):
-        config = Config(self.CONFIG_PATH)
-        config.load()
-        self.assertEqual('path/to/android/src', config.source_dir)
-
-
-    def test_save(self):
-        with tempfile.TemporaryDirectory(prefix='test_sourcedr_') as tmp_dir:
-            config_path = Config.get_default_path(tmp_dir)
-            config = Config(config_path)
-            config.source_dir = 'path/to/android/src'
-            config.save()
-            with open(config_path, 'r') as actual_fp:
-                actual = actual_fp.read().strip()
-        with open(self.CONFIG_PATH, 'r') as expected_fp:
-            expected = expected_fp.read().strip()
-        self.assertEqual(actual, expected)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/sourcedr/sourcedr/tests/test_review_db.py b/vndk/tools/sourcedr/sourcedr/tests/test_review_db.py
deleted file mode 100644
index d1cdc09..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/test_review_db.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import unittest
-
-from sourcedr.codesearch import CodeSearch
-from sourcedr.review_db import ReviewDB
-
-
-TESTDATA_DIR = os.path.join(os.path.dirname(__file__), 'testdata')
-ANDROID_DIR = os.path.join(TESTDATA_DIR, 'android_src')
-
-
-class ReviewDBTest(unittest.TestCase):
-    def setUp(self):
-        self.csearch_index_path = 'csearchindex'
-        self.review_db_path = ReviewDB.DEFAULT_NAME
-
-
-    def tearDown(self):
-        os.remove(self.csearch_index_path)
-        os.remove(self.review_db_path)
-
-
-    def test_preprocess(self):
-        codesearch = CodeSearch(ANDROID_DIR, self.csearch_index_path)
-        codesearch.build_index()
-        review_db = ReviewDB(ReviewDB.DEFAULT_NAME, codesearch)
-        review_db.find(patterns=['dlopen'], is_regexs=[False])
-        self.assertTrue(os.path.exists(ReviewDB.DEFAULT_NAME))
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/sourcedr/sourcedr/tests/test_server.py b/vndk/tools/sourcedr/sourcedr/tests/test_server.py
deleted file mode 100644
index 9a8a46f..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/test_server.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env python3
-
-import json
-import os
-import tempfile
-import unittest
-
-import flask_testing
-
-from sourcedr.project import Project
-from sourcedr.review_db import ReviewDB
-from sourcedr.server import create_app
-
-
-TESTDATA_DIR = os.path.join(os.path.dirname(__file__), 'testdata')
-ANDROID_DIR = os.path.join(TESTDATA_DIR, 'android_src')
-
-
-class ViewTest(flask_testing.TestCase):
-    def create_app(self):
-        self.tmp_dir = tempfile.TemporaryDirectory(prefix='test_sourcedr_')
-        project = Project.get_or_create_project_dir(
-                self.tmp_dir.name, ANDROID_DIR)
-        project.update_csearch_index(True)
-        self.project = project
-
-        app = create_app(project)
-        app.config['TESTING'] = True
-        self.app = app
-        return app
-
-
-    def setUp(self):
-        review_db = self.project.review_db
-        review_db.find(patterns=['dlopen'], is_regexs=[False])
-
-
-    def tearDown(self):
-        self.tmp_dir.cleanup()
-
-
-    def test_get_file(self):
-        test_arg = 'example.c'
-        response = self.client.get('/get_file',
-                                   query_string=dict(path=test_arg))
-        ret = response.json['result']
-        with open(os.path.join(ANDROID_DIR, test_arg), 'r') as f:
-            self.assertEqual(ret, f.read())
-
-
-    def test_load_file(self):
-        test_arg = 'dlopen/test.c'
-        test_arg += ':10:    handle = dlopen("libm.so.6", RTLD_LAZY);'
-        response = self.client.get('/load_file',
-                                   query_string=dict(path=test_arg))
-        deps = json.loads(response.json['deps'])
-        codes = json.loads(response.json['codes'])
-        with open(self.project.review_db.path, 'r') as f:
-            cdata = json.load(f)
-
-        self.assertEqual(deps, cdata[test_arg][0])
-        self.assertEqual(codes, cdata[test_arg][1])
-
-
-    def test_save_all(self):
-        label = os.path.abspath('sourcedr/test/dlopen/test.c')
-        label += ':10:    handle = dlopen("libm.so.6", RTLD_LAZY);'
-        test_arg = {
-            'label': label,
-            'deps': json.dumps(['this_is_a_test.so']),
-            'codes': json.dumps(['arr_0', 'arr_1'])
-        }
-        response = self.client.get('/save_all', query_string=test_arg)
-        cdata = ReviewDB(self.project.review_db.path, None).data
-        self.assertEqual(['this_is_a_test.so'],  cdata[test_arg['label']][0])
-        self.assertEqual(['arr_0', 'arr_1'], cdata[test_arg['label']][1])
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/build.ninja b/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/build.ninja
deleted file mode 100644
index 2cc71de..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/build.ninja
+++ /dev/null
@@ -1,15 +0,0 @@
-rule cc
-  command = gcc -c -o $out $in -MMD -MF $out.d
-  deps = gcc
-  depfile = $out.d
-
-rule ld
-  command = gcc -o $out $in
-
-build example.o: cc example.c
-
-build example.so: ld example.o
-
-build dlopen/test.o: cc dlopen/test.c 
-
-build dlopen/test.so: ld dlopen/test.o
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/dlopen/test.c b/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/dlopen/test.c
deleted file mode 100644
index c305569..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/dlopen/test.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <dlfcn.h>
-
-int main(int argc, char **argv) {
-    void *handle;
-    double (*cosine)(double);
-    char *error;
-
-    handle = dlopen("libm.so.6", RTLD_LAZY);
-    if (!handle) {
-        fputs (dlerror(), stderr);
-        exit(1);
-    }
-
-    cosine = dlsym(handle, "cos");
-    if ((error = dlerror()) != NULL)  {
-        fputs(error, stderr);
-        exit(1);
-    }
-
-    printf ("%f\n", (*cosine)(2.0));
-    dlclose(handle);
-}
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/example.c b/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/example.c
deleted file mode 100644
index f8e329f..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/example.c
+++ /dev/null
@@ -1,10 +0,0 @@
-int main() {
-    printf("This is a simple testing file\n");
-    int dlopen_analysis = 1;
-    "This line with dlopen shouldn't be found"
-    /*
-     * This dlopen shouldn't be found
-     */
-    dlopen("dlopen");
-    handle = dlopen("libm.so.6", RTLD_LAZY);
-}
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/example.txt b/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/example.txt
deleted file mode 100644
index 27f787e..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/android_src/example.txt
+++ /dev/null
@@ -1 +0,0 @@
-dlopen() in .txt file should not be matched
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/build.ninja b/vndk/tools/sourcedr/sourcedr/tests/testdata/map/build.ninja
deleted file mode 100644
index 5f732ac..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/build.ninja
+++ /dev/null
@@ -1,21 +0,0 @@
-rule cc
-  command = gcc -c -o $out $in -MMD -MF $out.d
-  deps = gcc
-  depfile = $out.d
-
-rule ld
-  command = gcc  -o $out $in
-
-build liba.so: ld a1.o a2.o
-
-build libb.so: ld b.o
-
-build libc.so: ld c.o
-
-build a1.o: cc a1.c
-
-build a2.o: cc a2.c
-
-build b.o: cc b.c
-
-build c.o: cc c.c
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/build_dep.json b/vndk/tools/sourcedr/sourcedr/tests/testdata/map/build_dep.json
deleted file mode 100644
index d8b6f49..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/build_dep.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "liba.so": ["libb.so", "libc.so", "a1.o", "a2.o"],
-  "libb.so": ["b.o"],
-  "libc.so": ["c.o"],
-  "a1.o": ["a.h", "a1.c"],
-  "a2.o": ["a.h", "a2.c"],
-  "b.o": ["a.h", "b.c"],
-  "c.o": ["c.c"]
-}
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/data.json b/vndk/tools/sourcedr/sourcedr/tests/testdata/map/data.json
deleted file mode 100644
index 0d1bfe2..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/data.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "a.h:2:dlopen(\"libx.so\",": [
-     ["libx.so"],
-     ["a.h:2:dlopen(\"libx.so\","]
-  ]
-}
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/ninja_deps b/vndk/tools/sourcedr/sourcedr/tests/testdata/map/ninja_deps
deleted file mode 100644
index 78414b3..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/map/ninja_deps
+++ /dev/null
Binary files differ
diff --git a/vndk/tools/sourcedr/sourcedr/tests/testdata/project/sourcedr.json b/vndk/tools/sourcedr/sourcedr/tests/testdata/project/sourcedr.json
deleted file mode 100644
index e9126d8..0000000
--- a/vndk/tools/sourcedr/sourcedr/tests/testdata/project/sourcedr.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "source_dir": "path/to/android/src",
-  "file_ext_blacklist": [],
-  "file_name_blacklist": [],
-  "path_component_blacklist": []
-}
diff --git a/vndk/tools/sourcedr/sourcedr/utils.py b/vndk/tools/sourcedr/sourcedr/utils.py
deleted file mode 100644
index 168e437..0000000
--- a/vndk/tools/sourcedr/sourcedr/utils.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python3
-
-"""Utility functions or classes."""
-
-import os
-
-
-class LockedFile(object):  # pylint: disable=too-few-public-methods
-    """Open a file with `.lock` file and rename it if everything goes well."""
-
-
-    def __init__(self, path, mode):
-        assert 'x' in mode
-        self._path = path
-        self._mode = mode
-        self._fp = None
-
-
-    def __enter__(self):
-        """Open the file at the specified path and with specified mode."""
-        self._fp = open(self._get_locked_path(self._path), self._mode)
-        return self._fp
-
-
-    def __exit__(self, exc_type, exc_val, exc_tb):
-        """Close the file object and rename the file if there are no
-        exceptions."""
-        self._fp.close()
-        self._fp = None
-        if exc_val is None:
-            os.rename(self._get_locked_path(self._path), self._path)
-
-
-    @classmethod
-    def _get_locked_path(cls, path):
-        """Get the file path for the `.lock` file."""
-        return path + '.lock'
-
-
-    @classmethod
-    def is_locked(cls, path):
-        """Check whether a path is locked."""
-        return os.path.exists(cls._get_locked_path(path))
diff --git a/vndk/tools/system_image_diff.py b/vndk/tools/system_image_diff.py
index cd9ebfb..e374bcc 100755
--- a/vndk/tools/system_image_diff.py
+++ b/vndk/tools/system_image_diff.py
@@ -24,6 +24,17 @@
     'vendor/realtek' : 'Realtek'
 }
 
+def _get_relative_out_path_from_root(out_path):
+  """Given a path to a target out directory, get the relative path from the
+  Android root.
+
+  The module-info.json file paths are relative to the root source folder
+  ie. one directory before out."""
+  system_path = os.path.normpath(os.path.join(out_path, 'system'))
+  system_path_dirs = system_path.split(os.sep)
+  out_index = system_path_dirs.index("out")
+  return os.path.join(*system_path_dirs[out_index:])
+
 def system_files(path):
   """Returns an array of the files under /system, recursively, and ignoring
   symbolic-links"""
@@ -44,7 +55,7 @@
   """Returns a dictionary mapping from each file in the /system partition to its
   package, according to modules-info.json."""
   system_files_to_package_map = {}
-  system_prefix = os.path.join(path, 'system')
+  system_prefix = _get_relative_out_path_from_root(path)
   # Skip trailing '/'
   system_prefix_len = len(system_prefix) + 1
 
@@ -124,18 +135,36 @@
     else:
       packages[package] = [file]
 
+  with open(os.path.join(args.out1, 'module-info.json')) as module_info_json:
+    module_info = json.load(module_info_json)
+
   writer = csv.writer(sys.stdout, quoting = csv.QUOTE_NONNUMERIC,
                       delimiter = ',', lineterminator = '\n')
-  for package, files in packages.items():
+  for package, files in packages.iteritems():
     for file in files:
+      # Group sources of the deltas.
       if package in package_vendor_map:
         vendor = package_vendor_map[package]
       else:
         vendor = "--unknown--"
-      # Get file size
+      # Get file size.
       full_path = os.path.join(args.out1, 'system', file)
       size = os.stat(full_path).st_size
-      writer.writerow([vendor, package, file, size])
+      if package in module_info.keys():
+        module_path = module_info[package]['path']
+      else:
+        module_path = ''
+      writer.writerow([
+          # File that exists in out1 but not out2.
+          file,
+          # Module name that the file came from.
+          package,
+          # Path to the module.
+          module_path,
+          # File size.
+          size,
+          # Vendor owner.
+          vendor])
 
 if __name__ == '__main__':
   main()
diff --git a/vndk/tools/vtable-dumper/elf_handling.cpp b/vndk/tools/vtable-dumper/elf_handling.cpp
deleted file mode 100644
index 7b115df..0000000
--- a/vndk/tools/vtable-dumper/elf_handling.cpp
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "elf_handling.h"
-
-#include <cxxabi.h>
-
-using llvm::ELF::ELFDATA2MSB;
-using llvm::ELF::EM_ARM;
-using llvm::ELF::EM_MIPS;
-using llvm::ELF::R_AARCH64_ABS64;
-using llvm::ELF::R_AARCH64_RELATIVE;
-using llvm::ELF::R_ARM_ABS32;
-using llvm::ELF::R_ARM_RELATIVE;
-using llvm::ELF::R_X86_64_64;
-using llvm::ELF::R_X86_64_RELATIVE;
-using llvm::ELF::R_MIPS_64;
-using llvm::ELF::R_MIPS_REL32;
-using llvm::ELF::R_MIPS_NONE;
-using llvm::ELF::SHT_PROGBITS;
-using llvm::ELF::SHT_REL;
-using llvm::ELF::SHT_RELA;
-using llvm::Expected;
-using llvm::StringRef;
-using llvm::dyn_cast;
-using llvm::object::ELF32BEObjectFile;
-using llvm::object::ELF32LEObjectFile;
-using llvm::object::ELF64BEObjectFile;
-using llvm::object::ELF64LEObjectFile;
-using llvm::object::symbol_iterator;
-using llvm::support::endian::read;
-using llvm::outs;
-using llvm::Error;
-using llvm::make_unique;
-
-static std::string demangle(const std::string &MangledName) {
-     char *Str = __cxxabiv1::__cxa_demangle(
-             MangledName.c_str(),
-             nullptr,
-             0,
-             nullptr);
-     if (Str) {
-         std::string DemangledString(Str);
-         free(Str);
-         return DemangledString;
-     }
-     return "";
-}
-
-SharedObject::~SharedObject() {}
-
-template <typename ELFT>
-static std::unique_ptr<SharedObject> createELFSharedObject(
-        const ELFObjectFile<ELFT> *Objfile) {
-    return make_unique<ELFSharedObject<ELFT>>(Objfile);
-}
-
-static std::unique_ptr<SharedObject>createELFObjFile(const ObjectFile *Obj) {
-    if (const ELF32LEObjectFile *Objfile = dyn_cast<ELF32LEObjectFile>(Obj))
-        return createELFSharedObject(Objfile);
-    if (const ELF32BEObjectFile *Objfile = dyn_cast<ELF32BEObjectFile>(Obj))
-        return createELFSharedObject(Objfile);
-    if (const ELF64LEObjectFile *Objfile = dyn_cast<ELF64LEObjectFile>(Obj))
-        return createELFSharedObject(Objfile);
-    if (const ELF64BEObjectFile *Objfile = dyn_cast<ELF64BEObjectFile>(Obj))
-        return createELFSharedObject(Objfile);
-
-    return nullptr;
-}
-
-std::unique_ptr<SharedObject> SharedObject::create(const ObjectFile *Obj) {
-    std::unique_ptr<SharedObject> res(createELFObjFile(Obj));
-    if (res && res->getVTables()) {
-        return res;
-    }
-    return nullptr;
-}
-
-template <typename ELFT>
-ELFSharedObject<ELFT>::~ELFSharedObject() {}
-
-template <typename ELFT>
-ELFSharedObject<ELFT>::ELFSharedObject(
-        const ELFObjectFile<ELFT> *Objfile)
-    : mObj(Objfile) {}
-
-template <typename ELFT>
-bool ELFSharedObject<ELFT>::cacheELFSections() {
-    for (const SectionRef &ElfSection : mObj->sections()) {
-        const Elf_Shdr *ElfShdr =
-                mObj->getSection(ElfSection.getRawDataRefImpl());
-        if (!ElfShdr) {
-            outs() << "Couldn't create elf shdr \n";
-            return false;
-        }
-        switch (ElfShdr->sh_type) {
-            case SHT_RELA:
-            case SHT_REL:
-                mRelSectionRefs.emplace_back(ElfSection);
-                break;
-            case SHT_PROGBITS:
-                mProgBitSectionRefs.emplace_back(ElfSection);
-                break;
-            default :
-                // Any other section won't have information pertinent
-                // to vtables. Relocation entries will have the virtual
-                // functions' relocation information, the PROGBITS sections
-                // will have the vtables themselves.
-                break;
-        }
-    }
-    return true;
-}
-
-template <typename ELFT>
-void ELFSharedObject<ELFT>::printVTables(bool Mangled) const {
-    for (const VTable &Vtable : mVTables) {
-        if (Vtable.getVTableSize() == 0)
-            continue;
-        outs() << Vtable.getDemangledName()
-               << "\n"
-               << Vtable.getMangledName()
-               << ": "
-               << Vtable.getVTableSize()
-               << " entries"
-               << "\n";
-        for (const VFunction &Vfunction : Vtable) {
-            std::string VfunctionName = (Mangled ?
-                                         Vfunction.getMangledName() :
-                                         Vfunction.getDemangledName());
-            outs() << Vfunction.getOffset()
-                   << "    (int (*)(...)) "
-                   << VfunctionName
-                   << "\n";
-        }
-        outs() << "\n"
-               << "\n";
-    }
-}
-
-template <typename ELFT>
-bool ELFSharedObject<ELFT>::getVTables() {
-    if (!cacheELFSections()) {
-        return false;
-    }
-    if (!initVTableRanges()) {
-        return true;
-    }
-    getVFunctions();
-    for (VTable &Vtable : mVTables) {
-        // Sort the functions by offset before displaying them since the order
-        // of functions appearing in relocation sections might change. That
-        // should not result in the vtable layout changing.
-        Vtable.sortVFunctions();
-    }
-    return true;
-}
-
-template <typename ELFT>
-bool ELFSharedObject<ELFT>::initVTableRanges() {
-    // Go through all the symbols in the dynsym / symtab sections
-    // and cache all the relevant symbols. i.e: symbols which correspond
-    // to either vtables or functions.
-
-    std::vector<std::pair<SymbolRef, uint64_t>> SymsAndSizes =
-            computeSymbolSizes(*mObj);
-    for (std::pair<SymbolRef, uint64_t> &Pair : SymsAndSizes) {
-        SymbolRef Symbol = Pair.first;
-        SymbolRef::Type SymType = UnWrap(Symbol.getType());
-        uint64_t SymValue = Symbol.getValue();
-        StringRef SymName = UnWrap(Symbol.getName());
-        if (SymName.startswith("__ZTV") || SymName.startswith("_ZTV")) {
-            mVTables.emplace_back(
-                    SymName.str(),
-                    demangle(SymName.str()),
-                    Symbol.getValue(),
-                    Symbol.getValue() + Pair.second);
-        } else if (SymType == SymbolRef::ST_Function) {
-            std::map<uint64_t, std::vector<SymbolRef>>::iterator It =
-                    mAddrToSymbolRef.find(SymValue);
-            if (It == mAddrToSymbolRef.end()) {
-                mAddrToSymbolRef.insert(std::make_pair(
-                        SymValue, std::vector<SymbolRef>(1, Symbol)));
-            } else {
-                std::vector<SymbolRef> &SymVec = It->second;
-                SymVec.emplace_back(Symbol);
-            }
-        }
-    }
-    if (mVTables.size() == 0) {
-        return false;
-    }
-    std::sort(mVTables.begin(), mVTables.end());
-    return true;
-}
-
-template <typename ELFT>
-void ELFSharedObject<ELFT>::getVFunctions() {
-    for (const SectionRef &Section : mRelSectionRefs) {
-        for (const RelocationRef &Relocation : Section.relocations()) {
-            VTable *VtPtr = identifyVTable(Relocation.getOffset());
-            if (VtPtr != nullptr) {
-                relocateSym(Relocation, Section, VtPtr);
-            }
-        }
-    }
-}
-
-template <typename ELFT>
-VTable *ELFSharedObject<ELFT>::identifyVTable(uint64_t RelOffset) {
-    typename std::vector<VTable>::iterator It;
-    It = std::lower_bound(mVTables.begin(), mVTables.end(), RelOffset);
-    if (It != mVTables.begin() && It->getStartAddr() != RelOffset) {
-        It--;
-    }
-    if (It->getEndAddr() >= RelOffset) {
-        return &(*It);
-    }
-    return nullptr;
-}
-
-template <typename ELFT>
-void ELFSharedObject<ELFT>::relocateSym(
-        const RelocationRef &Relocation,
-        const SectionRef &Section,
-        VTable *Vtablep) {
-    const Elf_Ehdr *ElfHeader = mObj->getELFFile()->getHeader();
-    if (ElfHeader->e_machine == EM_MIPS) {
-        // bionic/linker/linker_mips.cpp , we handle only one type of
-        // relocation. Depending on if the symbol can be inferred from r_info we
-        // make it an absolute or a relative relocation.
-        if (!absoluteRelocation(Relocation, Vtablep)) {
-            relativeRelocation(Relocation, Section, Vtablep);
-        }
-    } else {
-        switch(Relocation.getType()) {
-            case R_AARCH64_RELATIVE:
-            case R_X86_64_RELATIVE:
-            case R_ARM_RELATIVE:
-            {
-                // The return value is ignored since failure to relocate
-                // does not mean a fatal error. It might be that the dynsym /
-                // symbol-table does not have enough information to get the
-                // symbol name. Like-wise for absolute relocations.
-                relativeRelocation(Relocation, Section, Vtablep);
-                break;
-            }
-            case R_AARCH64_ABS64:
-            case R_X86_64_64:
-            case R_ARM_ABS32:
-            {
-                absoluteRelocation(Relocation, Vtablep);
-                break;
-            }
-            default:
-                break;
-        }
-    }
-}
-
-template <typename ELFT>
-bool ELFSharedObject<ELFT>::absoluteRelocation(
-        const RelocationRef &Relocation,
-        VTable *Vtablep) {
-    symbol_iterator Symi = Relocation.getSymbol();
-    if (Symi == mObj->symbol_end()) {
-        return false;
-    }
-    SymbolRef Symbol = *Symi;
-    uint64_t RelOffset = Relocation.getOffset();
-    StringRef SymbolName = UnWrap(Symbol.getName());
-    std::string DemangledName = demangle(SymbolName.str());
-    if (!DemangledName.empty()) {
-        Vtablep->addVFunction(SymbolName.str(), DemangledName, RelOffset);
-        return true;
-    }
-    return false;
-}
-
-template <typename ELFT>
-bool ELFSharedObject<ELFT>::relativeRelocation(
-        const RelocationRef &Relocation,
-        const SectionRef &Section,
-        VTable *Vtablep) {
-    uint64_t Addend = 0;
-    uint64_t RelOffset = Relocation.getOffset();
-    if (mObj->getSection(Section.getRawDataRefImpl())->sh_type == SHT_RELA) {
-        const Elf_Rela *Rela = mObj->getRela(Relocation.getRawDataRefImpl());
-        Addend = static_cast<uint64_t>(Rela->r_addend);
-    }
-
-    if (Addend == 0) {
-        Addend = identifyAddend(Relocation.getOffset());
-    }
-
-    std::map<uint64_t, std::vector<SymbolRef>>::iterator It =
-            mAddrToSymbolRef.find(Addend);
-    if (It == mAddrToSymbolRef.end()) {
-        return false;
-    }
-    SymbolRef Symbol = matchValueToSymbol(It->second, Vtablep);
-    StringRef SymbolName = UnWrap(Symbol.getName());
-    std::string DemangledName = demangle(SymbolName.str());
-    if (!DemangledName.empty()) {
-        Vtablep->addVFunction(SymbolName.str(), DemangledName, RelOffset);
-        return true;
-    }
-    return false;
-}
-
-template <typename ELFT>
-SymbolRef ELFSharedObject<ELFT>::matchValueToSymbol(
-        std::vector<SymbolRef> &SymVec,
-        VTable *Vtablep) {
-    constexpr size_t pos = sizeof("vtable for ") - 1;
-    const std::string ClassName(Vtablep->getDemangledName().substr(pos));
-    for (const SymbolRef &Symbol : SymVec) {
-        StringRef SymbolName = UnWrap(Symbol.getName());
-        if (demangle(SymbolName.str()).find(ClassName) != std::string::npos) {
-            return Symbol;
-        }
-    }
-    // Return the 1st Symbol by default.
-    return SymVec[0];
-}
-
-template <typename ELFT>
-uint64_t ELFSharedObject<ELFT>::identifyAddend(uint64_t ROffset) {
-    for (const SectionRef &Section : mProgBitSectionRefs) {
-        uint64_t Begin = Section.getAddress();
-        uint64_t End = Section.getAddress() + Section.getSize();
-        if (ROffset >= Begin && ROffset <= End) {
-            return getAddendFromSection(Section, ROffset - Begin);
-        }
-    }
-    return 0;
-}
-
-template <typename ELFT>
-uint64_t ELFSharedObject<ELFT>::getAddendFromSection(
-        const SectionRef &Section,
-        uint64_t Offset) {
-    StringRef Contents;
-    if (Section.getContents(Contents))
-        return 0;
-    const unsigned char *Bytes = Contents.bytes_begin() + Offset;
-    uintX_t Addend = read<uintX_t, ELFT::TargetEndianness>(Bytes);
-    const Elf_Ehdr *ElfHeader = mObj->getELFFile()->getHeader();
-    if (ElfHeader->e_machine == EM_ARM ||
-        ElfHeader->e_machine == EM_MIPS) {
-        // Remove thumb flag as llvm suggests.
-        Addend &= ~1;
-    }
-    return static_cast<uint64_t>(Addend);
-}
-
-VFunction::VFunction(
-        const std::string &MangledName,
-        const std::string &DemangledName,
-        uint64_t VFunctionOffset)
-    : mMangledName(MangledName),
-      mDemangledName(DemangledName),
-      mOffset(VFunctionOffset) {}
-
-uint64_t VFunction::getOffset() const {
-    return mOffset;
-}
-
-const std::string &VFunction::getDemangledName() const {
-    return mDemangledName;
-}
-
-const std::string &VFunction::getMangledName() const {
-    return mMangledName;
-}
-
-bool VFunction::operator<(const VFunction &Vfunction) const {
-    return mOffset < Vfunction.getOffset();
-}
-
-VTable::VTable(
-        const std::string &MangledName,
-        const std::string &DemangledName,
-        uint64_t Begin,
-        uint64_t End)
-    : mMangledName(MangledName),
-      mDemangledName(DemangledName),
-      mStartAddr(Begin),
-      mEndAddr(End),
-      mBaseOffset(Begin) {}
-
-void VTable::addVFunction(
-        const std::string &MangledName,
-        const std::string &DemangledName,
-        uint64_t RelOffset) {
-    mFunctions.emplace_back(
-            MangledName,
-            DemangledName,
-            RelOffset - mBaseOffset);
-}
-
-const std::string &VTable::getDemangledName() const {
-    return mDemangledName;
-}
-
-const std::string &VTable::getMangledName() const {
-    return mMangledName;
-}
-
-uint64_t VTable::getStartAddr() const {
-    return mStartAddr;
-}
-
-uint64_t VTable::getEndAddr() const {
-    return mEndAddr;
-}
-
-uint64_t VTable::getBaseOffset() const {
-    return mBaseOffset;
-}
-
-uint64_t VTable::getVTableSize() const {
-    return mFunctions.size();
-}
-
-VTable::func_iterator VTable::begin() const {
-    return mFunctions.cbegin();
-}
-
-VTable::func_iterator VTable::end() const {
-    return mFunctions.cend();
-}
-
-bool VTable::operator<(const VTable &Vtable) const {
-    return mStartAddr < Vtable.getStartAddr();
-}
-
-bool VTable::operator<(const uint64_t ROffset) const {
-    return mStartAddr < ROffset;
-}
-
-void VTable::sortVFunctions() {
-    std::sort(mFunctions.begin(), mFunctions.end());
-}
diff --git a/vndk/tools/vtable-dumper/elf_handling.h b/vndk/tools/vtable-dumper/elf_handling.h
deleted file mode 100644
index 9ef91b4..0000000
--- a/vndk/tools/vtable-dumper/elf_handling.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ELF_HANDLING_H_
-#define ELF_HANDLING_H_
-
-#include <map>
-#include <memory>
-#include <string>
-#include <system_error>
-#include <vector>
-
-#include <llvm/Object/ELFObjectFile.h>
-#include <llvm/Object/ELFTypes.h>
-#include <llvm/Object/SymbolSize.h>
-#include <llvm/Support/Endian.h>
-#include <llvm/Support/raw_ostream.h>
-
-using llvm::object::ObjectFile;
-using llvm::object::ELFObjectFile;
-using llvm::object::SectionRef;
-using llvm::object::RelocationRef;
-using llvm::object::ELFFile;
-using llvm::object::ELFType;
-using llvm::object::ELFDataTypeTypedefHelper;
-using llvm::object::SymbolRef;
-using llvm::outs;
-
-class SharedObject {
-public:
-    static std::unique_ptr<SharedObject> create(const ObjectFile *);
-    /* Print mangled names if the argument is true; demangled if false.
-     */
-    virtual void printVTables(bool) const = 0;
-    virtual ~SharedObject() = 0;
-private:
-    virtual bool getVTables() = 0;
-};
-
-class VFunction {
-public:
-    VFunction(
-            const std::string &,
-            const std::string &,
-            uint64_t);
-
-    uint64_t getOffset() const;
-    bool operator<(const VFunction &) const;
-    const std::string &getMangledName() const;
-    const std::string &getDemangledName() const;
-private:
-    std::string mMangledName;
-    std::string mDemangledName;
-    uint64_t mOffset;
-};
-
-class VTable {
-public:
-    using func_iterator = std::vector<VFunction>::const_iterator;
-    VTable(
-            const std::string &,
-            const std::string &,
-            uint64_t,
-            uint64_t);
-
-    uint64_t getStartAddr() const;
-    uint64_t getEndAddr() const;
-    uint64_t getBaseOffset() const;
-    uint64_t getVTableSize() const;
-    func_iterator begin() const;
-    func_iterator end() const;
-    const std::string &getMangledName() const;
-    const std::string &getDemangledName() const;
-    void sortVFunctions();
-    void addVFunction(
-            const std::string &,
-            const std::string &,
-            uint64_t);
-
-    bool operator<(const VTable &) const;
-    bool operator<(const uint64_t) const;
-private:
-    std::vector<VFunction> mFunctions;
-    std::string mMangledName;
-    std::string mDemangledName;
-    /* This holds the range(st_value, st_value) through which the
-     * VTable spans.
-     */
-    uint64_t mStartAddr;
-    uint64_t mEndAddr;
-    uint64_t mBaseOffset;
-};
-
-template<typename ELFT>
-class ELFSharedObject : public SharedObject {
-public:
-    void printVTables(bool) const override;
-    bool getVTables() override;
-    ~ELFSharedObject();
-    ELFSharedObject(const ELFObjectFile<ELFT> *);
-
-private:
-    /* We need a sym value to SymbolRef map in case the relocation provides
-     * us with an addr instead of a sym index into dynsym / symtab.
-     */
-    LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
-    typedef ELFFile<ELFT> ELFO;
-    typedef typename ELFO::Elf_Shdr Elf_Shdr;
-    typedef typename ELFO::Elf_Ehdr Elf_Ehdr;
-    typedef typename ELFO::Elf_Sym Elf_Sym;
-    typedef typename ELFO::Elf_Rela Elf_Rela;
-    typedef typename ELFO::uintX_t uintX_t;
-    std::map<uint64_t, std::vector<SymbolRef>> mAddrToSymbolRef;
-    const ELFObjectFile<ELFT> *mObj;
-    /* We cache the relocation sections, to look through their relocations for
-     * vfunctions. Sections with type SHT_PROGBITS are cached since they contain
-     * vtables. We might need to peek at the contents of a vtable in cases of
-     * relative relocations.
-     */
-    std::vector<SectionRef> mRelSectionRefs;
-    std::vector<SectionRef> mProgBitSectionRefs;
-    std::vector<VTable> mVTables;
-
-private:
-    bool cacheELFSections();
-    bool initVTableRanges();
-    void getVFunctions();
-    VTable *identifyVTable(uint64_t);
-    void relocateSym(
-            const RelocationRef &,
-            const SectionRef &,
-            VTable *);
-
-    bool absoluteRelocation(const RelocationRef &, VTable *);
-    bool relativeRelocation(
-            const RelocationRef &,
-            const SectionRef &,
-            VTable *);
-
-    uint64_t identifyAddend(uint64_t);
-    uint64_t getAddendFromSection(const SectionRef &, uint64_t);
-    SymbolRef matchValueToSymbol(std::vector<SymbolRef> &, VTable *);
-};
-
-template <typename T>
-static inline T UnWrap(llvm::Expected<T> ValueOrError) {
-    if (!ValueOrError) {
-        outs() << "\nError: "
-               << llvm::toString(ValueOrError.takeError())
-               << ".\n";
-        outs().flush();
-        exit(1);
-    }
-    return std::move(ValueOrError.get());
-}
-
-
-#endif  // ELF_HANDLING_H_
diff --git a/vndk/tools/vtable-dumper/tests/expected/arm/libtest.so.txt b/vndk/tools/vtable-dumper/tests/expected/arm/libtest.so.txt
deleted file mode 100644
index 24b0126..0000000
--- a/vndk/tools/vtable-dumper/tests/expected/arm/libtest.so.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-vtable for Alpha
-_ZTV5Alpha: 3 entries
-8    (int (*)(...)) Alpha::getData(int*, int*, int)
-12    (int (*)(...)) Alpha::~Alpha()
-16    (int (*)(...)) Alpha::~Alpha()
-
-
-vtable for Beta
-_ZTV4Beta: 3 entries
-8    (int (*)(...)) Beta::getData(int*, int*, int)
-12    (int (*)(...)) Beta::~Beta()
-16    (int (*)(...)) Beta::~Beta()
-
-
-vtable for Gamma
-_ZTV5Gamma: 3 entries
-8    (int (*)(...)) Gamma::getData(int*, int*, int)
-12    (int (*)(...)) Gamma::~Gamma()
-16    (int (*)(...)) Gamma::~Gamma()
-
-
diff --git a/vndk/tools/vtable-dumper/tests/expected/arm64/libtest.so.txt b/vndk/tools/vtable-dumper/tests/expected/arm64/libtest.so.txt
deleted file mode 100644
index 5a0ea37..0000000
--- a/vndk/tools/vtable-dumper/tests/expected/arm64/libtest.so.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-vtable for Alpha
-_ZTV5Alpha: 3 entries
-16    (int (*)(...)) Alpha::getData(int*, int*, int)
-24    (int (*)(...)) Alpha::~Alpha()
-32    (int (*)(...)) Alpha::~Alpha()
-
-
-vtable for Beta
-_ZTV4Beta: 3 entries
-16    (int (*)(...)) Beta::getData(int*, int*, int)
-24    (int (*)(...)) Beta::~Beta()
-32    (int (*)(...)) Beta::~Beta()
-
-
-vtable for Gamma
-_ZTV5Gamma: 3 entries
-16    (int (*)(...)) Gamma::getData(int*, int*, int)
-24    (int (*)(...)) Gamma::~Gamma()
-32    (int (*)(...)) Gamma::~Gamma()
-
-
diff --git a/vndk/tools/vtable-dumper/tests/expected/mips/libtest.so.txt b/vndk/tools/vtable-dumper/tests/expected/mips/libtest.so.txt
deleted file mode 100644
index 24b0126..0000000
--- a/vndk/tools/vtable-dumper/tests/expected/mips/libtest.so.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-vtable for Alpha
-_ZTV5Alpha: 3 entries
-8    (int (*)(...)) Alpha::getData(int*, int*, int)
-12    (int (*)(...)) Alpha::~Alpha()
-16    (int (*)(...)) Alpha::~Alpha()
-
-
-vtable for Beta
-_ZTV4Beta: 3 entries
-8    (int (*)(...)) Beta::getData(int*, int*, int)
-12    (int (*)(...)) Beta::~Beta()
-16    (int (*)(...)) Beta::~Beta()
-
-
-vtable for Gamma
-_ZTV5Gamma: 3 entries
-8    (int (*)(...)) Gamma::getData(int*, int*, int)
-12    (int (*)(...)) Gamma::~Gamma()
-16    (int (*)(...)) Gamma::~Gamma()
-
-
diff --git a/vndk/tools/vtable-dumper/tests/expected/mips64/libtest.so.txt b/vndk/tools/vtable-dumper/tests/expected/mips64/libtest.so.txt
deleted file mode 100644
index 5a0ea37..0000000
--- a/vndk/tools/vtable-dumper/tests/expected/mips64/libtest.so.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-vtable for Alpha
-_ZTV5Alpha: 3 entries
-16    (int (*)(...)) Alpha::getData(int*, int*, int)
-24    (int (*)(...)) Alpha::~Alpha()
-32    (int (*)(...)) Alpha::~Alpha()
-
-
-vtable for Beta
-_ZTV4Beta: 3 entries
-16    (int (*)(...)) Beta::getData(int*, int*, int)
-24    (int (*)(...)) Beta::~Beta()
-32    (int (*)(...)) Beta::~Beta()
-
-
-vtable for Gamma
-_ZTV5Gamma: 3 entries
-16    (int (*)(...)) Gamma::getData(int*, int*, int)
-24    (int (*)(...)) Gamma::~Gamma()
-32    (int (*)(...)) Gamma::~Gamma()
-
-
diff --git a/vndk/tools/vtable-dumper/tests/expected/x86/libtest.so.txt b/vndk/tools/vtable-dumper/tests/expected/x86/libtest.so.txt
deleted file mode 100644
index 24b0126..0000000
--- a/vndk/tools/vtable-dumper/tests/expected/x86/libtest.so.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-vtable for Alpha
-_ZTV5Alpha: 3 entries
-8    (int (*)(...)) Alpha::getData(int*, int*, int)
-12    (int (*)(...)) Alpha::~Alpha()
-16    (int (*)(...)) Alpha::~Alpha()
-
-
-vtable for Beta
-_ZTV4Beta: 3 entries
-8    (int (*)(...)) Beta::getData(int*, int*, int)
-12    (int (*)(...)) Beta::~Beta()
-16    (int (*)(...)) Beta::~Beta()
-
-
-vtable for Gamma
-_ZTV5Gamma: 3 entries
-8    (int (*)(...)) Gamma::getData(int*, int*, int)
-12    (int (*)(...)) Gamma::~Gamma()
-16    (int (*)(...)) Gamma::~Gamma()
-
-
diff --git a/vndk/tools/vtable-dumper/tests/expected/x86_64/libtest.so.txt b/vndk/tools/vtable-dumper/tests/expected/x86_64/libtest.so.txt
deleted file mode 100644
index 5a0ea37..0000000
--- a/vndk/tools/vtable-dumper/tests/expected/x86_64/libtest.so.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-vtable for Alpha
-_ZTV5Alpha: 3 entries
-16    (int (*)(...)) Alpha::getData(int*, int*, int)
-24    (int (*)(...)) Alpha::~Alpha()
-32    (int (*)(...)) Alpha::~Alpha()
-
-
-vtable for Beta
-_ZTV4Beta: 3 entries
-16    (int (*)(...)) Beta::getData(int*, int*, int)
-24    (int (*)(...)) Beta::~Beta()
-32    (int (*)(...)) Beta::~Beta()
-
-
-vtable for Gamma
-_ZTV5Gamma: 3 entries
-16    (int (*)(...)) Gamma::getData(int*, int*, int)
-24    (int (*)(...)) Gamma::~Gamma()
-32    (int (*)(...)) Gamma::~Gamma()
-
-
diff --git a/vndk/tools/vtable-dumper/tests/test1.cpp b/vndk/tools/vtable-dumper/tests/test1.cpp
deleted file mode 100644
index 606cd98..0000000
--- a/vndk/tools/vtable-dumper/tests/test1.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-class Alpha {
-public:
-    virtual void getData(int *src, int *dst, int data);
-    virtual ~Alpha() {};
-private:
-    int mPdata = 0;
-};
-
-class Beta : public Alpha {
-public:
-    Beta(int data) : mCdata(data) {}
-    virtual void getData(int *src, int *dst, int data);
-    virtual ~Beta() {};
-private:
-    int mCdata = 1;
-};
-
-class Gamma : public Beta {
-public:
-    Gamma(int data) : mGCdata(data), Beta(data) {}
-    virtual void getData(int *src, int *dst, int data);
-    virtual ~Gamma() {};
-private:
-    int mGCdata = 2;
-};
-
-void Alpha::getData(int *src, int *dst, int data) {}
-
-void Beta::getData(int *src, int *dst, int data) {}
-
-void Gamma::getData(int *src, int *dst, int data) {}
-
diff --git a/vndk/tools/vtable-dumper/tests/test_vndk_vtable_dumper.py b/vndk/tools/vtable-dumper/tests/test_vndk_vtable_dumper.py
deleted file mode 100755
index 37848ee..0000000
--- a/vndk/tools/vtable-dumper/tests/test_vndk_vtable_dumper.py
+++ /dev/null
@@ -1,267 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import argparse
-import collections
-import difflib
-import os
-import subprocess
-import sys
-import tempfile
-
-"""Test vndk vtable dumper"""
-
-NDK_VERSION = 'r11'
-API_LEVEL = 'android-24'
-
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-VNDK_VTABLE_DUMPER = 'vndk-vtable-dumper'
-
-def get_dirnames(path, n):
-    """Get directory, n directories before path"""
-    for i in range(n):
-        path = os.path.dirname(path)
-    return path
-
-
-def get_prebuilts_host():
-    """Get the host dir for prebuilts"""
-    if sys.platform.startswith('linux'):
-        return 'linux-x86'
-    if sys.platform.startswith('darwin'):
-        return 'darwin-x86'
-    raise NotImplementedError('unknown platform')
-
-
-def get_prebuilts_gcc(android_build_top, arch, gcc_version):
-    """Get the path to gcc for the current platform"""
-    return os.path.join(android_build_top, 'prebuilts', 'gcc',
-                        get_prebuilts_host(), arch, gcc_version)
-
-def get_prebuilts_clang(android_build_top):
-    """Get the path to prebuilt gcc for the current platform"""
-    return os.path.join(android_build_top, 'prebuilts', 'clang', 'host',
-                        get_prebuilts_host(), 'clang-stable')
-
-def get_prebuilts_ndk(android_build_top, subdirs):
-    """Get the path to prebuilt ndk  for the current platform and API level"""
-    return os.path.join(android_build_top, 'prebuilts', 'ndk', NDK_VERSION,
-                        'platforms', API_LEVEL, *subdirs)
-
-def run_cmd(cmd, verbose=False):
-    """Run the command given and print the command if verbose is True"""
-    if verbose:
-        print('RUN:', ' '.join(cmd), file=sys.stderr)
-    subprocess.check_call(cmd)
-
-
-def run_output(cmd, verbose=False):
-    """Run the command given and print output of the command"""
-    if verbose:
-        print('RUN:', ' '.join(cmd), file=sys.stderr)
-    return subprocess.check_output(cmd, universal_newlines=True)
-
-
-def run_vtable_dump(path, verbose=False):
-    """Run vndk vtable dumper"""
-    return run_output([VNDK_VTABLE_DUMPER, path], verbose)
-
-
-class Target(object):
-    """Class representing a target: for eg: x86, arm64 etc"""
-    def __init__(self, name, triple, cflags, ldflags, gcc_toolchain_dir,
-                 clang_dir, ndk_include, ndk_lib):
-        """Parameterized Constructor"""
-        self.name = name
-        self.target_triple = triple
-        self.target_cflags = cflags
-        self.target_ldflags = ldflags
-
-        self.gcc_toolchain_dir = gcc_toolchain_dir
-        self.clang_dir = clang_dir
-        self.ndk_include = ndk_include
-        self.ndk_lib = ndk_lib
-
-    def compile(self, obj_file, src_file, cflags, verbose=False):
-        """Compiles the given source files and produces a .o at obj_file"""
-        clangpp = os.path.join(self.clang_dir, 'bin', 'clang++')
-
-        cmd = [clangpp, '-o', obj_file, '-c', src_file]
-        cmd.extend(['-fPIE', '-fPIC', '-fno-rtti', '-std=c++11'])
-        cmd.extend(['-gcc-toolchain', self.gcc_toolchain_dir])
-        cmd.extend(['-target', self.target_triple])
-        cmd.extend(['-isystem', self.ndk_include])
-        cmd.extend(cflags)
-        cmd.extend(self.target_cflags)
-        run_cmd(cmd, verbose)
-
-    def link(self, out_file, obj_files, ldflags, verbose=False):
-        """Link the given obj files to form a shared library"""
-        crtbegin = os.path.join(self.ndk_lib, 'crtbegin_so.o')
-        crtend = os.path.join(self.ndk_lib, 'crtend_so.o')
-        clangpp = os.path.join(self.clang_dir, 'bin', 'clang++')
-
-        cmd = [clangpp, '-o', out_file]
-        cmd.extend(['-fPIE', '-fPIC', '-fno-rtti', '-Wl,--no-undefined', '-nostdlib'])
-        cmd.append('-L' + self.ndk_lib)
-        cmd.extend(['-gcc-toolchain', self.gcc_toolchain_dir])
-        cmd.extend(['-target', self.target_triple])
-        cmd.append(crtbegin)
-        cmd.extend(obj_files)
-        cmd.append(crtend)
-        cmd.extend(ldflags)
-        cmd.extend(self.target_ldflags)
-        run_cmd(cmd, verbose)
-
-
-def create_targets(top):
-    """Create multiple targets objects, one for each architecture supported"""
-    return [
-        Target('arm', 'arm-linux-androideabi', [],[],
-               get_prebuilts_gcc(top, 'arm', 'arm-linux-androideabi-4.9'),
-               get_prebuilts_clang(top),
-               get_prebuilts_ndk(top, ['arch-arm', 'usr', 'include']),
-               get_prebuilts_ndk(top, ['arch-arm', 'usr', 'lib'])),
-
-        Target('arm64', 'aarch64-linux-android', [], [],
-               get_prebuilts_gcc(top, 'aarch64', 'aarch64-linux-android-4.9'),
-               get_prebuilts_clang(top),
-               get_prebuilts_ndk(top, ['arch-arm64', 'usr', 'include']),
-               get_prebuilts_ndk(top, ['arch-arm64', 'usr', 'lib'])),
-
-        Target('mips', 'mipsel-linux-android', [], [],
-               get_prebuilts_gcc(top, 'mips', 'mips64el-linux-android-4.9'),
-               get_prebuilts_clang(top),
-               get_prebuilts_ndk(top, ['arch-mips', 'usr', 'include']),
-               get_prebuilts_ndk(top, ['arch-mips', 'usr', 'lib'])),
-
-        Target('mips64', 'mips64el-linux-android',
-               ['-march=mips64el', '-mcpu=mips64r6'],
-               ['-march=mips64el', '-mcpu=mips64r6'],
-               get_prebuilts_gcc(top, 'mips', 'mips64el-linux-android-4.9'),
-               get_prebuilts_clang(top),
-               get_prebuilts_ndk(top, ['arch-mips64', 'usr', 'include']),
-               get_prebuilts_ndk(top, ['arch-mips64', 'usr', 'lib64'])),
-
-        Target('x86', 'x86_64-linux-android', ['-m32'], ['-m32'],
-               get_prebuilts_gcc(top, 'x86', 'x86_64-linux-android-4.9'),
-               get_prebuilts_clang(top),
-               get_prebuilts_ndk(top, ['arch-x86', 'usr', 'include']),
-               get_prebuilts_ndk(top, ['arch-x86', 'usr', 'lib'])),
-
-        Target('x86_64', 'x86_64-linux-android', ['-m64'], ['-m64'],
-               get_prebuilts_gcc(top, 'x86', 'x86_64-linux-android-4.9'),
-               get_prebuilts_clang(top),
-               get_prebuilts_ndk(top, ['arch-x86_64', 'usr', 'include']),
-               get_prebuilts_ndk(top, ['arch-x86_64', 'usr', 'lib64'])),
-    ]
-
-
-class TestRunner(object):
-    """Class to run the test"""
-    def __init__(self, expected_dir, test_dir, verbose):
-        """Parameterized constructor"""
-        self.expected_dir = expected_dir
-        self.test_dir = test_dir
-        self.verbose = verbose
-        self.num_errors = 0
-
-    def check_output(self, expected_file_path, actual):
-        """Compare the output of the test run and the expected output"""
-        actual = actual.splitlines(True)
-        with open(expected_file_path, 'r') as f:
-            expected = f.readlines()
-        if actual == expected:
-            return
-        for line in difflib.context_diff(expected, actual,
-                                         fromfile=expected_file_path,
-                                         tofile='actual'):
-            sys.stderr.write(line)
-        self.num_errors += 1
-
-    def run_test_for_target(self, target):
-        """Run the test for a specific target"""
-        print('Testing target', target.name, '...', file=sys.stderr)
-
-        expected_dir = os.path.join(self.expected_dir, target.name)
-
-        # Create test directory for this target.
-        test_dir = os.path.join(self.test_dir, target.name)
-        os.makedirs(test_dir, exist_ok=True)
-
-        # Compile and test "libtest.so".
-        src_file = os.path.join(SCRIPT_DIR, 'test1.cpp')
-        obj_file = os.path.join(test_dir, 'test.o')
-        target.compile(obj_file, src_file, [], self.verbose)
-
-        out_file = os.path.join(test_dir, 'libtest.so')
-        target.link(out_file, [obj_file],
-                    ['-shared', '-lc', '-lgcc', '-lstdc++'],
-                    self.verbose)
-        self.check_output(os.path.join(expected_dir, 'libtest.so.txt'),
-                          run_vtable_dump(out_file, self.verbose))
-
-    def run_test(self, targets):
-        """Run test fo all targets"""
-        for target in targets:
-            self.run_test_for_target(target)
-
-
-def main():
-    """ Set up and run test"""
-    # Parse command line arguments.
-    parser = argparse.ArgumentParser()
-    parser.add_argument('--verbose', '-v', action='store_true')
-    parser.add_argument('--android-build-top', help='path to android build top')
-    parser.add_argument('--test-dir',
-                        help='directory for temporary files')
-    parser.add_argument('--expected-dir', help='directory with expected output')
-    args = parser.parse_args()
-
-    # Find ${ANDROID_BUILD_TOP}.
-    if args.android_build_top:
-        android_build_top = args.android_build_top
-    else:
-        android_build_top = get_dirnames(SCRIPT_DIR, 5)
-
-    # Find expected output directory.
-    if args.expected_dir:
-        expected_dir = args.expected_dir
-    else:
-        expected_dir = os.path.join(SCRIPT_DIR, 'expected')
-
-    # Load compilation targets.
-    targets = create_targets(android_build_top)
-
-    # Run tests.
-    if args.test_dir:
-        os.makedirs(args.test_dir, exist_ok=True)
-        runner = TestRunner(expected_dir, args.test_dir, args.verbose)
-        runner.run_test(targets)
-    else:
-        with tempfile.TemporaryDirectory() as test_dir:
-            runner = TestRunner(expected_dir, test_dir, args.verbose)
-            runner.run_test(targets)
-
-    if runner.num_errors:
-        print('FAILED:', runner.num_errors, 'test(s) failed', file=sys.stderr)
-    else:
-        print('SUCCESS', file=sys.stderr)
-
-    return 1 if runner.num_errors else 0
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/vndk/tools/vtable-dumper/vndk_vtable_dumper.cpp b/vndk/tools/vtable-dumper/vndk_vtable_dumper.cpp
deleted file mode 100644
index 0f79c2d..0000000
--- a/vndk/tools/vtable-dumper/vndk_vtable_dumper.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "elf_handling.h"
-
-#include <llvm/Support/CommandLine.h>
-
-using llvm::Expected;
-using llvm::StringMapEntry;
-using llvm::cl::Hidden;
-using llvm::cl::Option;
-using llvm::cl::OptionCategory;
-using llvm::cl::ParseCommandLineOptions;
-using llvm::cl::Positional;
-using llvm::cl::Required;
-using llvm::cl::SetVersionPrinter;
-using llvm::cl::cat;
-using llvm::cl::desc;
-using llvm::cl::getRegisteredOptions;
-using llvm::cl::opt;
-using llvm::dyn_cast;
-using llvm::object::ObjectFile;
-using llvm::object::OwningBinary;
-using llvm::outs;
-
-OptionCategory VTableDumperCategory("vndk-vtable-dumper options");
-
-opt<std::string> FilePath(
-        Positional, Required, cat(VTableDumperCategory),
-        desc("shared_library.so"));
-
-opt<bool> Mangled(
-        "mangled", cat(VTableDumperCategory),
-        desc("Show mangled symbol names"));
-
-static void HideIrrelevantCommandLineOptions() {
-    for (StringMapEntry<Option *> &P : getRegisteredOptions()) {
-        if (P.second->Category == &VTableDumperCategory) {
-            continue;
-        }
-        if (P.first().startswith("help")) {
-            continue;
-        }
-        P.second->setHiddenFlag(Hidden);
-    }
-}
-
-static void PrintCommandVersion() {
-    outs() << "vndk-vtable-dumper 0.1\n";
-}
-
-int main(int argc, char **argv) {
-    // Parse command line options.
-    HideIrrelevantCommandLineOptions();
-    SetVersionPrinter(PrintCommandVersion);
-    ParseCommandLineOptions(argc, argv);
-
-    // Load ELF shared object file and print the vtables.
-    Expected<OwningBinary<ObjectFile>> Binary =
-            ObjectFile::createObjectFile(FilePath);
-    if (!Binary) {
-        outs() << "Couldn't create object File \n";
-        return 1;
-    }
-    ObjectFile *Objfile = dyn_cast<ObjectFile>(&(*Binary.get().getBinary()));
-    if (!Objfile) {
-        return 1;
-    }
-    auto SoFile = SharedObject::create(Objfile);
-    if (!SoFile) {
-        outs() << "Couldn't create ELFObjectFile \n";
-        return 1;
-    }
-    SoFile->printVTables(Mangled);
-    return 0;
-}