Remove ldso_trampoline_debugger.c

Move ldso_tramsoline_debugger.c into relinterp.c to remove the need
for an ld -r step during compilation.

Bug: 242601708
Test: m USE_HOST_MUSL=true bzip2
Change-Id: I05cdee7a4c36411afeabcd5b1445e651498fa5fe
diff --git a/Android.bp b/Android.bp
index 41bd50b..d23492e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -412,7 +412,6 @@
     ],
     srcs: [
         "android/relinterp.c",
-        "android/ldso_trampoline_debugger.c",
     ],
     cflags: ["-DLOADER_PATH=\"libc_musl.so\""],
 }
@@ -569,7 +568,6 @@
     defaults: ["libc_musl_crt_defaults"],
     srcs: [
         "android/relinterp.c",
-        "android/ldso_trampoline_debugger.c",
     ],
     cflags: ["-DLOADER_PATH=\"libc_musl.so\""],
 }
diff --git a/android/ldso_trampoline_debugger.c b/android/ldso_trampoline_debugger.c
deleted file mode 100644
index e316a60..0000000
--- a/android/ldso_trampoline_debugger.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-// Normally gdb and lldb look for a symbol named "_dl_debug_state" in the
-// interpreter to get notified when the dynamic loader has modified the
-// list of shared libraries.  When using the embeded linker, the debugger is not
-// aware of the interpreter (PT_INTERP is unset and auxv AT_BASE is 0) so it
-// doesn't know where to look for the symbol.  It falls back to looking in the
-// executable, so provide a symbol for it to find.  The dynamic loader will
-// need to forward its calls to its own _dl_debug_state symbol to this one.
-//
-// This has to be defined in a .c file because lldb looks for a symbol with
-// DWARF language type DW_LANG_C.
-extern void _dl_debug_state() {
-}
diff --git a/android/relinterp.c b/android/relinterp.c
index 3957a39..2bfc26d 100644
--- a/android/relinterp.c
+++ b/android/relinterp.c
@@ -907,6 +907,20 @@
   fatal("AT_BASE not found in aux vector");
 }
 
+
+// Normally gdb and lldb look for a symbol named "_dl_debug_state" in the
+// interpreter to get notified when the dynamic loader has modified the
+// list of shared libraries.  When using relinterp, the debugger is not
+// aware of the interpreter (PT_INTERP is unset and auxv AT_BASE is 0) so it
+// doesn't know where to look for the symbol.  It falls back to looking in the
+// executable, so provide a symbol for it to find.  The dynamic loader will
+// need to forward its calls to its own _dl_debug_state symbol to this one.
+//
+// This has to be defined in a .c file because lldb looks for a symbol with
+// DWARF language type DW_LANG_C.
+extern void _dl_debug_state() {
+}
+
 __asm__ (
 "  .section " NOTE_SECTION_NAME ",\"a\",%note\n"
 "  .balign 4\n"