[PATCH, MIPS] Support shared library debug with MIPS PIE (glibc)
Matthew Fortune
Matthew.Fortune@imgtec.com
Tue Jun 23 15:45:00 GMT 2015
Joseph Myers <joseph@codesourcery.com> writes:
> On Tue, 23 Jun 2015, Matthew Fortune wrote:
>
> > -/* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill
> it in
> > - with the run-time address of the r_debug structure */
> > +/* If there is a DT_MIPS_RLD_MAP2 or DT_MIPS_RLD_MAP entry in the
> dynamic
> > + section, fill in the debug map pointer with the run-time address
> of the
> > + r_debug structure. */
> > #define ELF_MACHINE_DEBUG_SETUP(l,r) \ -do { if ((l)->l_info[DT_MIPS
> > (RLD_MAP)]) \
> > +do { if ((l)->l_info[DT_MIPS (RLD_MAP2)]) \
> > + { \
> > + char *ptr = (char *)(l)->l_info[DT_MIPS (RLD_MAP2)]; \
> > + ptr += (l)->l_info[DT_MIPS (RLD_MAP2)]->d_un.d_val; \
> > + *(ElfW(Addr) *)ptr = (ElfW(Addr)) (r); \
> > + } \
> > + else if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
>
> What if there are both DT_MIPS_RLD_MAP2 and DT_MIPS_RLD_MAP? Will that
> never happen?
That will happen for executables much like MIPS has an unused DT_DEBUG
entry. I figured it would be better to add DT_MIPS_RLD_MAP2 to all
executables allowing this to be the only tag supported by dynamic linkers
that may not care about compatibility with pre-existing executables.
Are you thinking there should be a consistency check that the two tags
lead to the same address? I guess there would be no harm in that but
equally it may not be of much value. What do you think?
Matthew
More information about the Libc-alpha
mailing list