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.
Paths
| Differential D15775
Add debugger rendezvous DT_DEBUG .dynamic entry ClosedPublic Authored by emaste on Dec 24 2015, 11:19 AM.
Details Summary 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 Timelineemaste updated this object. Comment 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. emaste edited edge metadata. Comment ActionsDrop MIPS special-case; DT_DEBUG is not currently used on MIPS but it doesn't hurt anything to leave the entry there either.
This revision is now accepted and ready to land.Jan 5 2016, 9:19 AM Closed by commit rL256942: Add debugger rendezvous DT_DEBUG .dynamic entry (authored by emaste). · Explain WhyJan 6 2016, 7:56 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 44123 lld/trunk/ELF/OutputSections.cpp
lld/trunk/test/ELF/dynamic-reloc.s
lld/trunk/test/ELF/got.s
lld/trunk/test/ELF/local-got.s
lld/trunk/test/ELF/relocation-i686.s
lld/trunk/test/ELF/relocation.s
lld/trunk/test/ELF/relro.s
lld/trunk/test/ELF/shared-be.s
lld/trunk/test/ELF/shared.s
lld/trunk/test/ELF/tls-got.s
lld/trunk/test/ELF/tls-opt-gdie.s
lld/trunk/test/ELF/tls-opt-gdiele-i686.s
lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s
|