This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] MIPS/gas: load/store address overflow on binutils 2.14
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 16 Sep 2003 21:47:57 +0200 (MET DST)
- Subject: Re: [patch] MIPS/gas: load/store address overflow on binutils 2.14
- Organization: Technical University of Gdansk
- Reply-to: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
On Tue, 16 Sep 2003, Thiemo Seufer wrote:
> > > The appended version does so. It gets also rid of the bogus
> > > HAVE_64_BIT_ADDRESS_CONSTANTS define, which was effectively an alias for
> > > HAVE_64_BIT_GPRS, and fixes the generation of constant 64-bit addresses
> > > which are not 32-bit sign extended values. I guess the latter went
> > > unnoticed for so long because kernels are usually built in the 32-bit
> > > compatibility space and userland is PIC code.
> >
> > I do build kernels as n64, but I haven't noticed any difference. I don't
> > think the difference would actually appear under any conditions
>
> Your n64 kernels are still loaded in (C)KSEG0. A kernel in XKPHYS would die.
Hmm, yes I use CKSEG0 for kernels, indeed, but:
$ cat ld.s
ld $2,0x0123456789abcdef
$ mips64el-linux-as -v -mabi=64 -march=mips64 -o ld.o ld.s
GNU assembler version 2.14 (mips64el-linux) using BFD version 2.14 20030612
$ mips64el-linux-objdump -Sr ld.o
ld.o: file format elf64-tradlittlemips
Disassembly of section .text:
0000000000000000 <.text>:
0: 3c020123 lui v0,0x123
4: 3c0189ac lui at,0x89ac
8: 64424568 daddiu v0,v0,17768
c: 0002103c dsll32 v0,v0,0x0
10: 0041102d daddu v0,v0,at
14: dc42cdef ld v0,-12817(v0)
...
Am I supposed to be a casual winner thanks to local patches? ;-)
> > -- can
> > HAVE_64BIT_ADDRESSES be true when HAVE_64_BIT_GPRS is not?
>
> Of course not, and I don't see how you came to this question. :-)
I asked, because I fail to see how bad behavior might actually get
triggered for any constants. Can you please provide examples of source
code triggering bad binary code generation by gas as of before your patch?
> I'll add the as_bad() and add a testcase tomorrow.
Thanks.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +