--callgraph, --no_callgraph
Creates a file containing a static callgraph of functions.
The callgraph gives definition and reference information for all functions in the image.
Note
If you use the --partial
option to create a partially linked object,
then no callgraph file is created.
Usage
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.
Note
If the linker is to calculate the function stack usage, any functions defined in the assembler files must have the appropriate:
PROC
andENDP
directives.FRAME PUSH
andFRAME POP
directives.
The linker lists the following for each function func
:
Instruction set 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.
Default
The default is --no_callgraph
.