This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] MIPS/gas: load/store address overflow on binutils 2.14


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        +


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