delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
DomainKey-Signature: | a=rsa-sha1; q=dns; c=nofws; |
s=beta; d=gmail.com; | |
h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; | |
b=qv27i71OW9OezCE+npkpCu0sq0I2GCCvJVugAfUGVUUm75r9UY0mZ57SnbLQWo+c9C6nPMpOaisGQrjz5+qJW1YTGf3PLuwfv9mCPRiyzidy88yIIBbSF6uCyPaYxM941DFQfx8vodcqClQ2d2WlNzBOUPoTpPdW5rK3KfysDKM= | |
Message-ID: | <2497d9a2050802141537ca5ba8@mail.gmail.com> |
Date: | Tue, 2 Aug 2005 17:15:02 -0400 |
From: | Matthew Petricone <strstream AT gmail DOT com> |
To: | djgpp AT delorie DOT com |
Subject: | ___divdi3 and ___moddi3 |
Mime-Version: | 1.0 |
Reply-To: | djgpp AT delorie DOT com |
------=_Part_14104_5990509.1123017302074 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Now that I have code that compiles, there seems to be a linking error with= =20 the folowing code. void bc_puti(long long fmt, int base) { static char buf[32] =3D {0}; int i =3D 30; if (fmt < 0) { bc_pchar('-');=20 fmt =3D -fmt; } for (;fmt && i;fmt /=3D base) { buf[i] =3D "0123456789abcdef"[fmt % base]; } bc_puts(buf); }=20 it compiles ok. but it won't like either with djgpp's ld or ld-elf it gives the following errors: undifined reference to '___moddi3' and undifined reference to '___divdi3' as i understand it they are gcc internals used for division and modulus=20 operations. Is there anway around this short of writing assembly for modulu= s=20 and division? ------=_Part_14104_5990509.1123017302074 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <div>Now that I have code that compiles, there seems to be a linking error&= nbsp; with the folowing code.</div> <div> </div> <div>void bc_puti(long long fmt, int base)<br>{<br> = static char buf[32] =3D {0};<br> int i =3D 30;<br>= if (fmt < 0)<br> {<br>&= nbsp; bc_pchar('-'); &= nbsp; <br> fmt =3D -fmt;<br>  = ; }<br> for (;fmt &&= ; i;fmt /=3D base) <br> {<br>  = ; buf[i] =3D "0123456789abcdef"[fmt % bas= e];<br> }<br> &n= bsp; bc_puts(buf);<br>} </div> <div> </div> <div> it compiles ok. but it won't like either with djgpp's ld or ld-e= lf</div> <div> </div> <div>it gives the following errors: undifined reference to '___moddi3'</div= > <div>and &= nbsp; &nbs= p; undifin= ed reference to '___divdi3'</div> <div> </div> <div>as i understand it they are gcc internals used for division and modulu= s operations. Is there anway around this short of writing assembly for modu= lus and division?</div> ------=_Part_14104_5990509.1123017302074--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |