ARM Technical Support Knowledge Articles

LINK PROBLEMS AFTER CHANGING COMPILER TOOLCHAIN

Applies to: GNU C Compiler for ARM

Answer


Information in this article applies to:


QUESTION

My 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

ANSWER

The following things are required for a GNU project setup:

  1. 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 ARMGNULinkerScript.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 ARMGNUExamples or ARMGNUBoards. Specify the file under Options for Target - Linker.
  2. 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.
  3. 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

Article last edited on: 2006-07-10 18:42:15

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential