About linker feedback
Linker feedback is a collaboration between the compiler and linker that can increase the amount of unused code that can be removed from an ELF image.
The feedback option produces a text file containing a list of unused functions, and functions that have been inlined by the linker. This information can be fed back to the compiler, which can rebuild the objects, placing these functions in their own sections. These sections can then be removed by the linker during usual unused section elimination.
The feedback file has the following format:
;#<FEEDBACK># ARM Linker, N.nn [Build num]: Last Updated: day mmm dd hh:mm:ss yyyy ;VERSION 0.2 ;FILE filename.o unused_function <= USED 0 inlined_function <= LINKER_INLINED …
The feedback file contains an entry for each object file. Each entry contains:
The object filename specified as a comment:
A list of the functions in that file that are not used:
unused_function <= USED 0
A list of the functions in that file that are inlined by the linker:
inlined_function <= LINKER_INLINED
To use linker feedback, specify --feedback file on the linker and compiler command lines.
The compiler issues a warning message if no feedback file exists. Therefore, you might want to leave the --feedback file option off the first invocation of the compiler.
Additional feedback options are provided by the linker:
If you are using scatter-loading then an executable ELF image cannot be created if your code does not fit into the region limits described in your scatter file. In this case use the --feedback_image=option command-line option.
To control the information that the linker puts into the feedback file, use the --feedback_type=type command-line option. You can control whether or not to list functions that require interworking or unused functions.