Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wrong string address

0 views
Skip to first unread message

Grunt

unread,
Nov 14, 2009, 4:23:46 AM11/14/09
to
Hello. I have a problem with both GCC 3.4.6 and 4.4.2, both cross-
compilers that target i586-elf. It's the fact that addresses of
strings are not correct in the generated code. I'm trying to build
this example of a simple operating system - http://files.osdev.org/mirrors/geezer/osd/index.htm

1. Using MinGW to compile them generates this:
100102: b9 00 10 10 00 mov $0x101000,%ecx
// ..............
10012e: e8 5d ff ff ff call 0x100090
// ..............
10013b: b8 40 10 10 00 mov $0x101040,%eax
// ..............
100148: e8 43 ff ff ff call 0x100090

0x101000 and 0x101040 are the addresses of two strings it prints on
the screen.

2. Using gcc 4.4.2/binutils 2.19.1, the addresses are wrong:
100121: 68 40 81 04 08 push $0x8048140
// ..............
100129: e8 65 ff ff ff call 100093 <memcpy>
// ..............
100133: 68 80 81 04 08 push $0x8048180
// ..............
100141: e8 4d ff ff ff call 100093 <memcpy>

This time, the addresses are wrong, they should be 0x1001a0 and
1001b2.

Does anyone have any clues on to how to fix this issue? Should I try
other versions of binutils/gcc?

0 new messages