Add support for shared library load when executable called through ld.
Currently, when an executable is called like: ld-linux --library-path <path> executable, lldb is not able to load the shared libraries needed by the executable provided by library-path. lldb is not able to set Rendezvous breakpoint in this case.
This patch adds the support to enable setting rendezvous breakpoint when called using ld-*.so. It enables it to hit the breakpoint and extract the address of the rendezvous structure, which is how lldb is now able to load the shared libraries.
Inline contents of ObjectFileELF::GetRendezvousStructureAddress(...) to here. We already have the object file we need, so we can just extract the symbol from here.
I had started to try and fix this as well a few weeks ago, and I used Module::FindFirstSymbolWithNameAndType(...) to avoid having to get multiple results back:
const Symbol* _r_debug = target->GetExecutableModule()->FindFirstSymbolWithNameAndType(ConstString("_r_debug")); if (_r_debug) { info_addr = _r_debug->GetAddress().GetLoadAddress(target); if (info_addr != LLDB_INVALID_ADDRESS) { LLDB_LOGF(log, "%s resolved by finding symbol '_r_debug' whose value is 0x%" PRIx64, __FUNCTION__, info_addr); return info_addr; } }