views:

407

answers:

1

I am using Msys to build a home brew kernel that I wrote under Linux. Linux used ELF for its binary format and Msys uses PE. I have the source setup to allow it to be booted by Grub using the Multiboot spec. At the end of the build, I get some undefined symbols:

init.o:init.S:(.text+0x14): undefined reference to `edata'

main.o:main.c:(.text+0x121): undefined reference to `_alloca'

main.o:main.c:(.text+0x126): undefined reference to `__main'

../../lib\libkern.a(mem.o):mem.c:(.text+0x242): undefined reference to `_end'

../../lib\libkern.a(mem.o):mem.c:(.text+0x323): undefined reference to `_end'

These appear to be ELF oriented symbols. If anyone can advise me on how these should be dealt with in the PE world, e.g. if there are equivalents, it would help me out a lot!

A: 

There are tools to convert different object file formats, but they may not do what you need.

I would assume that you need to configure your compiler (gcc) as a cross compiler to genererate the correct format for your Msys environment.

lothar
no, i'm trying to compile a kernel. i've been compiling it under linux, which is elf, and i now want to start compiling it under msys, which is pe.
Frank Miller
I did not mean that you are compiling a kernel, but if you compile for a different platform than the platform your compiler is running on you need a cross compiler for that target platform (in your case Msys).
lothar