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:to:subject:in-reply-to:mime-version:content-type:references; b=VMc7zC4AQhnpabBE4tNzWOjaJstdMYFzxugB3kUIvd9Rj92PiqSYArbBe+IgKury3zlSty2xCK6D1+RBJUuMFYxBXzu1fnRu2bwlL/ntcP+ZJHsb6GM0IjVQoENbqH2ndyjp4OjFVAELQmGPdo038gQK3zOratWCLCHZqNA6LNs= Message-ID: <2497d9a205080400454dc1ef9d@mail.gmail.com> Date: Thu, 4 Aug 2005 03:45:40 -0400 From: Matthew Petricone To: djgpp AT delorie DOT com Subject: Re: ___divdi3 and ___moddi3 In-Reply-To: <2497d9a20508032131663f0572@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_661_12672103.1123141540101" References: <2497d9a2050802141537ca5ba8 AT mail DOT gmail DOT com> <3lbkd9F11piefU1 AT news DOT dfncis DOT de> <2497d9a20508032131663f0572 AT mail DOT gmail DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk ------=_Part_661_12672103.1123141540101 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline An Update. I found the problem. I was dividing a variable defined as "long= =20 long" in an attempt to make sure the size wasn't ever really going to be an= =20 issue. Apparently gcc handles different sized integers differently when it= =20 divides. So i just clipped it off to a long and now the problem has been=20 resolved. oddly enough... reading up on assembly brought this to mind. Thanks again for your help Mr. Broeker. On 8/4/05, Matthew Petricone wrote:=20 >=20 > On 3 Aug 2005 10:25:45 GMT, Hans-Bernhard Broeker < > broeker AT physik DOT rwth-aachen DOT de> wrote:=20 > >=20 > > Matthew Petricone wrote: > >=20 > > > it compiles ok. but it won't like either with djgpp's ld or ld-elf=20 > >=20 > > It's almost never a good idea to invoke 'ld' directly unless you have= =20 > > very > > particular reasons for doing so. Let 'gcc' handle that for you. >=20 > =20 > > it gives the following errors: undifined reference to '___moddi3' > > > and undifined reference to '___divdi3'=20 > >=20 > > Those are from libgcc.a, which a linker run coordinated by 'gcc' would > > have included automatically. >=20 > True but i'm pretty sure that would break the kernel. >=20 > -- > > Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de ) > > Even if all the snow were burnt, ashes would remain. > >=20 > I use ld-elf because I have to link the c code with asm compiled with= =20 > nasm. Plus i like to use elf since Grub seems to be easier to use with=20 > binaries in ELF format. I beleive there is a way around that though.=20 > The funny thing is, I use the divide operator in other files, and they= =20 > don't throw me the error upon linking. >=20 > ------=_Part_661_12672103.1123141540101 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
An Update. I found the problem. I was dividing a variable defined as &= quot;long long" in an attempt to make sure the size wasn't ever really= going to be an issue. Apparently gcc handles different sized integers diff= erently when it divides.  So i just clipped it off to a long and now t= he problem has been resolved.
 
oddly enough... reading up on assembly brought this to mind.
 
Thanks again for your help Mr. Broeker.

 
On 8/4/05, M= atthew Petricone <strstream AT g= mail.com> wrote:
On 3 Aug 2005 10:25:45 G= MT, Hans-Bernhard Broeker < broeker AT physik DOT rwth-aachen DOT de> wrote:=20
Matthew Petricone < strstream AT gmail DOT com> wrote:

>   it compiles ok. = but it won't like either with djgpp's ld or ld-elf

It's almost neve= r a good idea to invoke 'ld' directly unless you have very
particular re= asons for doing so.  Let 'gcc' handle that for you.
 
 

>  it gives the fol= lowing errors: undifined reference to '___moddi3'
> and undifined ref= erence to '___divdi3'=20

Those are from libgcc.a, which a linker run coordinated by 'gcc' wo= uld
have included automatically.
 
True but i'm pretty sure that would break the kernel.

--
Hans-Ber= nhard Broeker ( broeker AT physik DOT rwth-aachen DOT de )
Even if all the snow were burnt, ash= es would remain.
 
 I use ld-elf because I have to link the c code with asm com= piled with nasm. Plus i like to use elf since Grub seems to be easier to us= e with binaries in ELF format. I beleive there is a way around that though.=
 
The funny thing is, I use the divide operator in other files, and they= don't throw me the error upon linking.

 

------=_Part_661_12672103.1123141540101--