I've got a source file that contains a large number of PROGMEM lookup tables, on the order of 50 or so. Together they amount to almost 12 KB. The file is #included into another source file, and preprocessor directives select exactly one table for referencing (based on F_CPU and some other information).
I'm compiling for a target that has 8K of flash. When linking, I get "region text is full". It seems that even though only one of the lookup tables is referenced by the compiled code, they are all being linked.
I'm compiling and linking with avr-gcc (4.3.2, also tried 4.3.4). The source files are in C. The #included file is a .h, the file that #includes it is a .c.
I've tried compiling with avr-g++. The error goes away, and the linked .elf contains only the referenced lookup table, but the compile stage reports about 50 warnings (one for each lookup table) "only initialised variables can be placed into program memory area."
This seems similar to:
Admittedly, I know only a little about the build process. I imagine there is a way to tell the compiler to omit unreferenced objects, but I don't know it.