While the attribute 'unused' only removes a warning, the
attribute 'used' actually prevents the linker from removing
the object. The objects in question are dummy objects to
prevent the linker from even trying to put anything else there.
Change the Makefile to remove the sections in question (banks 1/2/3)
from the SREC file, since they contain uninitialized data anyway.
EOC = e-objcopy
ECFLAGS = -Os -std=c99 -falign-loops=8 -falign-functions=8 -Wall -fsingle-precision-constant -ffast-math
ELFLAGS = -T$(EPIPHANY_HOME)/bsps/current/internal.ldf -le-lib
-EOFLAGS = -R .shared_dram
+EOFLAGS = -R .shared_dram -R .data_bank1 -R .data_bank2 -R .data_bank3
# host application
HAPP = $(DEST)/ep_main
/* statically allocate dummy memory and local block overlay
to prevent linker from putting stuff in banks 1..3 */
-static uint8_t dummy_bank1[8192] UNUSED SECTION(".data_bank1");
-static uint8_t dummy_bank2[8192] UNUSED SECTION(".data_bank2");
-static uint8_t dummy_bank3[8192] UNUSED SECTION(".data_bank3");
+static uint8_t dummy_bank1[8192] USED SECTION(".data_bank1");
+static uint8_t dummy_bank2[8192] USED SECTION(".data_bank2");
+static uint8_t dummy_bank3[8192] USED SECTION(".data_bank3");
static d2q9_block_t *block = (void*)0x2000;
/* barrier structures */
/* preprocessor magic */
#define BUILD_BUG(c) do { ((void)sizeof(char[1 - 2*!!(c)])); } while(0);
-#define UNUSED __attribute__((unused))
+#define USED __attribute__((used))
#undef PACKED
#define PACKED __attribute__((packed))
#undef ALIGN