Arm-coff linker vs Arm-elf linker

Sarajyo Pul sarajyo123@yahoo.com
Thu May 14 18:29:00 GMT 2009


Hi,
  I could successfully build arm-elf and arm-coff cross compilers, assembler and linker for one of my project. But, when I link object files of elf format, arm-elf linker complains with undefined errors wherever global variables/functions are referenced but not defined in same object module. If I link object files of coff format for same testcase, arm-coff linker doesn't complain and could create a.out without any problem.

  Basically, I am creating the cross-compiler, assembler and linker under cygwin with gcc4.1.2 and binutils2.19.1 versions

To configure binutils for arm, I used the following command:
    $BINUTILS/configure --target=<arm-coff/arm-elf>
To configure gcc, I used the following command:
   $GCC_SRC/configure --target=<arm-coff/arm-elf> --with-gnu-ld --with-gnu-as -enable-languages=c -disable-libssp

Compilation command: $XGCC -S -O1 test1.c func1.c
Assembler command: $GNU_AS test1.s -o test1.o and 
                                 $GNU_AS func1.s -o func1.o
Linker command:        $GNU_LD test1.o func1.o
Final errors found only with arm-elf linker are:
         test1.c:(.text+0x14): undefined reference to `func1'   (NOTE: func1 defined in func1.c)
         test1.c:(.text+0x100): undefined reference to `global_var' (NOTE: global_var defined in func1.c)

I faced the same undefined reference problem on i386-elf  based binaries but not with i386-coff format. 
Am I missing something here with respect to elf based targets? Any kind of help would be very much appreciated.

Regards,
Sarajyo





More information about the Binutils mailing list