Mail Archives: djgpp/2005/08/04/03:46:39
------=_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 <strstream AT gmail DOT com> 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 <strstream AT gmail DOT com> 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
<div>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.
</div>
<div> </div>
<div>oddly enough... reading up on assembly brought this to mind.</div>
<div> </div>
<div>Thanks again for your help Mr. Broeker.<br><br> </div>
<div><span class=3D"gmail_quote">On 8/4/05, <b class=3D"gmail_sendername">M=
atthew Petricone</b> <<a href=3D"mailto:strstream AT gmail DOT com">strstream AT g=
mail.com</a>> wrote:</span>
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><span class=3D"q"><span class=3D"gmail_quote">On 3 Aug 2005 10:25:45 G=
MT, <b class=3D"gmail_sendername">Hans-Bernhard Broeker</b> <<a onclick=
=3D"return top.js.OpenExtLink(window,event,this)" href=3D"mailto:broeker AT ph=
ysik.rwth-aachen.de" target=3D"_blank">
broeker AT physik DOT rwth-aachen DOT de</a>> wrote:</span>=20
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Matthew Petricone <<a onclick=
=3D"return top.js.OpenExtLink(window,event,this)" href=3D"mailto:strstream@=
gmail.com" target=3D"_blank">
strstream AT gmail DOT com</a>> wrote:<br><br>> it compiles ok. =
but it won't like either with djgpp's ld or ld-elf <br><br>It's almost neve=
r a good idea to invoke 'ld' directly unless you have very<br>particular re=
asons for doing so. Let 'gcc' handle that for you.
</blockquote>
<div> </div>
<div> </div><br>
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">> it gives the fol=
lowing errors: undifined reference to '___moddi3'<br>> and undifined ref=
erence to '___divdi3'=20
<br><br>Those are from libgcc.a, which a linker run coordinated by 'gcc' wo=
uld<br>have included automatically.</blockquote>
<div> </div></span>
<div>True but i'm pretty sure that would break the kernel.</div><br>
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">--<span class=3D"q"><br>Hans-Ber=
nhard Broeker (<a onclick=3D"return top.js.OpenExtLink(window,event,this)" =
href=3D"mailto:broeker AT physik DOT rwth-aachen DOT de" target=3D"_blank">
broeker AT physik DOT rwth-aachen DOT de</a> )<br>Even if all the snow were burnt, ash=
es would remain.<br></span></blockquote></div>
<div> </div>
<div> 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.=
</div>
<div> </div>
<div>The funny thing is, I use the divide operator in other files, and they=
don't throw me the error upon linking.<br><br> </div></blockquote></d=
iv><br>
------=_Part_661_12672103.1123141540101--
- Raw text -