This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb 5.0: solib.c (LM_ADDR) should be signed, not unsigned (fwd)


"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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]