The runtime linker may store a pointer to a data structure used by debuggers. This allows gdb and lldb to debug lld-linked binaries.
I can combine it as an else case in the existing if (Config->EMachine == EM_MIPS) block if that's preferred.
Differential D15775
Add debugger rendezvous DT_DEBUG .dynamic entry emaste on Dec 24 2015, 11:19 AM. Authored by
Details The runtime linker may store a pointer to a data structure used by debuggers. This allows gdb and lldb to debug lld-linked binaries. I can combine it as an else case in the existing if (Config->EMachine == EM_MIPS) block if that's preferred.
Diff Detail Event TimelineComment Actions
Comment Actions MIPS's .dyanamic section is read-only. Instead of using DT_DEBUG for the pointer to dyld information it uses a separate tag DT_MIPS_RLD_MAP which points to storage in the read-write .rld_map section, which in turn points to the dyld information. I added the support for DT_MIPS_RLD_MAP in D1890 which has some more background. Comment Actions That is pretty horrible. Any chance we could start producing a rw dynamic Comment Actions DT_MIPS_RLD_MAP is specified in the ABI and a migration would be a long process, but it shouldn't hurt anything to emit DT_DEBUG in MIPS binaries too. GNU ld did so until relatively recently. I'm happy to go ahead with or without the Config->EMachine != EM_MIPS. Comment Actions Drop MIPS special-case; DT_DEBUG is not currently used on MIPS but it doesn't hurt anything to leave the entry there either.
|