AVR: Support new linker option -mprune-vectab
GCC's AVR backend now supports the -mprune-vectab option, acting as a frontend for a new linker feature to prune vector tables.
The GCC AVR backend has gained support for the new target option -mprune-vectab. This option serves as a frontend for a corresponding linker feature (--prune-vectab) that aims to optimize by removing unused entries from vector tables. The compiler option is active only when the linker supports the feature, which is verified during configuration.
In Details
The AVR target support in GCC is extended to include the -mprune-vectab option. This option is defined in config/avr/avr.opt and integrated into the linker command line via config/avr/specs.h using %(link_prune_vectab). The configure.ac script checks for linker support (HAVE_LD_AVR_PRUNE_VECTAB) and conditional compilation in config/avr/gen-avr-mmcu-specs.cc ensures the spec is emitted only when supported. This allows the compiler to leverage the linker's capability to prune vector tables.
- AVR
- A family of microcontrollers manufactured by Atmel (now Microchip Technology), commonly used in embedded systems.
- vector table
- A table in memory, typically at the start of program execution, that contains pointers to interrupt service routines and other exception handlers.
- linker
- A program that combines object files and libraries into a single executable program.
- target option
- A compiler flag that controls aspects of code generation specific to a particular target architecture or platform.