Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DabDp-00047V-Ct for qemu-devel@nongnu.org; Tue, 24 May 2005 11:21:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DabDl-00044N-NX for qemu-devel@nongnu.org; Tue, 24 May 2005 11:21:30 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DabDk-00041j-2R for qemu-devel@nongnu.org; Tue, 24 May 2005 11:21:28 -0400 Received: from [213.68.205.162] (helo=b.mx.secunet.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dab7i-00075P-RR for qemu-devel@nongnu.org; Tue, 24 May 2005 11:15:20 -0400 From: "Nardmann, Heiko" Subject: Re: [Qemu-devel] Building qemu on UltraSparc Date: Tue, 24 May 2005 17:14:24 +0200 References: <200505241220.j4OCKkXq022785@imap3.tools.intra> In-Reply-To: <200505241220.j4OCKkXq022785@imap3.tools.intra> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6208820.iu8PItZu2v"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200505241714.40595.heiko.nardmann@secunet.com> Reply-To: "Nardmann, Heiko" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Juergen Keil --nextPart6208820.iu8PItZu2v Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Dienstag 24 Mai 2005 14:20, Juergen Keil wrote: [snip] > > ld: fatal: relocation error: R_SPARC_WDISP22: file libqemu.a(op.o): > > symbol __op_gen_label1: value 0x34c21f does not fit > > ... > > ld: fatal: relocation error: R_SPARC_WDISP22: file libqemu.a(op.o): > > symbol __op_gen_label1: value 0x34a0d3 does not fit > > > > collect2: ld returned 1 exit status > > > > Any idea what is happening here? > > Part of the problem is my GOTO_LABEL_PARAM macro for sparc, in > dyngen-exec.h: > > #define GOTO_LABEL_PARAM(n) asm volatile ("ba " > ASM_NAME(__op_gen_label) #n ";nop") > > > We have 22 bits in the branch instruction to encode a signed 32-bit word > offset, relative to the current PC. The target address is always a > multiple of 4, so the offset encoded in the branch instruction is an > offset measured in 32-bit words. > > > The sparc branch instructions cannot jump forward / backward more than > 8 mbytes (2^21 * 4 =3D 8mbyte). > > > What appears to be happening on your system is that the opcode > templates from the code section for "target-i386/op.c" (these contain > the "ba" branch instruction from the GOTO_LABEL_PARAM macro) jump to an > integer variable that is allocated somewhere in the data or bss section > (the "int __op_gen_label1" variable defined in dyngen.h), and the code > & data section on your system are more than 8 mbytes apart. > > > Apparently I had luck upto now, because on my solaris 10 sparc box there > have been no such issues with R_SPARC_WDISP22 relocation errors. > > > ld: fatal: relocation error: R_SPARC_WDISP22: file libqemu.a(op.o): > > symbol __op_gen_label1: value 0x34c21f does not fit > > --> 0x34c21f * 4 =3D 13830268 =3D 13.8 mbytes > > > I guess this can be fixed by moving the branch target "__op_gen_label1" > from the data section to the code section. A "size" on my sparc qemu > binary reports a total code size of ~ 1 mbyte, so that there should be > no issues with R_SPARC_WDISP22 overflows when both the branch instruction > and the branch target are both in the code (.text) section. > [snip] Although I do not fully understand your explanation ... it works now with y= our=20 patch. Thanks! Does this stuff go into CVS? =2D-=20 Heiko Nardmann (Dipl.-Ing. Technische Informatik) secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de), Weidenauer Str. 223-225, D-57076 Siegen Tel. : +49 271 48950-13, Fax : +49 271 48950-50 --nextPart6208820.iu8PItZu2v Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBCk0Tgpm53PRScYygRAhUJAKDyhmXYwojRHvvqLhDnOLy18szacACdFhVC NVikiatgUOJcAuznenX0aMY= =EsOL -----END PGP SIGNATURE----- --nextPart6208820.iu8PItZu2v--