ANDROID: Support debugging libraries loaded by the embedded linker

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 we can provide a symbol
in the trampoline for it to find.  The dynamic loader is then modified
to also find the symbol in the exectuable and to call it from its own
_dl_debug_state function.

Bug: 190084016
Test: gdb and lldb can list shared libraries
Change-Id: Iff91700f6b56acf29e434a966f6a32418e22f862
3 files changed