This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Wrong string address


Hello. I'm trying to compile geezer's OS dev examples (http://files.osdev.org/mirrors/geezer/osd/code/osd.zip), with gcc 4.4.2 and binutils 2.20, both compiled with Cygwin and targetting i586-elf (--target=i586-elf), on a Win XP SP3.

The problem is that in the resulting binary, the addresses of strings are wrong. Here's what I mean (in the first example, it only prints 2 strings on the screen, memcpy is used to copy bytes in the video memory):
  10011a:    6a 20                    push   $0x20
  10011c:    68 60 81 04 08           push   $0x8048160
  100121:    ff 75 fc                 pushl  -0x4(%ebp)
  100124:    e8 6a ff ff ff           call   100093 <memcpy>
// .......
  10012e:    68 a0 81 04 08           push   $0x80481a0
//........
  10013b:    50                       push   %eax
  10013c:    e8 52 ff ff ff           call   100093 <memcpy>  
These two: 0x8048160 and 0x80481a0 should be the addresses of two strings. But the correct addresses are actually at 0x100160 and 0x1001a0. With MinGW, the output is correct, and tried cross-compiling it's binutils-src package, with the same result.

Any suggestions?

Thanks,
Ilie Halip



      


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]