Merge "Disable return PAC in __pthread_start."
diff --git a/libc/Android.bp b/libc/Android.bp
index 8922621..fd1ce81 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1776,10 +1776,6 @@
         "com.android.runtime",
     ],
 
-    // Sorting bss symbols by size usually results in less dirty pages at run
-    // time, because small symbols are grouped together.
-    sort_bss_symbols_by_size: true,
-
     lto: {
         never: true,
     },
diff --git a/libc/bionic/malloc_heapprofd.cpp b/libc/bionic/malloc_heapprofd.cpp
index 198bcba..741b45e 100644
--- a/libc/bionic/malloc_heapprofd.cpp
+++ b/libc/bionic/malloc_heapprofd.cpp
@@ -325,12 +325,12 @@
 
 static void CommonInstallHooks(libc_globals* globals) {
   void* impl_handle = atomic_load(&gHeapprofdHandle);
-  bool reusing_handle = impl_handle != nullptr;
-  if (!reusing_handle) {
+  if (impl_handle == nullptr) {
     impl_handle = LoadSharedLibrary(kHeapprofdSharedLib, kHeapprofdPrefix, &globals->malloc_dispatch_table);
     if (impl_handle == nullptr) {
       return;
     }
+    atomic_store(&gHeapprofdHandle, impl_handle);
   } else if (!InitSharedLibrary(impl_handle, kHeapprofdSharedLib, kHeapprofdPrefix, &globals->malloc_dispatch_table)) {
     return;
   }
@@ -341,11 +341,7 @@
   // MaybeModifyGlobals locks at this point.
   atomic_store(&gPreviousDefaultDispatchTable, GetDefaultDispatchTable());
 
-  if (FinishInstallHooks(globals, nullptr, kHeapprofdPrefix)) {
-    atomic_store(&gHeapprofdHandle, impl_handle);
-  } else if (!reusing_handle) {
-    dlclose(impl_handle);
-  }
+  FinishInstallHooks(globals, nullptr, kHeapprofdPrefix);
 }
 
 void HeapprofdInstallHooksAtInit(libc_globals* globals) {
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index d7fdb4a..583287f 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -41,7 +41,7 @@
 #define EXIT_FAILURE 1
 #define EXIT_SUCCESS 0
 
-__noreturn void abort(void);
+__noreturn void abort(void) __attribute__((__nomerge__));
 __noreturn void exit(int __status);
 #if __ANDROID_API__ >= 21
 __noreturn void _Exit(int __status) __INTRODUCED_IN(21);
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index 766f27a..47bf133 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -264,8 +264,11 @@
 #endif
 
 #if defined(__BIONIC__)
-static bool is_debuggable_build() {
-  return android::base::GetBoolProperty("ro.debuggable", false);
+// This test can't rely on ro.debuggable, because it might have been forced on
+// in a user build ("Force Debuggable"). In that configuration, ro.debuggable is
+// true, but Bionic's LD_CONFIG_FILE testing support is still disabled.
+static bool is_user_build() {
+  return android::base::GetProperty("ro.build.type", "user") == std::string("user");
 }
 #endif
 
@@ -282,7 +285,7 @@
 TEST(dl, exec_with_ld_config_file) {
 #if defined(__BIONIC__)
   SKIP_WITH_HWASAN << "libclang_rt.hwasan is not found with custom ld config";
-  if (!is_debuggable_build()) {
+  if (is_user_build()) {
     GTEST_SKIP() << "LD_CONFIG_FILE is not supported on user build";
   }
   std::string helper = GetTestlibRoot() +
@@ -319,7 +322,7 @@
 TEST(dl, exec_with_ld_config_file_with_ld_preload) {
 #if defined(__BIONIC__)
   SKIP_WITH_HWASAN << "libclang_rt.hwasan is not found with custom ld config";
-  if (!is_debuggable_build()) {
+  if (is_user_build()) {
     GTEST_SKIP() << "LD_CONFIG_FILE is not supported on user build";
   }
   std::string helper = GetTestlibRoot() +
@@ -356,8 +359,8 @@
     // This test is only for CTS.
     GTEST_SKIP() << "test is not supported with root uid";
   }
-  if (is_debuggable_build()) {
-    GTEST_SKIP() << "test is not supported on debuggable build";
+  if (!is_user_build()) {
+    GTEST_SKIP() << "test requires user build";
   }
 
   std::string error_message = std::string("CANNOT LINK EXECUTABLE ") +
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index d73f243..30da5c3 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -1355,6 +1355,8 @@
 
 TEST(malloc, allocation_slack) {
 #if defined(__BIONIC__)
+  SKIP_WITH_NATIVE_BRIDGE;  // http://b/189606147
+
   bool allocator_scudo;
   GetAllocatorVersion(&allocator_scudo);
   if (!allocator_scudo) {