[arm-gnu] Linking errors for STM32F4-Discovery using Codebench Lite

Carlos O'Donell carlos_odonell at mentor.com
Mon Jun 11 17:59:22 UTC 2012


On 6/11/2012 11:03 AM, Prashanth Ravindran wrote:
> My code compiles fine with sourcery_codebench_lite_for_arm_eabi but
> at the linking stage the following errors are thrown. Am I missing
> some .o’s in my projet. I am using the code sourcery version that
> uses gcc 4.6.1. The code is in C++. Can you please tell me if I am
> missing anything. The board that I am targeting is a
> STM32F4-Discovery board.
> 
> 
> 
> Apologies if this is a very basic question. I am just moving into the
> embedded world from the application world.

Welcome! There is a lot to learn. Good luck!

> c:/program
> files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/bin/ld.exe:
> warning: cannot find entry symbol _start; defaulting to 00008018

You are compiling without a linker script or your linker script is broken.

You must define a _start symbol, normally in bare-metal this is the same as your reset function.

> c:/program
> files/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib\libc.a(lib_a-abort.o):
> In function `abort':
> 
> abort.c:(.text+0x10): undefined reference to `_exit'

You are missing implementations of all your low-level IO routines.

You generally need to provide these yourself or your RTOS provides them and you wire them up.

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell at mentor.com
carlos at codesourcery.com
+1 (613) 963 1026



More information about the arm-gnu mailing list