This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: gdb 5.0: solib.c (LM_ADDR) should be signed, not unsigned (fwd)
- To: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- Subject: Re: gdb 5.0: solib.c (LM_ADDR) should be signed, not unsigned (fwd)
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 22 Jun 2000 07:32:01 +1000
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <Pine.GSO.3.96.1000621161429.28897T-100000@delta.ds2.pg.gda.pl>
"Maciej W. Rozycki" wrote:
>
> ---------- Forwarded message ----------
> Message-ID: <Pine.GSO.3.96.1000619191851.10348S-100000@delta.ds2.pg.gda.pl>
> Date: Mon, 19 Jun 2000 19:29:18 +0200 (MET DST)
> From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
> To: bug-gdb@gnu.org
> Subject: gdb 5.0: solib.c (LM_ADDR) should be signed, not unsigned
>
> Hi,
>
> The SVR4 ABI specifies the base address to be a difference between the
> load address and the link-time address. Currently it is treated as an
> unsigned value. This causes problems on 32-bit platforms, where 64-bit
> BFD is available. I've been able to observe it for elf32-littlemips.
> Given a link-time address of about 0x5000000 and a load address of about
> 0x20000000, LM_ADDR is about -0x30000000 or 0xc0000000. Due to an
> unsigned promotion of LM_ADDR gdb calculates section addresses incorrectly
> to be about 0x120000000 (obviously incorrect for a 32-bit target).
>
> The following patch fixes this problem for me.
FYI,
BFD is (hopefully) about to be ``fixed'' for the mips - always return
sign extended addresses. This in turn will mean that GDB gets fixed.
You may want to sit on any MIPS related 32/64/sign patches until the
dust settles from the initial BFD changes.
Andrew