diff options
author | Colin Cross <ccross@android.com> | 2022-09-20 02:02:24 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-09-20 02:02:24 +0000 |
commit | c02a3f59cd1753fb0665d188d19f5629a98d1e7a (patch) | |
tree | e27d23362cb8ce96bdd7564fec05e876a18797cb | |
parent | dfb586e3e2baec4df4cda217879931f1f34c7046 (diff) | |
parent | c1a30e2c017d582e0d9bdcb6aa25fe93c5795ccc (diff) | |
download | musl-c02a3f59cd1753fb0665d188d19f5629a98d1e7a.tar.gz |
Revert^2 "Remove ldso_trampoline_debugger.c" am: d9a8873d65 am: a901d35309 am: 2e25996d2a am: c6fe145e2c am: c1a30e2c01
Original change: https://android-review.googlesource.com/c/platform/external/musl/+/2218993
Change-Id: I64e97aec00e8418eabcf1f3787d0d50753451cac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | Android.bp | 2 | ||||
-rw-r--r-- | android/ldso_trampoline_debugger.c | 28 | ||||
-rw-r--r-- | android/relinterp.c | 14 |
3 files changed, 14 insertions, 30 deletions
@@ -412,7 +412,6 @@ cc_object { ], srcs: [ "android/relinterp.c", - "android/ldso_trampoline_debugger.c", ], cflags: ["-DLOADER_PATH=\"libc_musl.so\""], } @@ -569,7 +568,6 @@ cc_object { 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 e316a603..00000000 --- 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 3957a390..2bfc26da 100644 --- a/android/relinterp.c +++ b/android/relinterp.c @@ -907,6 +907,20 @@ void _start_c(long* raw_args) { 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" |