[MTE] do not use ldg in linker if MTE is off for process

Test: with and without MTE:
      atest libprocinfo_test bionic-unit-tests bionic-unit-tests-static debuggerd_test memtag_stack_dlopen_test
Bug: 381781855
Change-Id: I3f6923715d2ce442a2e8c23215f36911b305ede3
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 8f78915..0b829b3 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -2369,8 +2369,10 @@
         }
         void* tls_block = get_tls_block_for_this_thread(tls_module, /*should_alloc=*/true);
         *symbol = static_cast<char*>(tls_block) + sym->st_value;
-      } else {
+      } else if (__libc_mte_enabled()) {
         *symbol = get_tagged_address(reinterpret_cast<void*>(found->resolve_symbol_address(sym)));
+      } else {
+        *symbol = reinterpret_cast<void*>(found->resolve_symbol_address(sym));
       }
       failure_guard.Disable();
       LD_LOG(kLogDlsym,