Enable linker configuration from generator by default

Current linker configuration is only enabled from fully treblelized
devices. This change will allow linker to first check generated linker
configuration even for non-treblelized devices and recovery.

Bug: 139638519
Test: Tested from cuttlefish
Change-Id: I655b1ab807cd8db5696d07fd2bdd00ce0558901d
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 2f52327..4bcb896 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -4054,19 +4054,6 @@
     return kLdConfigVndkLiteFilePath;
   }
 
-  // Use generated linker config if flag is set
-  // TODO(b/138920271) Do not check property once it is confirmed as stable
-  // TODO(b/139638519) This file should also cover legacy or vndk-lite config
-  if (android::base::GetProperty("ro.vndk.version", "") != "" &&
-      android::base::GetBoolProperty("sys.linker.use_generated_config", true)) {
-    if (file_exists(kLdGeneratedConfigFilePath)) {
-      return kLdGeneratedConfigFilePath;
-    } else {
-      DL_WARN("Warning: failed to find generated linker configuration from \"%s\"",
-              kLdGeneratedConfigFilePath);
-    }
-  }
-
   std::string ld_config_file_vndk = kLdConfigFilePath;
   size_t insert_pos = ld_config_file_vndk.find_last_of('.');
   if (insert_pos == std::string::npos) {
@@ -4095,6 +4082,18 @@
             path.c_str(), executable_path);
   }
 
+  // Use generated linker config if flag is set
+  // TODO(b/138920271) Do not check property once it is confirmed as stable
+  if (android::base::GetBoolProperty("sys.linker.use_generated_config", true)) {
+    if (file_exists(kLdGeneratedConfigFilePath)) {
+      return kLdGeneratedConfigFilePath;
+    } else {
+      DL_WARN("Warning: failed to find generated linker configuration from \"%s\"",
+              kLdGeneratedConfigFilePath);
+    }
+  }
+
+
   path = kLdConfigArchFilePath;
   if (file_exists(path.c_str())) {
     return path;