Keil Logo Arm Logo

Technical Support

On-Line Manuals

Linker Reference Guide

Conventions and feedback Linker command-line options --any_contingency --any_placement=algorithm --any_sort_order=order --api, --no_api --arm_only --autoat, --no_autoat --be8 --be32 --bestdebug, --no_bestdebug --branchnop, --no_branchnop --callgraph, --no_callgraph --callgraph_file=filename --callgraph_output=fmt --cgfile=type --cgsymbol=type --cgundefined=type --combreloc, --no_combreloc --comment_section, --no_comment_section --compress_debug, --no_compress_debug --cppinit, --no_cppinit --cpu=list --cpu=name --crosser_veneershare, --no_crosser_veneershare --datacompressor=opt --debug, --no_debug --diag_error=tag[,tag,...] --diag_remark=tag[,tag,...] --diag_style=arm|ide|gnu --diag_suppress=tag[,tag,...] --diag_warning=tag[,tag,...] --eager_load_debug, --no_eager_load_debug --edit=file_list --emit_debug_overlay_relocs --emit_debug_overlay_section --emit_non_debug_relocs --emit_relocs --entry=location --errors=filename --exceptions, --no_exceptions --exceptions_tables=action --feedback=filename --feedback_image=option --feedback_type=type --filtercomment, --no_filtercomment --fini=symbol --first=section_id --force_explicit_attr --fpu=list --fpu=name --help --info=topic[,topic,...] --info_lib_prefix=opt --init=symbol --inline, --no_inline --inlineveneer, --no_inlineveneer input-file-list --keep=section_id --keep_protected_symbols --largeregions, --no_largeregions --last=section_id --ldpartial --legacyalign, --no_legacyalign --libpath=pathlist --library_type=lib --licretry --list=filename --list_mapping_symbols, --no_list_mapping_symbols --load_addr_map_info, --no_load_addr_map_info --locals, --no_locals --ltcg --mangled, --unmangled --map, --no_map --match=crossmangled --max_veneer_passes=value --max_visibility=type --merge, --no_merge --muldefweak, --no_muldefweak --output=filename --override_visibility --pad=num --paged --pagesize=pagesize --partial --piveneer, --no_piveneer --predefine="string" --reduce_paths, --no_reduce_paths --ref_cpp_init, --no_ref_cpp_init --reloc --remarks --remove, --no_remove --ro_base=address --ropi --rosplit --rw_base=address --rwpi --scanlib, --no_scanlib --scatter=filename --section_index_display=type --show_cmdline --show_full_path --show_parent_lib --show_sec_idx --sort=algorithm --split --startup=symbol, --no_startup --strict --strict_enum_size, --no_strict_enum_size --strict_flags, --no_strict_flags --strict_ph, --no_strict_ph --strict_relocations, --no_strict_relocations --strict_symbols, --no_strict_symbols --strict_visibility, --no_strict_visibility --strict_wchar_size, --no_strict_wchar_size --symbols, --no_symbols --symdefs=filename --tailreorder, --no_tailreorder --thumb2_library, --no_thumb2_library --tiebreaker=option --undefined=symbol --undefined_and_export=symbol --unresolved=symbol --use_definition_visibility --userlibpath=pathlist --veneerinject,--no_veneerinject --veneer_inject_type=type --veneer_pool_size=size --veneershare, --no_veneershare --verbose --version_number --vfemode=mode --via=filename --vsn --xref, --no_xref --xrefdbg, --no_xrefdbg --xref{from|to}=object(section) --zi_base=address Linker steering file command reference Formal syntax of the scatter file

--callgraph, --no_callgraph

--callgraph, --no_callgraph

This option creates a file containing a static callgraph of functions. The callgraph gives definition and reference information for all functions in the image.


If you use the --partial option to create a partially linked object, then no callgraph file is created.


The callgraph file:

  • is saved in the same directory as the generated image.

  • has the same name as the linked image. Use the --callgraph_file=filename option to specify a different callgraph filename.

  • has a default output format of HTML. Use the --callgraph_output=fmt option to control the output format.


If the linker is to calculate the function stack usage, any functions defined in the assembler files must have the appropriate:

  • PROC and ENDP directives

  • FRAME PUSH and FRAME POP directives.

For each function func the linker lists the:

  • processor state for which the function is compiled (ARM or Thumb)

  • set of functions that call func

  • set of functions that are called by func

  • number of times the address of func is used in the image.

In addition, the callgraph identifies functions that are:

  • called through interworking veneers

  • defined outside the image

  • permitted to remain undefined (weak references)

  • called through a Procedure Linkage Table (PLT)

  • not called but still exist in the image.

The static callgraph also gives information about stack usage. It lists the:

  • size of the stack frame used by each function

  • maximum size of the stack used by the function over any call sequence, that is, over any acyclic chain of function calls.

If there is a cycle, or if the linker detects a function with no stack size information in the call chain, + Unknown is added to the stack usage. A reason is added to indicate why stack usage is unknown.

The linker reports missing stack frame information if there is no debug frame information for the function.

For indirect functions, the linker cannot reliably determine which function made the indirect call. This might affect how the maximum stack usage is calculated for a call chain. The linker lists all function pointers used in the image.

Use frame directives in assembly language code to describe how your code uses the stack. These directives ensure that debug frame information is present for debuggers to perform stack unwinding or profiling.


The default is --no_callgraph.

Copyright © 2008, 2011-2012 ARM. All rights reserved.ARM DUI 0458C

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.