This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, MIPS] Support shared library debug with MIPS PIE
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Matthew Fortune <Matthew dot Fortune at imgtec dot com>, "'binutils\ at sourceware dot org'" <binutils at sourceware dot org>, "Maciej W. Rozycki \(macro\ at linux-mips dot org\)" <macro at linux-mips dot org>
- Date: Thu, 23 Jul 2015 22:27:44 +0100
- Subject: Re: [PATCH, MIPS] Support shared library debug with MIPS PIE
- Authentication-results: sourceware.org; auth=none
- References: <6D39441BF12EF246A7ABCE6654B0235321175C6A at LEMAIL01 dot le dot imgtec dot org> <87381ii9iy dot fsf at googlemail dot com> <6D39441BF12EF246A7ABCE6654B0235321176D73 at LEMAIL01 dot le dot imgtec dot org> <6D39441BF12EF246A7ABCE6654B02353211AFA73 at LEMAIL01 dot le dot imgtec dot org> <alpine dot DEB dot 2 dot 10 dot 1507231653450 dot 26532 at digraph dot polyomino dot org dot uk>
Joseph Myers <joseph@codesourcery.com> writes:
> On Fri, 26 Jun 2015, Matthew Fortune wrote:
>> + dt_addr = (sdyn->output_section->vma + sdyn->output_offset
>> + + b - sdyn->contents);
>
> For the case of n64 target and 32-bit host, this results in
> sdyn->output_section->vma + sdyn->output_offset (64-bit) being added
> to b (32-bit host pointer), so losing the high part and resulting in
> an incorrect DT_MIPS_RLD_MAP_REL tag, and all dynamically linked glibc
> tests failing for n64.
Ouch.
> This patch fixes this (spot-tested with glibc
> tests; however, I don't have a self-contained testcase for this bug).
>
> 2015-07-23 Joseph Myers <joseph@codesourcery.com>
>
> * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
> <DT_MIPS_RLD_MAP_REL>: Add target address to host address
> difference, not to host pointer.
OK, thanks.
Richard