On AVR target g++ generates code which copies object’s VTABLES from FLASH to SRAM wasting the memory. Due to the Harvard architecture of AVR processors the solution is not trivial. This behavior can be observed in any c++ program which has object with virtual method, e.g: Class test { virtual void example(); };
The VTABLE of class test will be generated in FLASH and next copied to SRAM, any reference to virtual example() method will take the method address from SRAM. -- Summary: g++ puts VTABLES in SRAM Product: gcc Version: 4.3.5 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tfrancuz at mp dot pl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43745