10.11.2. Linker errors

These are common linker errors:

Undefined symbols: __rt_... or __16__rt_...

The linker reports a number of undefined symbols of the form:

__rt_... or __16__rt_...


These are runtime support functions called by compiler-generated code to perform tasks that cannot be performed simply in ARM or Thumb code (for example, integer division or floating-point operations).

For example, the following code generates a call to runtime support function __rt_sdiv to perform a division.

int test(int a, int b)
  return a / b;


Link with a C library so that these functions are defined.

Undefined symbols: __rt_stkovf_split_big or __rt_stkovf_split_small

The linker reports one of the symbols __rt_stkovf_split_big or __rt_stkovf_split_small as being undefined.


You have compiled your C code with software stack checking enabled. The C compiler generates code that calls one of the above functions when stack overflow is detected.

  • Recompile your C code with stack checking disabled. Stack checking is disabled by default.

  • Link with a C library that provides support for stack limit checking. This is usually possible only in an application environment because C library stack overflow handling code relies heavily on the application environment.

  • Write a pair of functions __rt_stkovf_split_big and __rt_stkovf_split_small, the code for which usually generates an error for debugging purposes. This effectively means that the application has a fixed size stack.

    The code might look similar to the following:

    	EXPORT		__rt_stkovf_split_big
    	EXPORT 		__rt_stkovf_split_small
        	ADR 		R0, stack_overflow_message
        	SWI		Debug_Message 					; System-dependent SWI
                              								; to write a debugging
    forever								; message and loop forever.
        	B		forever					
    	DCB     "Stack overflow", 0

Attribute conflict in the linker

The linker generates an error similar to the following:

ARM Linker: (Warning) Attribute conflict between AREA
test2.o(C$$code) and image code.
ARM Linker: (attribute difference = {NO_SW_STACK_CHECK}).


Parts of your code have been compiled or assembled with software stack checking enabled and parts without. Alternatively, you have linked with a library that has software stack checking enabled whereas your code has it disabled, or vice versa.


Recompile your C code with stack checking disabled. Stack checking is disabled by default. Link with a library built with the same options.

undefined __main

The linker reports __main as being undefined.


When the compiler compiles the function main(), it generates a reference to the symbol __main to force the linker to include the basic C runtime system from the ANSI semihosted C library. If you are not linking with an ANSI semihosted C library and have a function main() you may get this error.


This problem may be fixed in one of the following ways:

  • If the main() function is used only when building an application version of your ROM image for debugging purposes, comment it out with an #ifdef when building a ROM image.

  • When building a ROM image and linking with the Embedded C Library, call the C entry point something other than main(), such as C_Entry or ROM_Entry.

  • If you do need a function called main(), define a symbol __main in your ROM initialization code. Usually this is defined to be the entry point of the ROM image, so you should define it just before the ENTRY directive as follows:

	EXPORT __main
	B main
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D