Avr Flash Vtbl Save

AVR-GCC plugin that puts vtbls into program memory

Project README

This is a super minimalistic GCC plugin that makes avr-g++ put tables of vitual functions into the program memory saving RAM. It is meant to be built as a plugin for the existing avr-g++ and modify its default behavior when loaded. It is loaded into the compiler during compilation step. It has no effect at linking step. Libraries that define classes which vtables are intended to be placed into flash must be compiled with this plugin.

Building.

To build this plugin you need avr-g++ with plugins directory installed and the host gcc. You may also need to install additional headers not provided by the gcc, like gmp.h

When building for linux run

make

in the current directory.

When building for windows-hosted compiler using mingw toolchain run

make HOST_GCC=x86_64-w64-mingw32 GCCPLUGINS_DIR=

in the current directory. Make sure the HOST_GCC matches gcc that was used to build the target compiler, otherwise plugin build will fail at linking step b/o missing symbols.

Using.

Invoke avr-g++ for compilation with additional parameter

-fplugin=/avr-flash-vtbl.so

More info.

https://habrahabr.ru/company/amperka/blog/264041

More technical info.

This plugin merely adds __flash attribute to the C++ vtable and vtable pointer types. The rest is taken care of by the existing address space machinery of the gcc and flash address space support of the AVR backend.

Open Source Agenda is not affiliated with "Avr Flash Vtbl" Project. README Source: jcmvbkbc/avr-flash-vtbl
Stars
29
Open Issues
0
Last Commit
4 years ago
License

Open Source Agenda Badge

Open Source Agenda Rating