|
Technical Support Support Resources Product Information | GCC: LINK PROBLEMS AFTER CHANGING COMPILER TOOLCHAIN
Information in this article applies to: - GNU C Compiler for ARM Version 3.22
QUESTIONMy ARM project was previously configured for the ARM ADS or Keil ARM toolchain. Since I have changed it to the GNU toolset I can no longer link my program. I changed the Startup Code (Startup.s), but when I link my application I receive several error messages from the linker:
linking...
arm-thumb-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008000
startup.o(.text+0x14c):/cygdrive/h/TestProject/Startup.s:250: undefined reference to '_data'
collect2: ld returned 1 exit status
Target not created
ANSWERThe following things are required for a GNU project setup: - In most cases you need a Linker Script file, that fits the controller configuration you are using. The generic linker script can be found under \ARM\GNU\LinkerScript.ld. Copy this file to your project and customize it according to your needs. Alternatively you may use a preconfigured *.ld file from one of the example projects in \ARM\GNU\Examples or \ARM\GNU\Boards. Specify the file under Options for Target - Linker.
- Enter the start address of the Text Section (used for Code/Constants) and the Data Section. These settings can be made Options for Target - Linker. Be sure that the start address is within the range of the areas defined in your Linker Description File.
- Make sure that you have activated the checkbox Do not use Standard System Startup Files. Otherwise, your Startup.s is not used and the Standard Startup is unsuitable for most controllers.
MORE INFORMATION- Getting Started User's Guide for ARM, CPU Setup
Last Reviewed: Monday, July 10, 2006
|